Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11571

Retrieve All records and display in Report using CAML query in Report Builder if Parameter value is blank

$
0
0

 

Hello Experts,

i have created a report where i have one parameter field where user will pass parameter(e.g. EmpId). As per parameter record will fetched to report if no parameter is passed then it will display all records. I have done it by taking SqlServer Database as datasource. by using Following method

Now i would like to do it by taking Sharepoint List as Datasource. For that what would be the CAML Query.

Here is my existing CAML query.

<RSSharePointList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <ListName>Employees</ListName>
  <ViewFields>
    <FieldRef Name="Title" />
    <FieldRef Name="FirstName" />
    <FieldRef Name="LastName" />
    <FieldRef Name="FullName" />
    <FieldRef Name="UserName" />
    <FieldRef Name="Company" />
  </ViewFields>
  <Query>
    <Where>  
<Eq> 
    <FieldRef Name="Title" />
  <Value Type="Text">    
   <Parameter Name="EmployeeId"/>    
</Value>
</Eq>                  
    </Where>
  </Query>
</RSSharePointList>

 

The above code is working if i am passing an employeeId to Parameter. If nothing is passed, it is Not retrieving any record.

Please suggest

Thank you


saroj


saroj


Viewing all articles
Browse latest Browse all 11571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>