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

DataViews and RTM's

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

  • 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

This discussion has been closed.