Customization of End-user report designer
I am currently upgrading an old Delphi 5 application to Delphi 7 and have
problems with customization of end-user report designer. I hope that someone
can help me be in the right direction.
This old application was built with ReportBuilder 7 and I now use
ReportBuilder pro 11.04 (the latest). Lots of things have happened since and
the code does not compile anymore. My problems are limited to one form where
I have a TppDesigner, which is used to load, edit and save a template
(loading and saving template actually read and write from a zip file, and
are therefore customized).
The main idea is that I want to do the following:
* Saving template method is customized (FileSaveButton.OnClick was
assigned my own procedure).
* Open button is hidden.
* "Data tree" hidden.
* "Report tree" hidden.
* The menu items Open, Close, Save As, LoadSubreport, Print,
PrintToFileSetup, ReportData and Help are hidden.
This customization is performed in the TppDesigner.OnShow event and my code
is as follows:
procedure TFrmProjectTree.ReportDesignerShow(Sender: TObject);
begin
If (ReportDesigner.Form is TppDesignerWindow) then
With (ReportDesigner.Form as TppDesignerWindow) do begin
//Customize the end-user report designer
With TppStandardToolbar(ToolbarManager.FindToolbar('Standard')) do
begin
//Assign a more appropriate procedure to save button and hide
open button.
FileSaveButton.OnClick := ReportTemplateSaveClick;
FileOpenButton.Visible := False;
end;
//The 'Data Tree' toolbar is hidden
If Assigned(ToolbarManager.FindToolbar('DataTree')) then
ToolbarManager.RemoveToolbar('DataTree');
//The 'Report Tree' toolbar is hidden as well
If Assigned(ToolbarManager.FindToolbar('ReportOutline')) then
ToolbarManager.RemoveToolbar('ReportOutline');
//Hide some irrelevant items in file menu
mniFileOpen.Visible := False;
mniFileOpen.Shortcut := scNone;
mniFileClose.Visible := False;
mniFileSave.OnClick := ReportTemplateSaveClick;
mniFileSaveForm.Visible := False;
mniFileSaveAs.Visible := False;
mniFileLoadSubreport.Visible := False;
mniFilePrint.Visible := False;
mniFilePrintToFileSetup.Visible := False;
mniReportData.Visible := False;
//Hide help menu
MniHelp.Visible := False;
end;
end;
The compiler throws a lot of "Undeclared identifier" errors
(TppStandardToolbar, ToolbarManager, FindToolbar, FileSaveButton etc.).
Looking through ReportBuilder code did not help me that much, and neither
did the help file or the examples. I really hope someone can enlight me on
this matter. Thanks.
J?r?me
problems with customization of end-user report designer. I hope that someone
can help me be in the right direction.
This old application was built with ReportBuilder 7 and I now use
ReportBuilder pro 11.04 (the latest). Lots of things have happened since and
the code does not compile anymore. My problems are limited to one form where
I have a TppDesigner, which is used to load, edit and save a template
(loading and saving template actually read and write from a zip file, and
are therefore customized).
The main idea is that I want to do the following:
* Saving template method is customized (FileSaveButton.OnClick was
assigned my own procedure).
* Open button is hidden.
* "Data tree" hidden.
* "Report tree" hidden.
* The menu items Open, Close, Save As, LoadSubreport, Print,
PrintToFileSetup, ReportData and Help are hidden.
This customization is performed in the TppDesigner.OnShow event and my code
is as follows:
procedure TFrmProjectTree.ReportDesignerShow(Sender: TObject);
begin
If (ReportDesigner.Form is TppDesignerWindow) then
With (ReportDesigner.Form as TppDesignerWindow) do begin
//Customize the end-user report designer
With TppStandardToolbar(ToolbarManager.FindToolbar('Standard')) do
begin
//Assign a more appropriate procedure to save button and hide
open button.
FileSaveButton.OnClick := ReportTemplateSaveClick;
FileOpenButton.Visible := False;
end;
//The 'Data Tree' toolbar is hidden
If Assigned(ToolbarManager.FindToolbar('DataTree')) then
ToolbarManager.RemoveToolbar('DataTree');
//The 'Report Tree' toolbar is hidden as well
If Assigned(ToolbarManager.FindToolbar('ReportOutline')) then
ToolbarManager.RemoveToolbar('ReportOutline');
//Hide some irrelevant items in file menu
mniFileOpen.Visible := False;
mniFileOpen.Shortcut := scNone;
mniFileClose.Visible := False;
mniFileSave.OnClick := ReportTemplateSaveClick;
mniFileSaveForm.Visible := False;
mniFileSaveAs.Visible := False;
mniFileLoadSubreport.Visible := False;
mniFilePrint.Visible := False;
mniFilePrintToFileSetup.Visible := False;
mniReportData.Visible := False;
//Hide help menu
MniHelp.Visible := False;
end;
end;
The compiler throws a lot of "Undeclared identifier" errors
(TppStandardToolbar, ToolbarManager, FindToolbar, FileSaveButton etc.).
Looking through ReportBuilder code did not help me that much, and neither
did the help file or the examples. I really hope someone can enlight me on
this matter. Thanks.
J?r?me
This discussion has been closed.
Comments
The designer has drastically changed since RB 7. Take a look at the
following RBWiki articles on how to customize the current designer toolbars
and menus. There is also a wealth of information in this parent topic.
http://www.digital-metaphors.com:8080/End-User/Designer/How_To...Customize_Designer_Menu_and_Toolbars
http://www.digital-metaphors.com:8080/End-User/Designer
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Thanks for your answer.
I have just discovered your wiki and everything I need is actually properly
listed in http://www.digital-metaphors.com:8080/End-User/Designer. Amazing
...and almost too easy ;-)
You just saved my day and everything now works like a charm (it did not take
too long to adapt the code)! Thanks a lot!
(a very glad) J?r?me
Glad you like it!
For RB 10 we re-designed and re-factored the internals the report designer
and made it much simpler to customize
--
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com