• mhaswood (10/28/2013)


    I need some help with cascading parameters in a report with 2 stored procedures. My main sp (startdate and enddate parameters) has all the data I need except the sum of points (2nd sp) between startdate and enddate. The second sp has cstid, startdate and enddate as the parameters. The 2nd sp has all the points listed by cstkey,cstid, pointdatetaken, pointamt and pointtype. I'm not sure what is the best way to add in the 2nd sp so I can get all data I need from 1st sp and sum of points from 2nd sp by each customer. I appreciate any suggestions. Thank you.

    You have stated that the 2nd SP will be used to populate a parameter. Are you sure that these are not just two datasets? What do you want displayed for each of the parameters?

    I think you are looking at two datasets, one for each SP.

    Option 1:

    If this is the case setup the report with a subreport. The main (header) report uses the Start and End parameters to populate the call to SP1. The subreport would be included within a tablix on the main report aligned to each row in the first SP. The subreport dataset would be based on SP2 with the Start and End date parameters passed (from the main report parameters) and the cstkey from the first dataset (on the main report). This would populate the SP2 data for each cstkey found using SP1.

    Option 2:

    You could change the dataset to use temporary tables (or CTE) to retrieve the results from the two SP and join the results into a single result set.

    Hope this helps, I my assumptions are wrong I will endeavour to answer with more details.

    Fitz