Trim Funtion in Dataset Stored Procedure Causes SSRS report Fail
<p>I have an <code>SSRS</code> report. It have <code>multi valued parameters</code> &amp; a <code>sub report</code>. It runs fine until I changed the <code>dataset</code> for a <code>parameter</code> ( In both <code>report</code>).  When I previewed the report it shows below error. </p>

<blockquote>
  <p>"one or more parameters were not specified for the subreport located
  at /report".</p>
</blockquote>

<p>I tried below steps to resolve the issue</p>

<pre><code>1. Ensured parameter names are correct.
2. removed rdl.data file
3. Deleted the dataset and recreated it.
</code></pre>

<p>I tried to revoke the changes made in <code>dataset</code> &amp; the report runs <code>perfectly</code>. The only change I have made in the <code>dataset</code> was the addtion of  <code>LTRIM(RTRIM))</code> <code>Function</code> in <code>dataset query</code> to remove the spaces between <code>multi-value parameter.</code></p>

<p>The dataset query was like below</p>

<pre><code>select Loan_no 
From loan_header
where rowatatus = 'A'
</code></pre>

<p>I have changed it into</p>

<pre><code>SELECT LTRIM(RTRIM(Loan_no)) As Loan_no
From loan_header
where rowatatus = 'A'
</code></pre>

<p>When I removed <code>LTRIM(RTRIM)</code> <code>Function</code> from the <code>Dataset</code> query, the report works fine. So, use of <code>LTRIM(RTRIM) Function</code> causes the <code>Report</code> failure.
What will be reason behind this? Anyone facing similar issue before?. Please help.</p>