About the Designer...
Hi,
many thanks to Nico for his reply.
My application shows the designer via a menu choice on the main form.
Clicking on it, the code of the menu item is the following:
procedure TFSidMain.BtnRepMakerClick(Sender: TObject);
begin
ppReport1.FreeModules;
ppReport1.Template.New;
ppReport1.Modified:=False;
ppDesigner1.ShowModal;
end;
So the designer is showed with all his tabs. Working on it (accessing data,
building the project, programming with RAP, previewing) often the app give
an access violation error or other error types (like "the object has no
parent" or other errors) and the delphi ide shows the ppEndUsr unit blocked
on this procedure:
procedure TppDesigner.ShowModal;
begin
if (GetDesignerWindow <> nil) then
begin
FDesignerWindow.DesignerState := FDesignerWindow.DesignerState +
[dsModal];
try
FDesignerWindow.ShowModal; <<<<--- blocked here -------------
finally
FDesignerWindow.DesignerState := FDesignerWindow.DesignerState -
[dsModal];
end;
end;
end;
After I can only "Reset the program" because the errors are infinite.
Moreover, even if I modify the report, when I close it without saving it,
the designer don't say me that "the report was modified, do you want to save
it?" (I remember that on my other applications this message was always
displayed when the report was modified... bah!)
I'm sure that I've made some banal error, but where? I run the Designer in a
bad manner?
Any idea?
Many thanks in advance
Robert
many thanks to Nico for his reply.
My application shows the designer via a menu choice on the main form.
Clicking on it, the code of the menu item is the following:
procedure TFSidMain.BtnRepMakerClick(Sender: TObject);
begin
ppReport1.FreeModules;
ppReport1.Template.New;
ppReport1.Modified:=False;
ppDesigner1.ShowModal;
end;
So the designer is showed with all his tabs. Working on it (accessing data,
building the project, programming with RAP, previewing) often the app give
an access violation error or other error types (like "the object has no
parent" or other errors) and the delphi ide shows the ppEndUsr unit blocked
on this procedure:
procedure TppDesigner.ShowModal;
begin
if (GetDesignerWindow <> nil) then
begin
FDesignerWindow.DesignerState := FDesignerWindow.DesignerState +
[dsModal];
try
FDesignerWindow.ShowModal; <<<<--- blocked here -------------
finally
FDesignerWindow.DesignerState := FDesignerWindow.DesignerState -
[dsModal];
end;
end;
end;
After I can only "Reset the program" because the errors are infinite.
Moreover, even if I modify the report, when I close it without saving it,
the designer don't say me that "the report was modified, do you want to save
it?" (I remember that on my other applications this message was always
displayed when the report was modified... bah!)
I'm sure that I've made some banal error, but where? I run the Designer in a
bad manner?
Any idea?
Many thanks in advance
Robert
This discussion has been closed.
Comments
Which version of ReportBuilder/Delphi are you using? In my testing with
ReportBuilder 10.02 and Delphi 7, the code you posted below seems to work
correctly including with the registering of RAP and DADE.
ReportBuilder will not check if a template is modified or not by default.
You will need to set the Report.SaveAsTemplate property to True in order for
this to happen.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
I use RB 9 and Delphi 7.
Thanks Nico.
Robert
Regards
Robert
reports created will be saved in RTM files. If I set the SaveAsTemplate
property to True and run the program, I've the ETemplateLoadError: File Not
Found error because the Template.FileName is empty (with
Template.SaveTo=stFile).
I remember that in other my apps I've set the Template.DatabaseSettings, so
the templates where saved into the RB database tables. Now I don't want this
database, because I create RTM files.
Now I want do a bit of order in my mind: if I set the Template.FileName to a
Filename like "mickymouse", into this mickymouse file will go all infos
about all my RTM report files (like the RB database)? It's true...I'm very
confused.
And without the SaveAsTemplate=True I never can have the message "The report
was modified... Do you want to save it?".
Regards
Robert.
- At Delphi design-time leave Report.SaveAsTemplate set to False. In your
application add some code to manage the reports
myReport.Template.OnLoadEnd := myOnLoadEndHandler;
myReport.Template.Onnew := myOnNewHandler;
myReport.SaveAsTemplate := True;
myDesigner.ShowModal;
The event-handlers would look like this...
procedure TForm1.myOnLoadEndHandler(Sender: TObject);
begin
// initialize default props for existing reports
myReport.SaveAsTemplate := True; // make sure existing reports have this
set
end;
procedure TForm1.myOnNewHandler(Sender: TObject);
begin
// initialize default props for new reports
myReport.SaveAsTemplate := True;
end;
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com