问题
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.
If i hardcode any value e.g <CalendarDate> 08/11/2012 </CalendarDate> instead of <CalendarDate> = Parameters!Date.Value </CalendarDate> the report works fine.
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.
Note: Parameter Date is of type DateTime
回答1:
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>”
回答2:
Ok i got this working!
I created a new Parameters in the Parameters folder as
DateandqueryOptions.So basicallyqueryOptionsis everything that i want to use as a query.Then another
queryOptionparameter is created under Dataset Properties>>Parameters.Set value of
queryOptions(Step 2) to[queryOptions](Step 1).
来源:https://stackoverflow.com/questions/13284845/pass-a-parameter-value-to-a-dataset-parameter-in-ssrs-2008