Event for dataview or particular report
Is it possible to associate an event with the running of either a
particular dataview, or even a single report?
The idea being that whenever a single report, (or any reports based on
the same query) are run, a process is kicked-off that performs some
calculations on the data-and ensures the accuracy of the report.
I don't want the event to run before every report since it can be time
consuming. Preferrably, the event is "visible" during end-user design
time.
Any ideas, as to best do this?
Thanks in advance!
John
particular dataview, or even a single report?
The idea being that whenever a single report, (or any reports based on
the same query) are run, a process is kicked-off that performs some
calculations on the data-and ensures the accuracy of the report.
I don't want the event to run before every report since it can be time
consuming. Preferrably, the event is "visible" during end-user design
time.
Any ideas, as to best do this?
Thanks in advance!
John
This discussion has been closed.
Comments
the specific criteria for when you want to perform this operation. You
could search for dataviews by name (Dataview.Description is what you see at
the top of the dataview in the DADE workspace, though it usually pulls the
name from the datapipeline's UserName property). You can also look at the
datapipelines as well if you want. You could also pull the TdaSQL object
(Dataview.SQL property)from the dataview to parse the generated SQL for some
further validation of what the query is going to return.
procedure TForm1.ppReport1BeforePrint(Sender: TObject);
var
lDataModule: TdaDataModule;
liIndex: Integer;
lDataView: TdaQueryDataview;
lDataPipeline: TppDBPipeline;
begin
{get the datamodule}
lDataModule := daGetDataModule(ppReport1);
if (lDataModule <> nil) then
begin
for liIndex := 0 to lDataModule.DataViewCount - 1 do
begin
lDataView := TdaQueryDataView(lDataModule.DataViews[liIndex]);
if (lDataView <> nil) and (lDataView is TdaQueryDataView) then
begin
{only custom dataviews can have multiple data pipelines}
lDataPipeline := TppDBPipeline(lDataView.DataPipelines[0]);
ShowMessage(lDataPipeline.Name);
ShowMessage(lDataView.Description);
end;
end;
end;
end;
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
Wow, thanks for the info...You've given me several good options.
John
syntactically correct (ie. submits the sql to the server for the validation)
for the database server when the dataview is built by the end user.
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com