Interleave Two ActiveReport With Different Page Sizes to On Print Job

Posted by: scott.ellsworth on 30 August 2020, 6:37 am EST

  • Posted 30 August 2020, 6:37 am EST

    I have two ActiveReports where the data is related. One is letter page while the other is legal. They have different datasources.

    I want to interleave the two reports so I print the letter size report for a given subset of data (could be multiple pages) then the legal size report for the corresponding data. The goal is to automate the matching of the letter report with the corresponding legal report in the printed output so it is already collated.

    I can’t simply send them to the printer one after the other because each label will be a separate print job and if the letter paper jams the legal will continue to print and the collation will be destroyed.

    I’ve found this blog post but it falls a bit short of my requirement

    https://www.grapecity.com/blogs/merge-multiple-activereports

    The gap is that when you merge reports in this fashion the resulting merged report it seems can only have a single common page size so the legal report is printed on two pages.

    I found some code that can do this with .NET PrintDocument but I can’t find a path to get from SectionReport objects to PrintDocument.

    Any ideas on a solution would be appreciated.

  • Posted 30 August 2020, 3:44 pm EST

    Hello,

    Could you please refer the following blog:

    https://www.grapecity.com/blogs/how-to-create-pages-of-mixed-orientation-in-activereports

    Hope it helps.

    Thanks,

    Mohit

  • Posted 31 August 2020, 2:08 am EST

    Sorry, but that suggestion doesn’t yield the correct result.

    It would appear that the viewer has a page size and when presented with a page which doesn’t fit on the viewer’s page size it splits the output over two pages.

    Im my case I have one or more letter size landscape format labels which are followed by two or more legal size landscape format labels. then one or more of the letter size labels , two or more legal size labels, and so on.

    I can get the labels to appear in a viewer with no problem, but when I attempt to print the labels they are all printed on letter size paper with the legal labels split over two letter pages each.

    Any other thoughts?

  • Posted 31 August 2020, 6:32 pm EST

    Hello,

    Could you please use the PrintProgess event of the viewer as follow:

    viewer1.Document.PrintProgress += Document_PrintProgress;
         
    
         private void Document_PrintProgress(object sender, GrapeCity.ActiveReports.Extensibility.Printing.PrintProgressEventArgs e)
         {
             var doc = sender as GrapeCity.ActiveReports.Document.SectionDocument;
    
             // Set the paper tray to use for pages other than the first one.
             if (e.CurrentPage > 1)
             {
                 doc.Printer.PaperKind = System.Drawing.Printing.PaperKind.Legal;
             }
             // Set the paper tray to use for the first page.
             else
             {
                 doc.Printer.PaperKind = System.Drawing.Printing.PaperKind.Letter;
             }
         }
    

    Also, refer to the following link:

    https://www.grapecity.com/blogs/print-section-reports-multiple-trays

    Hope it helps.

    Thanks,

    Mohit

Need extra support?

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

Learn More

Forum Channels