VB6、ActiveReports 和 Ricoh 打印机:旋转页面?

发布于 2024-11-29 10:28:40 字数 737 浏览 1 评论 0原文

我有一个用 VB6 编写的程序。它使用 ActiveReports 生成信件。

报告被循环处理;带有语言构建循环和(一大堆)嵌套的“if”和“case”语句。丑陋!

报告像这样发送到打印机:

Function PrintIt(ltrobj as Object)

    Set ltrobj = MyARdocument '(.Dsr file)
    ltrobj.txtfield1 = strVerbage           'This string was populated somewhere else
    ltrobj.Printer.DisplayProgressDialog = False
    ltrobj.PrintReport False

End Function

现在这是奇怪的部分:从打印机中物理出来的页面在每次循环迭代时都会旋转 90 度。更奇怪的是 -- 这只发生在我的 VB6 应用程序中 -- 其他 Word 文档、报告、批处理作业,无论结果如何都正常。

所以第一页像平常一样出现,标题在前(指向北)。第二页横向出现(页眉指向西)。第三个像第一个一样从打印机中出来,第四个像第二个一样从打印机中出来,等等……

打印机:Ricoh Aficio MP5000

我在打印机上找不到设置,或者在 ActiveReports 中找到控制此设置的属性。

任何想法、帮助或总体方向将不胜感激!

谢谢,

杰森

I have a BEAST of a program written in VB6. It uses ActiveReports to generate letters.

The reports are processed in a loop; with verbage-building loops and (a whole lotta) nested 'if' and 'case' statements. Fugly!

The reports are sent to the printer like such:

Function PrintIt(ltrobj as Object)

    Set ltrobj = MyARdocument '(.Dsr file)
    ltrobj.txtfield1 = strVerbage           'This string was populated somewhere else
    ltrobj.Printer.DisplayProgressDialog = False
    ltrobj.PrintReport False

End Function

Now here's the weird part: The pages physically come out of the printer rotated 90 degrees each iteration of the loop. What's even weirder -- this only happens for my VB6 application -- other Word documents, reports, batch jobs, whatever come out normal.

So the first page comes out like normal, the header first (pointing North). The second page comes out sideways (header pointing West). The third comes out of the printer like the first, the fourth comes out like the second, and on and on...

The printer: A Ricoh Aficio MP5000

I cannot find a setting on the printer, or a property in ActiveReports that controls this.

Any ideas, help, or a general direction would be greatly appreciated!

Thanks,

Jason

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

临走之时 2024-12-06 10:28:40

ActiveReports 中没有“旋转”设置。可能影响这一点的最接近的因素是页面大小和方向,但最坏的情况是我希望它们来回翻转而不是实际旋转页面。我会尝试做几件事:

  1. 跟踪打印机和打印机。与报告打印时的方向和页面大小相关的页面设置。
  2. 尝试打印到另一台打印机,看看是在所有打印机上还是仅在这台打印机上发生这种情况。
  3. 在屏幕上预览报告,看看它们在预览中是否旋转(或者使用 report.Export(...) 将它们导出到 PDF,看看它们是否在那里旋转)。

要跟踪页面设置,您应该在几个地方执行此操作。一个在打印机上,另一个在报告的每一页(或画布)上。还有可能相关的 ActiveReport.PrintWidth(报表的宽度,而不是页面的宽度)。因此,在打印每个报告之前,请尝试找出以下值:

report.PrintWidth
' the default settings for the report
report.PageSettings.TopMargin
report.PageSettings.RightMargin
report.PageSettings.BottomMargin
report.PageSettings.LeftMargin
' actual printer's current settings:
report.Printer.PaperSize
report.Printer.PaperHeight
report.Printer.PaperWidth
report.Printer.Orientation
' settings for a specific page:
for each page in report.Pages:
  report.Pages(...).Width
  report.Pages(...).Height
  report.Pages(...).Orientation

顺便说一句:ActiveReports COM 帮助位于 此处< /a>.

如果预览/PDF 测试看起来不错,那么我会专注于打印机本身。显然,打印到另一台打印机也是如此。否则,请关注 ActiveReports 设置。

希望这有帮助

Scott Willeke
GrapeCity

There is no "rotation" setting in ActiveReports. The closest things that might impact this would be the page size and orientation, but at worst I would expect them to flip back and forth not actually rotate the page. I would try to do a few things:

  1. Trace the printer & page settings related to orientation and page size as report prints.
  2. Try printing to another printer to see if it happens on all printers or just this one.
  3. Preview the reports on screen and see if they're rotated in the preview or not (or export them to PDF with report.Export(...) ad see if they're rotated there).

To trace page settings you should do it in a couple places. One on the printer, and another on each page (or Canvas) in the report. There is also the ActiveReport.PrintWidth (the width of the report, not the pages) that may also be relevant. So just before printing each report try tracing out the following values:

report.PrintWidth
' the default settings for the report
report.PageSettings.TopMargin
report.PageSettings.RightMargin
report.PageSettings.BottomMargin
report.PageSettings.LeftMargin
' actual printer's current settings:
report.Printer.PaperSize
report.Printer.PaperHeight
report.Printer.PaperWidth
report.Printer.Orientation
' settings for a specific page:
for each page in report.Pages:
  report.Pages(...).Width
  report.Pages(...).Height
  report.Pages(...).Orientation

BTW: ActiveReports COM Help is here.

If the preview/PDF test seems okay then I'd focus on the printer itself. Same for the print to another printer obviously. Otherwise, focus on ActiveReports settings.

Hope this helps

Scott Willeke
GrapeCity
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文