Direct print of section report i.e. not via the Viewer

Posted by: peter on 22 May 2019, 12:46 am EST

    • Post Options:
    • Link

    Posted 22 May 2019, 12:46 am EST

    My reports print fine via the previewer but I need to print some of them directly to the default printer and not via the previewer.

    Dim ThisSectionReport = New arPlayerList
    ThisSectionReport.ThisSQL = sql    [i]' this passes the sql string and the report itself connects to the database[/i]
    ThisSectionReport.Run()
    ThisSectionReport.Document.Printer.Print()
    Dim sectionDocument = ThisSectionReport.Document
    sectionDocument.Print()
    

    The final line gives an error “print is not member of sectionDocument” and when I change the final line to sectionDocument.Printer.Print() it prints but just a blank page emerges.

  • Posted 22 May 2019, 7:58 pm EST

    Hi,

    The issue of printing blank page with sectionDocument.Printer.Print() occurs as this is not supported for printing the report.

    In order to print the Report directly, without using the Viewer, you can use:

    1. The Print method of SectionDocument and for using it, you need to ensure that reference to the GrapeCity.ActiveReports.Viewer.Win assembly is added in your application.

      To enable the Print method, you also need to explicitly import the GrapeCity.ActiveReports namespace. Add code like the following at the beginning of the code file that calls the Print method:
    Imports GrapeCity.ActiveReports
    
    
    1. You can also use Print method of PrintExtension class for the same. More information on the Printing methods is available at the following documentation link:

      https://help.grapecity.com/activereports/webhelp/AR13/webframe.html#PrintMethodsInActiveReportsDeveloper.html

    Thanks,

    Esha

  • Posted 23 May 2019, 10:18 am EST

    Thanks - works perfectly now.

Need extra support?

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

Learn More

Forum Channels