2

I tried to pass parameter to fetch XML for generating report.

It works fine for "Text Equals" field. But does not works for "Contains" .

I tried this but it doest work.

<condition attribute="new_owner_lead" operator="like" value="@ParameterName"  />

also tried this

value='%"+@ParameterName+"%'
value='%@ParameterName%'

but it doesnt work.. Can Any one suggest.

Thanks in advance.

Vishnu
  • 1,029
  • 4
  • 14
  • 24

3 Answers3

1

Go into the properties of the dataset and click on the Parameters "tab". Enter the following for your parameter value: ="%" & Parameters!myParameter.Value & "%"

Then use the standard value for a parameter in the condition value:

Jake1164
  • 12,291
  • 6
  • 47
  • 64
1

Go into the Properties of the Dataset (Make sure you don't go to the Parameters section) (See image below) and click on the Parameters "tab". Enter the following for your Parameter value:

="%" & Parameters!myParameter.Value & "%"

where myParameter is your variable, so yours will be different here.

Then use the standard value for a parameter in the condition value:

<filter type="and">
   <condition attribute="XXXXXXXXXX" operator="like" value="@myParameter" />
</filter>

enter image description here

ojhurst
  • 402
  • 1
  • 6
  • 9
1

Here is what the condition should be:

<condition attribute="new_owner_lead" value="%TEST%" operator="like"/>

In you case you can use something like:

var fetchXml = 
    $"<filter type='and'>
        <condition attribute='new_owner_lead' value='%{ParameterName}%' operator='like'/>
   </filter>";