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

Change TextFileName in RAP

edited February 2004 in RAP
G'day,

I am trying to change the ppreport.textfilename property at run-time. I use
the dtPDFFile device type (Using wPDF from wpCubed) to produce PDF files. I
have a pass through function that is called in the ReportBeforePrint Event.
Using the Delphi IDE I can confirm that the value is being Passed Thru.

Also using the IDE, I can confirm that the following Line is executed:

ppreport1.TextFileName := savefolder+'\'+rnm+'.pdf';

(SaveFolder is a global string value and rnm is the passed thru string
value)

After the line is executed, I can check the value of ppReport1.textfilename
and it has not changed. Am I unable to change this valuein RAP????

Comments

  • edited March 2004

    RAP was designed primarily to control the report while it is generating.

    You are encountering a timing issue. If you try to set the
    Report.TextFileName while the report is generating, the assigment is ignored
    by the report. (see ppProd.pas, the SetTextFileName method).

    You might try using the Report.OnPrintDialogCreate event to set print
    dialog's text file name.

    Report.PrintDialog.TextFileName := 'c:\testme.pdf';

    (You will need to code a pass-thru function to do this in RAP.)

    Another alternative would be to use Delphi code to implement the
    Report.Template.OnLoadEnd and initialize the report at that when it is
    loaded.



    --
    Nard Moseley
    Digital Metaphors
    http://www.digital-metaphors.com

    Best regards,

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