简体   繁体   中英

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 .

If i hardcode any value eg <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

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!

  1. 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.

  2. Then another queryOption parameter is created under Dataset Properties>>Parameters .

  3. Set value of queryOptions (Step 2) to [queryOptions] (Step 1).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM