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

Turning archive files into PDF files

edited October 2003 in General
Hello

My application generates reports in archive files. I now need to turn these
archive files into PDF files. What is the best way to do this? Are there
any examples? We have got the TExtraOptions component to enable PDF
generation

Cheers

Paul

Comments

  • edited October 2003
    Sure. Just use the Archive Reader component to load the report and print to PDF.
    The Archive Reader supports the same properties as the Report component
    as far as devices are concerned.

    AR.AllowPrintToFile := True;
    AR.ArchiveFileName := 'c:\test.raf';
    AR.DeviceType := 'PDFFile';
    AR.TextFileName := 'c:\test.pdf';
    AR.ShowPrintDialog := False;
    AR.Print;

    James Waler
    Waler Ltd
    http://www.waler.com
  • edited October 2003
    Thanks that works - ish

    The problem I now have is that I am trying to do this all at runtime.

    When I use the code you gave with a report that has been put onto a form, it
    works fine, but when I use it with a report that has been created at run
    time, associated with the same form, it doesnt. The catch is that it is
    very hard to find out the exact cause of the problem because my application
    is multi threaded

    The form that the report is associated to contains a TExtraDevices
    component.

    Any ideas?

    Cheers

    Paul

  • edited October 2003
    Sorted, problem was with my code

This discussion has been closed.