Solved

SSRS DATASET FROM STORED PROCEDURE

Posted on 2011-09-08
3
317 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

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

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

Have you ever had to extract data from a Microsoft SQL Server database and export it to an Excel file, but did not want to use a DTS package? The concept in this article is not new, but it is the answer and will also work on 64-bit SQL boxes.   …
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…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

739 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