Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 Reporting Services Development
 filtering based on stored procedure recordset

Author  Topic 

diegoo
Starting Member

1 Post

Posted - 2005-01-14 : 14:42:13
I have created dataset1 based on a stored procedure. I would like to use the records in dataset1 to filter a table data region based on Dataset2

Here is what I have


Dataset1 (from stored procedure)

ActiveCode
AA
FF
GG


Dataset2
Code,Metric
AA,1
AA,1
FF,1
CC,10
BB,10
GG,1

I would like to generate a report that looks as follows:

Code,Metric
AA,1
AA,1
FF,1
GG,1

After retrieving the full dataset2, the report definition needs to specify a filter paramater that in my case contains three distinct values AA,FF and GG and apply this to the table data region.

Can somebody please tell me how to set up the necessary parameters and filters based on these requirements to achieve what I am looking for?

Thanks beforehand for your help :)


Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2005-01-15 : 00:32:21
I'm not sure exactly how this hooks into reporting services, but you can filter rows in a DataTable.

The code in C# looks like :

DataTable dt = YourDataSet.Tables[0]; //get the relevant table
DataRows[] dr = dt.Select("code='AA'"); //an array of datarows.

You can then insert the rows into a new datatable.

Have a look at DavidM's sqlops code here http://weblogs.sqlteam.com/davidm/



Damian
Go to Top of Page
   

- Advertisement -