Question

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

Was it helpful?

Solution

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
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top