can't get viewer.page.count

Posted by: progame-dd on 4 August 2017, 3:02 pm EST

  • Posted 4 August 2017, 3:02 pm EST

    Viewer.PrintReport bShowPrinterDialog


    when i print some reports continues to pdf printer, only the first printing can get correct viewer.page.count, others is 0.


    after i add code behide it:


    Viewer.PrintReport bShowPrinterDialog


    Doevents


    so i can get the right pagecount.


    Why?


    if i print them to office image writer printer, it's ok.

  • Replied 4 August 2017, 3:02 pm EST

    Hello,

    Could you please detail how do you call PrintReport(bDisplayDialog As Boolean) method exactly? Do you pass True or False value?







    If you want to print the report to PDF you may want to  take a look at the following KB article on how to print directly to the printer:
    http://www.datadynamics.com/forums/15/ShowPost.aspx

    You will need to specify the name of the
    printer device before you print:
    Dim rpt As ActiveReport1
    Set rpt = New ActiveReport1
    rpt.Printer.DeviceName = "rpt.PrintReport False


    How do you get the Pages.Count property?

    Is it possible to post a code sample here?
  • Replied 4 August 2017, 3:02 pm EST

    we need save report as rdf binary stream:


    Viewer.Pages.Save


    so we must use viewer to print report


    bShowPrintDialog is boolean value

  • Replied 4 August 2017, 3:02 pm EST

    if i print a report, then click button to print the next, it works fine. but if i let it print many reports at one time, only the first printing can get the right pages.count value.


    but select "Microsoft Office Document Image Writer" is ok, i guess because printing is broken when i save the image file.


    and i add "Doevents" after print also can get the right value.

Need extra support?

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

Learn More

Forum Channels