Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 331
  • Last Modified:

SSRS DATASET FROM STORED PROCEDURE

Have a stored procedure that massages alot of data.  It returns two sets of records.  I would like to use the first set for the details of the main report and the second set as a subreport for those main report details.  I could separate it into 2 sprocs, but would rather not since there's a lot hits to the server, why run it twice?  When I refresh the dataset it only sees the first set of results.  Anyway to make this work as is or should I just separate it?
0
MariaHalt
Asked:
MariaHalt
  • 2
1 Solution
 
dbaSQLCommented:
I've almost always had to separte the two datasets, and call the 2nd from the first, as a subreport.
http://www.codeproject.com/KB/reporting-services/SSRS_Part2.aspx

Of course, it is more optimal to collect all the data in one dataset, because it reduces server round trips, and simplifies the data processing.  Again, I've almost always had to do a second dataset with a subreport, but maybe you can try it differently.  First create your table that contains both sets of records, but don't detail it -- I think you want to put it into groups.  Then, you just filter the child table to the parent table, on the data return.

This is a good read on using the lookup function to retrieve from two datasets:
http://blog.datainspirations.com/2010/03/19/sql-server-2008-r2-reporting-services-look-up-look-down-look-all-around-part-i/





0
 
MariaHaltAuthor Commented:
I ended up joining my 2 datasets and used grouping and conditional row suppression to make it appear the way they would like it to appear.

Also, thanks for the tip about Lookup function...never used it but now I will.
0
 
dbaSQLCommented:
Excellent!  I would love to see your solution. I believe my email is in my profile, if you don't mind sharing.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now