Home End User
New Blog Posts: Merging Reports - Part 1 and Part 2

Customization of End-user report designer

edited June 2009 in End User
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

Comments

This discussion has been closed.