Accessing one Dataset in Another Dataset (SSRS)

女生的网名这么多〃 提交于 2019-12-11 05:01:31

问题


There are 2 Tables on Two Different Servers, I Have Dataset1 pointing to Server1. Similarly I have Dataset2 Pointing to Server2.

Now I want to Use some Values from Dataset1 in Dataset2.

Dataset1:-

Select * from Table1

This has Name,Lessthan,GreaterThan

Dataset2:-

Select * from TableX X inner join Dataset1 on Dataset1.name=TableX.name
Where X.Time>Dataset1.Lessthan and  X.Time>Dataset1.GreaterThan

Have tried doing the same as above but we are not able to Access the contents of Dataset1 in Dataset2

It Throws error As 'Invalid Object :-Dataset1'

Please guide me on this.


回答1:


You're right: a Dataset's query can't access another Dataset: the query is sent to the database server, which knows nothing of your other Dataset which is defined in the report only.

You can make some report parameters (which can be hidden from the user), which use your Dataset 1 to provide their values.

Then you can pass the parameter values to Dataset 2: when you open Dataset 2's properties you will see 'Parameters' on the left. In Dataset 2's query, include things like @paramvalue, and you will be able to supply it with your values from your report parameters.



来源:https://stackoverflow.com/questions/44917858/accessing-one-dataset-in-another-dataset-ssrs

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