Products Download Order Support Company

Report Output | End-User Options

You can control whether end users can Archive or Print to any of the supported file formats using the following properties of the Report object:

▪ AllowPrintToArchive
▪ AllowPrintToFile

Setting AllowPrintToArchive to True will enable end users to archive reports. You would then need to provide a user-interface for previewing and printing the archived files using the ArchiveReader component. For an example of how to use the ArchiveReader, see demo 151 (..\RBuilder\Demos\Reports\dm0151.pas).

Setting AllowPrintToFile to True will enable end users to print to the any of the available file formats. You can control which file formats are available to end users via the device class registration procedures. For example, the following code would remove the ReportTextFileDevice from the list of available file formats:

uses
  ppDevice, ppFilDev;

ppUnRegisterDevice(TppReportTextFileDevice);

End-User Applications
In order to set the AllowPrintToArchive and AllowPrintToFile properties within the context of an end-user application, the OnNew and OnLoad events of the Report.Template object should be used to set the default properties of the report. For example, in the End-User demo application, you would add the following code to the main form:

procedure TmyEndUserSolution.FormCreate(Sender: TObject);
begin
{assign event-handler to template events}
ppReport1.Template.OnNew := ReportTemplateEvent;
ppReport1.Template.OnLoadEnd := ReportTemplateEvent;

{remove the report text file device }
ppUnRegisterDevice(TppReportTextFileDevice);

end;

procedure TmyEndUserSolution.ReportTemplateEvent(Sender: TObject);
begin

{set default report properties}
ppReport1.AllowPrintToArchive := True;
ppReport1.AllowPrintToFile := True;

end;