[英]Pass a parameter value to a Dataset Parameter in SSRS 2008
I have a dataset with a parameter as which is passed to a query as shown below. 我有一个带有参数的数据集,该参数被传递给查询,如下所示。
The issue here is DataSet parameter queryOptions
does not accept the value from the Report Parameter Date
. 这里的问题是DataSet参数
queryOptions
不接受“报表参数Date
的值。
If i hardcode any value eg <CalendarDate> 08/11/2012 </CalendarDate>
instead of <CalendarDate> = Parameters!Date.Value </CalendarDate>
the report works fine. 如果我对任何值进行硬编码,例如
<CalendarDate> 08/11/2012 </CalendarDate>
而不是<CalendarDate> = Parameters!Date.Value </CalendarDate>
则报告工作正常。
What wrong am i doing while passing parameter. 传递参数时我在做什么错。
I even created another Dataset Parameter named Date
and assigned Parameter Value [@Date]
even that did not work. 我什至创建了另一个名为
Date
数据集参数,并[@Date]
分配了参数值[@Date]
即使该方法无效。
Note : Parameter Date
is of type DateTime
注意 :参数
Date
的类型为DateTime
You can try the dynamic expression under your parameter value. 您可以在参数值下尝试动态表达式。 Something like following expression:
类似于以下表达式:
=”<QueryOptions><CalendarDate> = “&Parameters!Date.Value.Tostring(“MM/dd/yyyy”) &”</CalendarDate></QueryOptions>”
Ok i got this working! 好的,我已经开始工作了!
I created a new Parameters in the Parameters folder as Date
and queryOptions
.So basically queryOptions
is everything that i want to use as a query. 我在Parameters文件夹中创建了一个名为
Date
和queryOptions
的新Parameters。因此,基本上queryOptions
是我要用作查询的所有内容。
Then another queryOption
parameter is created under Dataset Properties>>Parameters . 然后在Dataset Properties >> Parameters下创建另一个
queryOption
参数。
Set value of queryOptions
(Step 2) to [queryOptions]
(Step 1). 将
queryOptions
(步骤2)的值设置为[queryOptions]
(步骤1)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.