Saving rtm to database
Hai Peers,
We need to save the rtm to database once the "Save" button is clicked
in the
Save dialog . Can the file name be obtained from the report designers save
dialog
once it is disposed?. The idea is to load the rtm into a stream and save it
to database.
Also can we associate custom event handlers for the Save and SaveAs
menu items in the report designer?
TIA for any help,
with regards,
Pradeep.
We need to save the rtm to database once the "Save" button is clicked
in the
Save dialog . Can the file name be obtained from the report designers save
dialog
once it is disposed?. The idea is to load the rtm into a stream and save it
to database.
Also can we associate custom event handlers for the Save and SaveAs
menu items in the report designer?
TIA for any help,
with regards,
Pradeep.
This discussion has been closed.
Comments
Check out the two articles below, I think that will give you some ideas for
implementing a solution...
-------------------------------------------------------
Tech Tip: Controlling Designer New, Save, Open actions
-------------------------------------------------------
There are several options for controlling the actions
that occur when a user opens, saves, or creates a new report.
1. Use Report.Template events: OnLoadStart, OnLoadEnd,
OnSaveStart, OnSaveEnd and OnNew.
These events are frequently used to add additional functionality - such as
saving and reading additional meta data when a report loads. They are also
used for performing initializations when a report loads or a new report is
created.
2. Use the TppDesigner.OnOpenDoc and OnSaveDoc.
If you code event-handlers for these events, then the ReportDesigner will
rely on your event-handler code to load and save reports rather than its own
internal logic.
3. Use the TppDesigner.Menu property to access the menu items and attach you
own event-handlers.
----------------------------------------------------
Tech Tip: Using the Designer OnCustomOpenDoc and
OnCustomSaveDoc events
----------------------------------------------------
The Designer OnCustomOpenDoc and OnCustomSaveDoc events can be used to
control the loading and saving of reports. For example, you may want to add
a security feature which does not allow the user to load certain reports.
When the OnCustomOpenDoc, OnCustomSaveDoc events are assigned, the
report designer will not save or load any reports - it will instead fire
the events and your event-handler code will be responsible for taking
the proper action.
For example, in ppDsgner.pas there is a method called
TppDesignerWindow.LoadTemplate that contains the following statement:
if Assigned(FOnCustomOpenDoc) then
FOnCustomOpenDoc(Self)
else
aReport.Template.Load;
Note that in the above statement, the Report.Template settings will
contain the name of the report that is to be loaded etc.
Likewise the TppDesignerWindow.SaveTemplate method contains the
following:
if Assigned(FOnCustomSaveDoc) then
FOnCustomSaveDoc(Self)
else
aReport.Template.Save;
--
Tech Support mailto:support@digital-metaphors.com
Digital Metaphors http://www.digital-metaphors.com
--
Nard Moseley
Digital Metaphors Corporation
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com