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

Stop Recalculation on Changing Printer

edited March 2005 in Devices
Hello,
I have just finished installing an application with report builder
embedded (version 7.03). The question the end user had is it possible to
stop the report recalculating when change the printer, these use two
printers one for everyday so it is the default and then a production printer
for batch jobs. We tested this on a 3000 page report this took about a hour
to stabilise the preview (on a HP) and a further hour to start printing (on
a Hitachi) as we had changed the printer.

The actual report is a standard A4 and has large enough margins to print the
same on both printers, so in theory this should be possible,

Is it ?

and is so how ?

thanks
Alex

Comments

  • edited March 2005

    A simple solution would be to generate the report to archive (.raf) and then
    use the ArchiveReader to print to the printer. That would cause the pages to
    be generated only a single time.

    Report --> Archive file (.raf) --> ArchiveReader --> Printer



    --
    Nard Moseley
    Digital Metaphors Corporation
    www.digital-metaphors.com



    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited March 2005
    Hello,
    I have looked at the ArchiveReader this is a Digital Metaphors component
    on reading briefly the help I think I would have to ask the development team
    to change the print module, ie. add the device and the reader to print, is
    this correct or can this be done just via the template edit ?

    The other thing is with the end customer they have PDFWriter which we
    already proposed as a solution, the effect would be much the same as to use
    ArchiveReader, ie print to a file and consult/print later ?

    Back to the original question can I stop the preview recalculating all the
    pages when I change my printer device ?

    thanks
    Alex


  • edited March 2005

    1. ArchiveReader and Report, they both descend from a common ancestor,
    TppProducer, and thus share many common properties and methods. To use
    ArchiveReader...

    myArchiveReader.ArchiveFileName := 'c\myReport.raf';
    myArchiveReader.Print;

    That above will result in the printer dialog being displayed. The printer
    could be changed and then the pages sent to the printer.

    2. The ArchiveReader.OnInitializePrinterSetup property can be used to
    programmatically override the printer setup that is saved down with the
    pages.

    3. PDF is another option.

    4. You would need to modify the RB source code to prevent the Report from
    regenerating pages when the printer changes. Check out ppReport.pas, the
    method TppReport.RequestPage. The following code...

    if not(Engine.Page.PrinterSetup.IsPrinterDefEqual(PrinterSetup)) then
    begin
    Publisher.Clear;

    Engine.Reset;
    end;



    --
    Nard Moseley
    Digital Metaphors Corporation
    www.digital-metaphors.com



    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.