Solved

SSRS DATASET FROM STORED PROCEDURE

Posted on 2011-09-08
3
321 Views
Last Modified: 2012-05-12
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
Comment
Question by:MariaHalt
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 17

Accepted Solution

by:
dbaSQL earned 500 total points
ID: 36504001
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
 

Author Closing Comment

by:MariaHalt
ID: 36506035
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
 
LVL 17

Expert Comment

by:dbaSQL
ID: 36506176
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

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to use Variables  and Custom code in SSRS report and Assembly reference to use compile shared code in SSRS. Its big question for all who are working with SSRS. It is easy to create assembly and refer in SSRS report, still there are some steps…
Introduction Earlier I wrote an article about the new lookup functions (http://www.experts-exchange.com/A_3433.html) that ship with SQL Server 2008 R2.  In this article I’m going to show you another new feature of SSRS 2008 R2, this time in the vis…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question