Report.DeviceType in Subreports

edited July 2017 in General
Hi,

We use RBuilder 18.01.

we have Report1 (Headerdefinition) which is loaded in other reports as
a subreport.

My question is:
How can I determin the devicetype of the parentreport in the subreports
(with loaded "Report1")?


Also I found out that on printing a report into a file (e.g. PDF)
"Report.DeviceType" seems not be changed to "PDF".
Within RAP i get "Printer" as devicetype.

Thank you, for your support,
Josef

Comments

  • edited July 2017
    Hi Josef,

    1. When accessing the main report from a subreport, you will want to use
    the Report.ParentReport property. Once you load your header report into
    a subreport it becomes a TppChildReport.

    2. The Report.DeviceType property will remain consistent with its
    initial value regardless what is selected in the Print dialog. If you
    would like to know what a user selected in the Print dialog, you can
    access the TppReport.PrintDialog.DeviceType property.

    Below is some sample RAP code I tested to show the device selected by
    the user in the print dialog from within the subreport.

    procedure Subreport1OnPrint;
    begin
    if Report.ParentReport.FileDevice <> nil then
    ShowMessage(Report.ParentReport.PrintDialog.DeviceType);

    end;
    --
    Best Regards,

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