SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Analysis Server and Reporting Services (2008)
 Populate tables in report with several Select
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Ciupaz
Posting Yak Master

Italy
232 Posts

Posted - 07/04/2013 :  08:26:18  Show Profile  Reply with Quote
Hello all,
I have to create a report that has several tables (or matrix, is the same).
Now I've created a stored procedure that has several SELECT statement inside it.
Something like:

EXEC dbo.MyProc @Year = 2013 @Month = 6


Field1 - Field2 - Field3
.....
.....
.....


Field10 - Field11 - Field12 - Field13
....
....
....


Field20 - Field21
....
....



Now is it possible to populate each table of my report with the corresponding
Select statement from my stored?


Luigi

visakh16
Very Important crosS Applying yaK Herder

India
52325 Posts

Posted - 07/04/2013 :  08:54:33  Show Profile  Reply with Quote
Nope. Reports can capture only first resultset from procedure
so for your need you need to have multiple procedure
or add a optional parameter based on which you return each resultset and you need to pass corresponding value from report in each case to get required resultset

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

Ciupaz
Posting Yak Master

Italy
232 Posts

Posted - 07/04/2013 :  09:21:28  Show Profile  Reply with Quote
So I have to get an unique resultset from my stored?
And for the fields that belongs only one Select, how can I make this?

L
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52325 Posts

Posted - 07/04/2013 :  12:29:16  Show Profile  Reply with Quote
quote:
Originally posted by Ciupaz

So I have to get an unique resultset from my stored?
And for the fields that belongs only one Select, how can I make this?

L


As suggested either you need to separate procs for each resultset or you need to have procedure with if conditions and returning various resulsets in each case. You need to make sure the resultset has same number of columns in each case.

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

Ciupaz
Posting Yak Master

Italy
232 Posts

Posted - 07/05/2013 :  03:22:04  Show Profile  Reply with Quote
Ok, I'll try in this way. Thanks a lot Visakh.

Luigi
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52325 Posts

Posted - 07/05/2013 :  03:36:47  Show Profile  Reply with Quote
welcome

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 1.36 seconds. Powered By: Snitz Forums 2000