SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


use 2 datasets on detail line of SSRS 2008 r2


use 2 datasets on detail line of SSRS 2008 r2

Author
Message
brent.singleton
brent.singleton
Forum Newbie
Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)

Group: General Forum Members
Points: 4 Visits: 28
To the best of my knowledge it is not possible to conditionally select the dataset that you'd like to use for a single tablix.

Another solution (to avoid the expression based text boxes) would be to duplicate the summary line and then conditionally show/hide the tablix (so that only one shows, dependent on the parameter that is selected).

The expression for the visibility of the tablix could be something along the lines of

Conditional Statement for Tablix1 (which you want to show if Parameter1 is selected):
=IIF(IsNothing(@Parameter1), false, true)




Conditional Statement for Tablix2 (which you want to show if Parameter2 is selected):
=IIF(IsNothing(@Parameter2), false, true)


Mark Fitzgerald-331224
Mark Fitzgerald-331224
Hall of Fame
Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)

Group: General Forum Members
Points: 3881 Visits: 1538
Assuming that the datasets are the same but come from different tables then you can combine the two queries into a single dataset.

Change the dataset query to be like the demo below:

Declare @sql varchar(2000)
Set @sql = case
when @param =1
then 'select a,b,c from dbo.table1'
else
then 'select a,b,c from dbo.table2'
End
Exec(@sql)

As long as the two result sets return the same column names and types this will work.

Fitz
Jason Selburg
Jason Selburg
Hall of Fame
Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)

Group: General Forum Members
Points: 3679 Visits: 4110
Personally, I'd move the decision logic to the procedure. have it accept both parameters as nullable, then handle your logic there.

The Report then only needs one dataset.

______________________________________________________________________

Personal Motto: Why push the envelope when you can just open it?

If you follow the direction given HERE you'll likely increase the number and quality of responses you get to your question.

Jason L. Selburg
Mark Fitzgerald-331224
Mark Fitzgerald-331224
Hall of Fame
Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)

Group: General Forum Members
Points: 3881 Visits: 1538
Jason Selburg (10/10/2013)
Personally, I'd move the decision logic to the procedure. have it accept both parameters as nullable, then handle your logic there.

The Report then only needs one dataset.


No problem with that idea, just hated the idea of returning two complete datasets then choosing which to show as the number of rows in the tablix would be dictated by the tablix linked dataset.

Fitz
Jason Selburg
Jason Selburg
Hall of Fame
Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)

Group: General Forum Members
Points: 3679 Visits: 4110
Mark Fitzgerald-331224 (10/10/2013)
Jason Selburg (10/10/2013)
Personally, I'd move the decision logic to the procedure. have it accept both parameters as nullable, then handle your logic there.

The Report then only needs one dataset.


No problem with that idea, just hated the idea of returning two complete datasets then choosing which to show as the number of rows in the tablix would be dictated by the tablix linked dataset.

Fitz


NO! Don't return two diff. result sets. Use the proc to determine which set to return. ** this assumes they have the same columns of course.

______________________________________________________________________

Personal Motto: Why push the envelope when you can just open it?

If you follow the direction given HERE you'll likely increase the number and quality of responses you get to your question.

Jason L. Selburg
Mark Fitzgerald-331224
Mark Fitzgerald-331224
Hall of Fame
Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)

Group: General Forum Members
Points: 3881 Visits: 1538
Jason Selburg (10/10/2013)
Mark Fitzgerald-331224 (10/10/2013)
Jason Selburg (10/10/2013)
Personally, I'd move the decision logic to the procedure. have it accept both parameters as nullable, then handle your logic there.

The Report then only needs one dataset.


No problem with that idea, just hated the idea of returning two complete datasets then choosing which to show as the number of rows in the tablix would be dictated by the tablix linked dataset.

Fitz


NO! Don't return two diff. result sets. Use the proc to determine which set to return. ** this assumes they have the same columns of course.


Sorry I was agreeing with you.

Fitz
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search