Problem setting Print Orientation

Posted by: hampdentech on 4 August 2017, 2:51 pm EST

  • Posted 4 August 2017, 2:51 pm EST

    I have a report saved as a ReportXML. The report is loaded through an ActiveX DLL. When calling the DLL from a VB application, the report renders fine with landscape orientation. When I call the DLL through an ASP page and try to view the report in the viewer ActiveX control, I see the red, vertical dotted line indicating that one or more controls is outside of the printable area, almost as if it did not recognize the orientation setting.


    I have tried setting the print orientation in the report itself (File/Page Setttings) and through code in the ActiveX DLL when the report is first created. I have also tried putting code in the script's ReportStart event to set the orientation but nothing seems to work.


    Any ideas?

  • Replied 4 August 2017, 2:51 pm EST

    ActiveReports will look for the printer drivers for the default printer installed on the machine where it generates the report.  It will then attempt to apply the page/paper settings you have specified.  If the settings are not supported by the driver ActiveReports will use its default settings to render the report.  If you have no default printer or printer drivers, ActiveReports will always use the same generic settings for rendering the report.

    To use a printer other then your default you set the Printer.DeviceName to a string that is the path to your printer
    Example:
    Me.Printer.DeviceName = "\\ServerP01\HP LaserJet 5/5M"

    If you are not adding print functionality to your application and mearly wish to view the report, you can use the virtual printer by setting the DeviceName to an empty string.
    This will allow ActiveReports to use paper settings you specify regardless of printer drivers, but removes the ability to have the report's document be printed.


  • Replied 4 August 2017, 2:51 pm EST

    I did forget to set rpt.Printer.DeviceName = "", however adding this to the ReportStart() event had no effect.


    Still looking for a resolution.

  • Replied 4 August 2017, 2:51 pm EST

    I assume you are setting
    rpt.PageSettings.Orientation = ddOLandscape
    In script as well?

    I wonder if you have a control off the design surface. You can check by using the report explorer and double checking all the controls. Are you dynamicly adding controls etc?
  • Replied 4 August 2017, 2:51 pm EST

     brian-dd wrote:
    I assume you are setting
    rpt.PageSettings.Orientation = ddOLandscape
    In script as well?

    I wonder if you have a control off the design surface. You can check by using the report explorer and double checking all the controls. Are you dynamicly adding controls etc?


    I have tried this. I don't think there's a control off of the design surface because I have a standalone VB app that calls the DLL in the same fashion as the ASP application. The orientation appears correctly in the Viewer Window of the standalone application.


    Also, if I change the output format to a PDF in the ASP page it still prints portrait and not landscape. The problem seems to be limited to generating the report from within an ASP.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels