Solved

SSRS DATASET FROM STORED PROCEDURE

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Written by Valentino Vranken. Introduction: The first step of creating a SQL Server Reporting Services (SSRS) report involves setting up a connection to the data source and programming a dataset to retrieve data from that data source.  The data…
Introduction In the following article I’ll be discussing and demonstrating several different ways of how images can be put on a report. I’m using SQL Server Reporting Services 2008 R2 CTP, more precisely version 10.50.1352.12, but the methods ex…
A short film showing how OnPage and Connectwise integration works.
I designed this idea while studying technology in the classroom.  This is a semester long project.  Students are asked to take photographs on a specific topic which they find meaningful, it can be a place or situation such as travel or homelessness.…

929 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now