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

Retrieving ppReport.TextFileName

edited October 2007 in End User
I have 2 reports where the detail lines are printed to a CSV text file.
The user has the ability to change the file name at run time. I need to
append data from 2nd report to the first. My problem is getting the name
& path the user used to save the first report to. ppReport.TextFileName
is not updated when the user changes the name. Any suggestions?



--- posted by geoForum on http://delphi.newswhat.com

Comments

  • edited October 2007
    Hi Jim,

    Try accessing the file name directly from the file device once the report
    has started generating or after the report has printed. Something like the
    following...

    if Report.FileDevice <> nil then
    lsTextFileName := Report.FileDevice.FileName;

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited October 2007
    Thanks for your help. It worked.
    After a couple tries, found that adding your code to the report's
    OnPrintingComplete event.

    Thanks again
    Jim





    --- posted by geoForum on http://delphi.newswhat.com
This discussion has been closed.