Hi there
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.
So I'm not sure what I'm missing
So here's what I got:
<Query>
<Method Namespace="http://schemas.microsoft.com/sharepoint/soap/" Name="GetListItems" >
<Parameters>
<Parameter Name="listName">
<DefaultValue>My Custom List</DefaultValue>
</Parameter>
<Parameter Name="rowLimit">
<DefaultValue>9999</DefaultValue>
</Parameter>
<Parameter Name="viewName">
<DefaultValue>98F79535-0F17-4895-9FC8-0C011F85D0E0</DefaultValue>
</Parameter>
<Parameter Name="query" Type="xml">
<DefaultValue>
<Query>
<Where>
<And>
<Geq>
<FieldRef Name=ItemDate" />
<Value Type="DateTime">=Parameters!Start_Date.Value</Value>
</Geq>
<Leq>
<FieldRef Name="ItemDate" />
<Value Type="DateTime">=Parameters!End_Date.Value</Value>
</Leq>
</And>
</Where>
</Query>
</DefaultValue>
</Parameter>
</Parameters>
</Method>
<ElementPath IgnoreNamespaces="True">GetListItemsResponse/GetListItemsResult/listitems/data/row{
@ows_Title,
@ows_CompanyName,
@ows_ItemDate,
@ows_ContactName,
@ows_Company_x0020_Street_x0020_Address,
@ows_Company_x0020_City,
@ows_StateOrProvince,
@ows_PostalCode,
@ows_CompanyCountry,
@ows_PhoneNumber,
@ows_FaxNumber
}</ElementPath>
<SoapAction>http://schemas.microsoft.com/sharepoint/soap/GetListItems</SoapAction>
</Query>
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 behaviour? OR or AND? How can you change it?
THANKS GUYS!
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.
So I'm not sure what I'm missing
So here's what I got:
<Query>
<Method Namespace="http://schemas.microsoft.com/sharepoint/soap/" Name="GetListItems" >
<Parameters>
<Parameter Name="listName">
<DefaultValue>My Custom List</DefaultValue>
</Parameter>
<Parameter Name="rowLimit">
<DefaultValue>9999</DefaultValue>
</Parameter>
<Parameter Name="viewName">
<DefaultValue>98F79535-0F17-4895-9FC8-0C011F85D0E0</DefaultValue>
</Parameter>
<Parameter Name="query" Type="xml">
<DefaultValue>
<Query>
<Where>
<And>
<Geq>
<FieldRef Name=ItemDate" />
<Value Type="DateTime">=Parameters!Start_Date.Value</Value>
</Geq>
<Leq>
<FieldRef Name="ItemDate" />
<Value Type="DateTime">=Parameters!End_Date.Value</Value>
</Leq>
</And>
</Where>
</Query>
</DefaultValue>
</Parameter>
</Parameters>
</Method>
<ElementPath IgnoreNamespaces="True">GetListItemsResponse/GetListItemsResult/listitems/data/row{
@ows_Title,
@ows_CompanyName,
@ows_ItemDate,
@ows_ContactName,
@ows_Company_x0020_Street_x0020_Address,
@ows_Company_x0020_City,
@ows_StateOrProvince,
@ows_PostalCode,
@ows_CompanyCountry,
@ows_PhoneNumber,
@ows_FaxNumber
}</ElementPath>
<SoapAction>http://schemas.microsoft.com/sharepoint/soap/GetListItems</SoapAction>
</Query>
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 behaviour? OR or AND? How can you change it?
THANKS GUYS!