PrintOptions PageScaling

Posted by: c.schuller on 16 February 2022, 12:40 am EST

    • Post Options:
    • Link

    Posted 16 February 2022, 12:40 am EST

    Hi there,

    I am using AR14.3 with SectionReport. Our system is generating automatically the PDF report and save the file on the server. Now the report should also print automatically after run. I added the code

    Me.Document.Print(False, False, False)

    on the _ReportEnd. This works also fine, but the Margins are set to 0 so the printer cuts some informations from the top & buttom line. I found a feature named PageScaling and added to the _ReportEnd

    Me.Document.PrintOptions.PageScaling = Extensibility.Printing.PageScaling.FitToPrintableArea

    but nothing happend when the report runs. Is there an other solution or trick to fit the report on the pagesize?

    Thanks in advance.

    Greetings,

    Chris

  • Posted 23 February 2022, 3:00 pm EST

    Hello,

    We apologize for the delayed response, You can try updating the Margins within the ReportStart event to ensure that the report gets printed properly. Please refer to the code snippet below:

    
    private void SectionReport1_ReportStart(object sender, EventArgs e)
            {
                this.PageSettings.Margins= new GrapeCity.ActiveReports.Document.Section.Margins(1, 1, 1, 1); 
            }
    
    

    You may also refer to the sample application implementing the same below.

    Regards

    Dushyant Sharma

    SectionReportApplication.zip

  • Posted 30 May 2022, 10:03 pm EST

    Dear Sharma,

    I apologize my later answer to your reply. Today I found time to check your solution, but I have to modify the report, because the page was setup for A4. After adding the Margins there is a pagebreak which is not good. I am looking more for a solution during the print with a scaling the page or so. Is there any possibilities there?

    Thanks,

    Chris

  • Posted 2 June 2022, 9:57 pm EST

    Hello,

    The page break was being introduced because the left and right margins in the above code snippet were causing the report page size to overflow the printer page size, thus introducing empty pages in between. To resolve the same, please try reducing the margins as below:

    
    private void SectionReport1_ReportStart(object sender, EventArgs e)
            {
                this.PageSettings.Margins= new GrapeCity.ActiveReports.Document.Section.Margins(0.5f, 1, 0.5f, 1); 
            }
    
    

    Furthermore, we can also use PageScaling to scale down the pageSize to PrintableArea using the below code snippet:

    
    rpt.Document.PrintOptions.PageScaling = 
          GrapeCity.ActiveReports.Extensibility.Printing.PageScaling.ShrinkToPrintableArea;
    rpt.Document.Print(true, true, true);
    
    

    However, if the issue persists, please provide a sample report depicting the issue so that we could debug it and reply accordingly.

    Regards

    Dushyant Sharma

    SectionReportApplication.zip

Need extra support?

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

Learn More

Forum Channels