Cannot print active reports by printer settings (landscape vs portrait)

Posted by: mschmitz on 18 December 2019, 7:04 pm EST

    • Post Options:
    • Link

    Posted 18 December 2019, 7:04 pm EST

    Any active report (section report or page report) try to print whether I change the printer settings from portrait to landscape, it’ll print portrait every time. This happens with multiple users and multiple different printers involved, always the same result. We’d like to be able to switch between portrait and landscape.

    I’m using active reports 11.1.9726.0 (activereportsversion.jpg attachment). As an example I’m trying to print the sample report called calculate fields for visual studio 2013 (projectsample.jpg attachment). I tried printing as portrait (printasportrait.jpg attachment) and then tried printing as landscape (printaslandscape.jpg attachment). They both print as portrait despite specifying one of them print as landscape (printresults.jpg attachment). I’ve seen other mentions of this problem on this forum but have not found a workable solution yet.

  • Posted 18 December 2019, 7:06 pm EST - Updated 30 September 2022, 5:24 pm EST

  • Posted 19 December 2019, 2:33 am EST

    Hello,

    You would need to set the Orientation for the report first. For this, you can set the report’s PageSettings.Orientation property.

    In the “CalculatedFields” sample, this can be done as follows:

    private void StartForm_Load(object sender, EventArgs e)
    		{
    			SectionReport rpt = new OrdersReport();
                rpt.PageSettings.Orientation = Document.Section.PageOrientation.Landscape;
    			arvMain.LoadDocument(rpt);
    		}
    

    Hope this helps.

    Thanks,

    Esha

  • Posted 19 December 2019, 8:58 am EST

    Thanks I’ve seen that as a solution also. But if people wanted to be able to choose between landscape and portrait, changing it in printer settings does not allow them to do that for some reason. Is there any way to get those printer settings they choose to apply?

  • Posted 20 December 2019, 2:18 am EST

    Hello,

    Report document must have the mentioned orientation, in order to print them on the specific page. So, you need to make the changes in code for the report, as mentioned earlier. For the printer settings, you can make the changes via code, as follows:

    rpt.Document.Printer.Landscape=true;   
    
    

    So, the report related orientation settings must be made, to be able to reflect them while printing.

    Thanks,

    Esha

  • Posted 20 December 2019, 5:00 am EST

    Thanks unfortunately that’s not what I’m looking for. I was aware of that code option already before I made the original post. I’m not interested in hard-coding an orientation on every report and then imposing that orientation on the user.

    One idea I had was a custom print button that exports the report to a pdf then prints that pdf. From there they could print in whatever orientation they want. Ideally I was hoping there was some configuration change I could try or hotfix I could apply where the printer settings would just work as expected.

    You know if this Is just a known limitation of the software? Or is it possible there is some way to make those printer settings work?

  • Posted 23 December 2019, 5:00 am EST

    Hello,

    The report document is generated completely when we are trying to print the report. Now, changing the orientation through printer settings means changing the report document’s layout. You would need to regenerate the document in this case. This is the default behavior.

    To be able to control the orientation, you can use custom buttons that set the report document’s orientation. Now that the orientation can be selected at run-time using these buttons, you can print the report with the same orientation setting.

    An application showing the same is attached for your reference.

    Thanks,

    Esha

    prj_SectionReport.zip

  • Posted 27 December 2019, 9:35 am EST

    Thanks Esha, it’s likely I’ll end up taking a coding approach like you’re suggesting. What’s unfortunate about that approach though is that the report would have to be reloaded. That would be especially cumbersome for reports that could take a while to load. I’ll keep trying to find a better solution too, I can let you know if I find one. (I don’t give up easily :slight_smile: )

Need extra support?

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

Learn More

Forum Channels