Combining the Information from two datasets in SSRS R2 2008

安稳与你 提交于 2019-12-12 04:47:25

问题


I am fairly new to ssrs r2 2008. What I am trying to do is create a funnel chart which displays the combined revenue information from two tables in different databases but on the same server. Doing my own research, I have found that I could use the lookup function, but I am not sure where I would implement this function. I have done research, but I haven't found any documentation which explicitly explains how and where lookup can be implemented.

What I have so far is two datasources which reference each database, and two datasets with each dataset referencing each datasource. Both datasets have the same field names as the tables in the database have the same fields, so I can basically perform the lookup on any field.

Any help would be greatly appreciated. Thanks in advance!


回答1:


You'll need to UNION the rows from each table together. Since you are going across databases, you need to include the database name in the table reference for the table that the dataset's data source isn't connected to:

SELECT Field1, Field2, Field3
FROM MyTable
UNION ALL
SELECT Field1, Field2, Field3
FROM OtherDatabase.dbo.OtherTable

You need to make sure that the account that the report is running under has access to both databases.



来源:https://stackoverflow.com/questions/26360641/combining-the-information-from-two-datasets-in-ssrs-r2-2008

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!