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
 SQL Server 2005 Forums
 Analysis Server and Reporting Services (2005)
 Pass Parameters between Two Datasets

Author  Topic 

Peace2007
Posting Yak Master

239 Posts

Posted - 2008-07-27 : 02:09:07
Hi,

Is there any way to pass parameters between two datasets?
I need to filter the 2nd datasets on one of the fields of the 1st data set.

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-07-27 : 02:11:16
Yup you can. just add a parameter to second dataset and set the value as a value from first dataset. but you need to make sure that passed value is an aggregated value.
Go to Top of Page

Peace2007
Posting Yak Master

239 Posts

Posted - 2008-07-27 : 02:19:45
thanks for the reply
The value I've set for the parameter is as: =First(Fields!PersonnelCode.Value, "shared_DS")
but it says the parameter value is a field and gives error!
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-07-27 : 13:44:06
quote:
Originally posted by Peace2007

thanks for the reply
The value I've set for the parameter is as: =First(Fields!PersonnelCode.Value, "shared_DS")
but it says the parameter value is a field and gives error!


can you explain your scenario please? some background info will help us to suggest more accurate soln.
Go to Top of Page

Peace2007
Posting Yak Master

239 Posts

Posted - 2008-07-28 : 01:59:50
I think the answer to my Q is no. That is, it's not possible to pass parameter between two data sets.
The scenario is as follows:
I've created two data sets on one report, dataset1 has a field called testID I need to filter the dataset2 on test ID values.In such case it gives error indicating that forward dependency is not possible. I think it's because it cannot fill the 1st DS and at the same time fill the 2nd DS accordingly.
Is that true?
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-07-28 : 03:55:23
quote:
Originally posted by Peace2007

I think the answer to my Q is no. That is, it's not possible to pass parameter between two data sets.
The scenario is as follows:
I've created two data sets on one report, dataset1 has a field called testID I need to filter the dataset2 on test ID values.In such case it gives error indicating that forward dependency is not possible. I think it's because it cannot fill the 1st DS and at the same time fill the 2nd DS accordingly.
Is that true?


ah...that might be a problem. so what you want is for each value of a field in first dataset you need some related info? cant you try wrapping them in the same dataset and using rqd fields alone at places where you want them?
Go to Top of Page

DietSquirt
Starting Member

7 Posts

Posted - 2008-07-31 : 10:00:19
This can be done, make sure the parameters are evaluated in the correct order. MSDN has a tutorial on Cascading Parameters:
http://msdn.microsoft.com/en-us/library/aa337426.aspx
Go to Top of Page

Peace2007
Posting Yak Master

239 Posts

Posted - 2008-08-02 : 04:52:59
Thank you SQuirt
I'm doing the same as MSDN says but it says "parameter memID is missing a value"
I have set memID parameter as internal and its default and available values are read from one of the fields of the first dataset. and I have filtered the 2nd dataset on memID
Do you know why?
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-08-02 : 05:35:21
quote:
Originally posted by Peace2007

Thank you SQuirt
I'm doing the same as MSDN says but it says "parameter memID is missing a value"
I have set memID parameter as internal and its default and available values are read from one of the fields of the first dataset. and I have filtered the 2nd dataset on memID
Do you know why?


the error is basically because somewhere in your report you've a call the data set without passing a value for memID. what is the value that you're trying to map to it in report?
Go to Top of Page

Peace2007
Posting Yak Master

239 Posts

Posted - 2008-08-02 : 05:50:39
I want it to read the value from one of the fields of the first dataset in the same report
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-08-02 : 05:57:54
quote:
Originally posted by Peace2007

I want it to read the value from one of the fields of the first dataset in the same report


you mean individual values or aggregated value of field?
Go to Top of Page

Peace2007
Posting Yak Master

239 Posts

Posted - 2008-08-02 : 06:08:31
aggregate
when i refer to it it returns as SUM(field)
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-08-02 : 06:13:18
quote:
Originally posted by Peace2007

individual I suppose!



so how do you relate which value should go for parameter? or do you want to sent all values from dataset field as csv list? i cant understand you scenario. some background explanation will help.
Go to Top of Page

Peace2007
Posting Yak Master

239 Posts

Posted - 2008-08-04 : 06:50:14
I don't want to create csv list. I just need to filter the 2nd dataset on a list of values (not all values) read from the 1st data set.
The scenario is as below:
-the 1st data set has two fields (projectID, memberID) each project has more than one member
-the 2nd data set has two fields (memberID, member name)
-so I need to find member names for a specific project,that is I want to find all memeberIDs of one project then filter the 2nd dataset on that list of members ID
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-08-04 : 13:50:34
quote:
Originally posted by Peace2007

I don't want to create csv list. I just need to filter the 2nd dataset on a list of values (not all values) read from the 1st data set.
The scenario is as below:
-the 1st data set has two fields (projectID, memberID) each project has more than one member
-the 2nd data set has two fields (memberID, member name)
-so I need to find member names for a specific project,that is I want to find all memeberIDs of one project then filter the 2nd dataset on that list of members ID


then you need to return them along with the first query as a single resultset. cant understand why you're trying to return related data seperately in two datasets.
Go to Top of Page

Peace2007
Posting Yak Master

239 Posts

Posted - 2008-08-04 : 23:36:22
the two data sets read data from two different databases
quote:
then you need to return them along with the first query as a single result set
Could you please explain how?
Go to Top of Page
   

- Advertisement -