OK, it works now. I have created a OnLoadEnd event, and set the AllowPrintToFile to true;
------------------------------------------------- Tech Tip: How to use the OnLoadEnd public event -------------------------------------------------
This tech tip explains how to control report property settings when saved reports are loaded by assigning an event handler to the OnLoadEnd event of the Report.Template object.
The first thing we need to to is to declare the an event handler for the OnLoadEnd event:
private procedure LoadEndEvent(Sender: TObject);
Then we need to assign the event handler when the form or datamodule containing the report component is created:
procedure TForm1.FormCreate(Sender: TObject); begin
ppReport1.Template.OnLoadEnd := LoadEndEvent;
end;
Next we need to implement the event handler, setting the property values of the report:
procedure TForm1.LoadEndEvent(Sender: TObject); begin ppReport1.AllowPrintToArchive := True; end;
Any published properties of a report component which is used to load saved reports can be restored to the necessary settings using this technique. When a saved report is loaded, the published properties of the report are set the values as they exist in the saved version. These settings depend on the state of the report component when the report was initially saved, and they may not be the ones you want. By assigning this event handler, we can control the report component property values regardless of the values which exist in the saved version of the report.
Comments
AllowPrintToFile to true;
-------------------------------------------------
Tech Tip: How to use the OnLoadEnd public event
-------------------------------------------------
This tech tip explains how to control report property settings when
saved reports are loaded by assigning an event handler to the OnLoadEnd
event of the Report.Template object.
The first thing we need to to is to declare the an event handler for the
OnLoadEnd event:
private
procedure LoadEndEvent(Sender: TObject);
Then we need to assign the event handler when the form or datamodule
containing the report component is created:
procedure TForm1.FormCreate(Sender: TObject);
begin
ppReport1.Template.OnLoadEnd := LoadEndEvent;
end;
Next we need to implement the event handler, setting the property values
of the report:
procedure TForm1.LoadEndEvent(Sender: TObject);
begin
ppReport1.AllowPrintToArchive := True;
end;
Any published properties of a report component which is used to load
saved reports can be restored to the necessary settings using this
technique. When a saved report is loaded, the published properties of
the report are set the values as they exist in the saved version. These
settings depend on the state of the report component when the report was
initially saved, and they may not be the ones you want. By assigning
this event handler, we can control the report component property values
regardless of the values which exist in the saved version of the report.
--
Tech Support mailto:support@digital-metaphors.com
Digital Metaphors http://www.digital-metaphors.com