I use the Query Designer of RepportBuilder to load and store '.dtm' files. Is it possible to load a dtm file at run time just before printing a report (with the TppReport) ?
If NombreConsulta.Text <> EmptyStr then lDialog.Caption := NombreConsulta.Text;
if (lDialog.ShowModal = mrOK) then begin FSQL.Assign(lDialog.SQL); SaveSQLToStream(FSQL, FMemoryStream); ...... .... ... end;
lDialog.Free; ---------------------------------
How can I reuse the SQL result saved in some table of my DB as a DTM file so my users can use the queries designed previously in his own report builder templates????
For future reference, please use your real name when posting to these newsgroups.
The .dtm file is a complete template representation of the entire DADE data module (or entire data workspace in ReportBuilder) not just single queries like you are creating. RB currently does not have the built-in capability to save and load individual dataviews (queries).
Comments
datamodule's template object.
procedure...
var
lDataModule: TdaDataModule;
begin
lDataModule := daGetDataModule(ppReport1);
lDataModule.Free;
lDataModule := TdaDatamodule.Create(Self);
lDataModule.Template.FileName := 'C:\DataModules\Customer.dtm';
lDataModule.Template.LoadFromFile;
lDataModule.Report := ppReport1;
...
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
I use the TdaQueryDesigner sample in order to save the SQL result in my
DataBase, this is to make the user construct his own queries.
-----------------------------------
if FMemoryStream.Size > 0 then LoadSQLFromStream(FSQL, FMemoryStream);
lDialog := TdaQueryDesignerForm.Create(Application);
lDialog.OnValidateName := DataViewValidateNameEvent;
lDialog.SQLClass := TdaSQL;
lDialog.SQL.Assign(FSQL);
lDialog.Initialize;
If NombreConsulta.Text <> EmptyStr then lDialog.Caption :=
NombreConsulta.Text;
if (lDialog.ShowModal = mrOK) then
begin
FSQL.Assign(lDialog.SQL);
SaveSQLToStream(FSQL, FMemoryStream);
......
....
...
end;
lDialog.Free;
---------------------------------
How can I reuse the SQL result saved in some table of my DB as a DTM file so
my users can use the queries designed previously in his own report builder
templates????
Thanks
For future reference, please use your real name when posting to these
newsgroups.
The .dtm file is a complete template representation of the entire DADE
data module (or entire data workspace in ReportBuilder) not just single
queries like you are creating. RB currently does not have the built-in
capability to save and load individual dataviews (queries).
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
I know RB doesn't have the built-in capability, that's why I'm asking you
how to make this possible?
Supose I create on runtime an empty datamodule, if I can create just one
view into it and load the SQL constructed before this can make the trick.
Thanks so much.
Here is an rbWiki example that shows how to create DataViews via code.
http://www.digital-metaphors.com/rbWiki/DADE/Program_Control/How_To...Create_Query_DataViews_via_Code
-
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com