I would like to have a report parameter that is optional and have the query react differently based on whether the parameter use used or not.
For example, say I have several "Category" values. I set up a dataset to return the distinct Categories from my data and use that as the values the user can choose for the "cat" report parameter. I want the report user to either specify a category, or keep the parameter null to indicate that all categories should be returned.
My CAML might look something like:
<list title="Products" relativeSiteUrl="/sites/demo" tableName="Products">
<fields>Title, Category, Supplier, UnitPrice</fields>
<query>
<Where>
<Or>
<Eq>
<FieldRef Name="Category" />
<Value Type="Text">@cat!</Value>
</Eq>
<IsNull>@cat!</IsNull>
</Or>
</Where>
</query>
</list>
As you might expect, this does not work. I basically want to make sure I only retrieve the category the users chooses, or retrieve all of the categories if the user wants to see them all (by specifying null for the parameter).
Any suggestions? This seems to be a theme throughout some of my reports.
Thanks,
Kirk
www.threewill.com
www.worktogetherbetter.com