Вопрос

I have a requirement to include a null value in multi valued parameter. I'm using fetchXML code in my dataset. Please help me with it.

In my report I have 2 datasets in which first one is main dataset having parameter @P1. For @P1 I have assigned Dataset2 as "Availible values" and "Default values".

Now, when I run the report I should get a dropdown with list of all values in dataset2.

So, here in that dropdown I was asked to add a null value also. Is it possible?

Note:Parameter will accept multiple values from user.

Это было полезно?

Решение

You can add a CRM filter parameter to your report, by adding a blank-value report parameter to your SSRS report.

The XML for the parameter would be like the following, considering you are working for example with the Account entity:

<ReportParameter Name="FilteredAccount">
   <DataType>String</DataType>
   <Nullable>true</Nullable>
   <DefaultValue>
      <Values>
         <Value></Value>
      </Values>
   </DefaultValue>
   <AllowBlank>true</AllowBlank>
   <Prompt>FilteredAccount</Prompt>
   <Hidden>true</Hidden>
</ReportParameter>

After you add this parameter, you will upload the report to CRM, and CRM will automatically create the parameter for you as SQL query (Value) and will load CRM filters. Any specific required filters could be saved to the report in CRM.

And note that this report parameter should be passed from SSRS to the stored procedure, which fetches the report filtered results.

You could also find details about CRM 2011 report pre-filtering parameter in this blog post http://carlwillis.blogspot.com/2012/01/pre-filtering-in-crm-2011-ssrs-reports.html

Другие советы

Let's say you want to add a null option for selection to a list of codes from a query. All you need to do is add that to your result set by unioning it:

SELECT NULL AS Id, '<Null option>' AS Description
UNION ALL
SELECT Id, Description
FROM CodeTable
ORDER BY 1
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top