Home Devices
New Blog Posts: Merging Reports - Part 1 and Part 2

RB v.7 - ArchiveReader PrintToDevices not working

edited March 2008 in Devices
I'm out of ideas on how to setup an archivereader using PrintToDevices as
follows:

Client pgm has an ArchiveReader created. Goal is to fetch any number of RAF
archive files from the server consecutively and automatically print each
archive to a printer until all have printed. The pgm will let the user
select options in the Printer Dialog window before the first archive is
printed. After that, the pgm will print all archive files to the same
printer consecutively until finished.

I have the first archive printing OK after the user selects the settings in
the Printer Dialog. I use the ArchiveReader component and just set the new
archivefilename to the next archive and execute ArchiveReader.PrintToDevices
but nothing is printed and no errors are generated.

So I substituted the Print method in place of the PrintToDevices (and set
ShowPrinterDialog=False). When this hits the second file to print, the
printer settings have been reset to default before the pgm ever started. I
want to keep the printer settings the user selects before printing the first
archive.

Either I need to get PrintToDevices to print the subsequent archives or I
need the keep the user's printer settings and use Print.

I can't find any help in the RB demos or tutorials for this problem. I
think I'm forgetting some basic setting here to get one of the choices to
work.

Anyone had a similar problem?

Thanks for any help.

Comments

  • edited March 2008
    Hi Marlin,

    When using the Archive Reader, you need to be sure you set the printer setup
    properties in the OnInitializePrinterSetup event. This ensures that the
    printer setup you define will be used for the entire archive being printed.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited March 2008
    Thanks Nico.
    I used the OnInitializePrinterSetup event to assign the correct printer
    values to lArchiveReader.PrinterSetup.
    The printer setting looks correct for the archivereader and just before
    executing lArchiveReader.PrintToDevices.
    But when the PrintToDevices is executed, nothing is printed to the printer
    and no errors are generated.
    Is there some other init I need perform on the ArchiveReader to use
    lArchiveReader.PrintToDevices after the first call to lArchiveReader.Print ?

    Regards,
    Marlin


  • edited March 2008
    Hi Marlin,

    The PrintToDevices command essentially gives you complete control over the
    print process. This means that it is up to the developer to create and
    assign the device(s) to be printed to and manually initialize any parameters
    or show any dialogs that need to be used. Making a call to Report.Print
    takes care of all of this for you.

    Is there a reason you cannot call Report.Print for each report you want to
    print?

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited March 2008
    Niko,
    No particular reason to use PrintToDevices except I switched to it to try
    getting around the
    print problems I seemed to have after the first Print method was called. I
    just tried the
    Print method again for all reports and it works as needed. The key issue
    was the
    setting the printersetup values in the OnInitializePrinterSetup event.

    Thanks for your help.
    Regards,
    Marlin

This discussion has been closed.