Toggle navigation
ReportBuilder Support Forums
Categories
Discussions
Activity
Sign In
Home
›
General
ReportBuilder 22.06 now available including Delphi 12.2 support!
New Blog Posts: Merging Reports -
Part 1
and
Part 2
DataViews and RTM's
rbuser
February 2002
edited February 2002
in
General
Is there some kind of program you have that would drop a dataview and
put it back in again without having to go thru the report edit dialog?
Comments
digitalmetaphors
February 2002
edited February 2002
Do you mean load a datamodule? This can be done like this:
procedure TForm1.Button1Click(Sender: TObject);
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;
end;
If you have the datamodule, you can access the dataviews inside of it.
There is a DataModule.DataViewCount property to loop through the dataviews:
lDataView := DataModule.DataViews[liDataviewIndex]; {TdaQueryDataView}
Once you have the dataview, you can access the TdaSQL object to modify it if
you want.
lSQL := lDataView.SQL; {TdaSQL}
Cheers,
Jim Bennett
Digital Metaphors
Digital Metaphors Corporation
http://www.digital-metaphors.com
info@digital-metaphors.com
This discussion has been closed.
Comments
procedure TForm1.Button1Click(Sender: TObject);
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;
end;
If you have the datamodule, you can access the dataviews inside of it.
There is a DataModule.DataViewCount property to loop through the dataviews:
lDataView := DataModule.DataViews[liDataviewIndex]; {TdaQueryDataView}
Once you have the dataview, you can access the TdaSQL object to modify it if
you want.
lSQL := lDataView.SQL; {TdaSQL}
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com