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

How to print to a comma-dilimited text file

edited May 2007 in General
Hello,

How do I print a report to a comma delimited text file using ReportBuilder
(not TExtraDevice)? I wrote a bare bone application with only a simple
report, then I tried the following code but it only printed an empty file:

ppReport1.AllowPrintToFile := True;
ppReport1.DeviceType := 'TextFile';
ppReport1.TextFileName := 'C:\temp\test.txt';
ppReport1.TextFileType := ftComma;
ppReport1.Print;

When I changed the DeviceType to 'Screen' and the report looks just fine.
What else do I need to do? I have Delphi 7 and RB v7.01.

Thank you.

Bill

Comments

  • edited May 2007
    Hi Bill,

    From the designer file menu, select Print To File Setup... and bring up the
    Print To File dialog. From there you can select which text object are to be
    included in your comma delimited text file. This can be manually controlled
    using the Save, SaveLength, and SaveOrder properties of each text object on
    your report.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.