Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Passing report parameters to SharePoint GetListItems in a CAML Query

  Asked By: Bobbi    Date: Aug 25    Category: Sharepoint    Views: 4572

I'm having some serious issues passing report parameters to a CAML query that's behind my reporting connecting to a SharePoint list.
I have defined 2 report parameters (datetime type): Start_Date and End_Date. Now my list contains items with a bunch of Dates (field ItemDate)
I want to return a list of items based on date range (start and end date).

I thought that if I used =Parameters!Start_Date.Value and =Parameters!End_Date.Value would work. Nope it doesn't.
However if I used actual hardcoded dates like 2009-01-01T00:42:34Z for start date and 2010-01-01T00:42:34Z the report works like magic.

I guess I want to know what the SYNTAX is to pass a SSRS parameter into CAML. I tried =Parameteres!ParameterName.Value, [@ParameterName], etc.. NOTHING works! I'm desperate here!

I also tried "Parameters!Start_Date.Value " still no luck...

So I'm not sure what I'm missing... I'm sure it's syntax.

So here's what I got:

<Method Namespace="http://schemas.microsoft.com/sharepoint/soap/" Name="GetListItems" >
<Parameter Name="listName">
<DefaultValue>My Custom List</DefaultValue>
<Parameter Name="rowLimit">
<Parameter Name="viewName">
<Parameter Name="query" Type="xml">
<FieldRef Name=ItemDate" />
<Value Type="DateTime">=Parameters!Start_Date.Value </Value>
<FieldRef Name="ItemDate" />
<Value Type="DateTime">=Parameters!End_Date.Value </Value>

<ElementPath IgnoreNamespaces="True">GetListItemsResponse/GetListItemsResult/listitems/data/row{


The other alternative is to use Report Filters BUT I am not sure how I can "OR" them, I know you can define a bunch of filters, but what is the default behavior? OR or AND? How can you change it?



No Answers Found. Be the First, To Post Answer.