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

query dataset by name

edited May 2010 in General
RB 12, D7
I have an old feature where the user can export the results of the main
query of a report. It works fine on a report that has only one query in the
Data tab. However, I want to give the user the ability to select which RB
query in the report he wishes to export. I have figured out how to obtain
the names of the queries and I populate a list with the name using the code
below.

How can I reference the Dataset of a query when all I have is the query
name?

Currently I am only able to use the first query using the following code:
lDBPipeline := TppDBPipeline(frmRBuilder.ppReport1.DataPipeline);
et1.DataSet := lDBPipeline.DataSource.Dataset;

Below is the code I use to get the names of the queries. I just can't
figure out how to get the dataset when all I have is the name of the query.

{for each dataview sql, check criteria}
for i :=0 to lDatamodule.DataViewCount-1 do
begin
try
listQuery.Items.Add(ExtractQuery(lDataModule.DataViews[i].UserName));
except
end;
end;
listQuery.ItemIndex :=0;
end;

Comments

  • edited May 2010
    Never mind on this post. As I was writing the post, some things clicked
    with me. Also I found something on the RBWiki that was very helpful. Got
    it worked out.

    Thanks,
    Bob

This discussion has been closed.