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


How to display results from two different data sources in one tablix report?


How to display results from two different data sources in one tablix report?

Author
Message
flbotts
flbotts
Grasshopper
Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)

Group: General Forum Members
Points: 17 Visits: 52
I'm trying to display results from a query against a DB2 datasource as well as a query from a sql data source in the same table (report). Is this even possible? I'm trying to compare data to see if there are errors from the sql data source which inserts data into the DB2 accounting database.
geoff5
geoff5
Say Hey Kid
Say Hey Kid (666 reputation)Say Hey Kid (666 reputation)Say Hey Kid (666 reputation)Say Hey Kid (666 reputation)Say Hey Kid (666 reputation)Say Hey Kid (666 reputation)Say Hey Kid (666 reputation)Say Hey Kid (666 reputation)

Group: General Forum Members
Points: 666 Visits: 543
Any given tablix can only be associated with one dataset at a time, but there are two ways to accomplish your goal that I can think of.

First, you could create two identical tables side-by-side that are designed to pull related data from each dataset together in the same order. When you run the report, if the data are synchronous between the two tables, you can visually confirm that there are no errors. If they appear out of sync, there is a problem to investigate.

Second, you can use the LookupSet function to pull related data from a secondary dataset into the context of a tablix associated with a the dataset. By using a Split function and by concatenating a vbCRLF as a delimiter for the string created by the Split function, you can create a set of "rows" that can mimic a table within a table.
flbotts
flbotts
Grasshopper
Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)

Group: General Forum Members
Points: 17 Visits: 52
Thanks!

I'll investigate the lookup function. I was pretty sure that only 1 dataset per tablix was allowed.
flbotts
flbotts
Grasshopper
Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)

Group: General Forum Members
Points: 17 Visits: 52
Can the secondary dataset be from a completely separate Data Source? My first dataset comes from a SQL Server Data source while my second dataset comes from a DB2 Data Source.
geoff5
geoff5
Say Hey Kid
Say Hey Kid (666 reputation)Say Hey Kid (666 reputation)Say Hey Kid (666 reputation)Say Hey Kid (666 reputation)Say Hey Kid (666 reputation)Say Hey Kid (666 reputation)Say Hey Kid (666 reputation)Say Hey Kid (666 reputation)

Group: General Forum Members
Points: 666 Visits: 543
I don't know why not, though I have not tested that particular arrangement. But once the data are in datasets, I think the report would see it all the same.
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