Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Workaround - LookupFunction in 2008


Workaround - LookupFunction in 2008

Author
Message
davdam8
davdam8
SSC-Enthusiastic
SSC-Enthusiastic (180 reputation)SSC-Enthusiastic (180 reputation)SSC-Enthusiastic (180 reputation)SSC-Enthusiastic (180 reputation)SSC-Enthusiastic (180 reputation)SSC-Enthusiastic (180 reputation)SSC-Enthusiastic (180 reputation)SSC-Enthusiastic (180 reputation)

Group: General Forum Members
Points: 180 Visits: 668
Hi geniuses!

I have to edit some reports in SSRS 2008 and figure that I'm going to need to use data from different datasets.
I previously worked with SSRS 2008 R2 and used the Lookup function wich doesn't exist in 2008.
I could use subreport but it would be a real pain in ***, and would interfere with the performance of the report.
Do you any way of merging/joining different datasets using expressions in 2008 (non R2)

Thanks in advance!
Regards to all!
sql_reporting
sql_reporting
SSC Rookie
SSC Rookie (25 reputation)SSC Rookie (25 reputation)SSC Rookie (25 reputation)SSC Rookie (25 reputation)SSC Rookie (25 reputation)SSC Rookie (25 reputation)SSC Rookie (25 reputation)SSC Rookie (25 reputation)

Group: General Forum Members
Points: 25 Visits: 169
i think its better to do it in query... so that u can have all the data in one data set.. may be you can use union if I am not wrong
davoscollective
davoscollective
SSChasing Mays
SSChasing Mays (601 reputation)SSChasing Mays (601 reputation)SSChasing Mays (601 reputation)SSChasing Mays (601 reputation)SSChasing Mays (601 reputation)SSChasing Mays (601 reputation)SSChasing Mays (601 reputation)SSChasing Mays (601 reputation)

Group: General Forum Members
Points: 601 Visits: 1000
The way I usually do this is to create a linked server object on the SQL server database, and then in the query you can do something like this

select a.column, b.column2 
FROM
[server1].[db].[schema].[table] a join [server2].[db].[schema].[table2] b on
a.common = b.common



Or you can make use of the Openquery() or Openrowset() functions.

It's a shame that reporting services doesn't have good objects to do joins and won't let you use multiple datasets in the same tablix, but then again the linked server option already exists and it's always going to be faster to do any joins with the database engine rather than bringing all the data into reporting services and doing it that. That tends to be a general rule with reporting services - do as much as you can in SQL or MDX and just use expressions for formatting or presentation tasks.

A second option that I occasionally use is to refer to cells in other tablixes directly.
For example if you have 2 tablixes that each connect to different data sets (from different databases), in tablix 2 you can refer to cells from tablix 1.

i.e. if you have a cell in tablix 1 that you have named "textbox1" then in tablix 2 you could use this expression:

=ReportItems!textbox1.value


davdam8
davdam8
SSC-Enthusiastic
SSC-Enthusiastic (180 reputation)SSC-Enthusiastic (180 reputation)SSC-Enthusiastic (180 reputation)SSC-Enthusiastic (180 reputation)SSC-Enthusiastic (180 reputation)SSC-Enthusiastic (180 reputation)SSC-Enthusiastic (180 reputation)SSC-Enthusiastic (180 reputation)

Group: General Forum Members
Points: 180 Visits: 668
Very usefull, Thanks!

Regards
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