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

Changing DeviceType & TextFileName

edited June 2004 in RAP
Hello,

Is it possible to change DeviceType and TextFileName through RAP?

I have used ReportOnPrintDialogCreate and created a pass-through function
called ChangedPDF with the following procedure

Procedure ExecuteFunction(aParams: TraParamList); override;
begin
GetParamValue(0, lsFilename);
frmEndUserInterbase.ppReport1.TextFileName := lsFileName;
frmEndUserInterbase.ppReport1.DeviceType := 'PDFFile';
end;

but when the printersetupdlg is showed it doesn't change the checkbox
PrintToFile, TextFileName, and PrintToDevice (PDF).

I want that the PrinterSetupDlg show PrintToFile = Yes, PrintToDevice (PDF)
and FileName when the user print a report and it can be changed through RAP.
To generate a PDF file I am evaluating TExtraDevices.

Thanks,

Jose Maria Sanmartin

Comments

  • edited June 2004

    Rather than setting the report properties, you need to set the
    Report.PrintDialog properties.

    Delphi code example:


    ppReport1.PrintDialog.AllowPrintToFile := True;

    ppReport1.PrintDialog.TextFileName := 'c:\myReport.txt';
    ppReport1.PrintDialog.DeviceType := dtReportTextFile;


    --

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



    Best regards,

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