Wednesday, February 18, 2009

Passing Parameter to a Subreport

A few days ago I was revising my application and made some modifications. One of the modifications were that now all of my subreports required an additional parameter, which was not required for the main report. The SetParameterValue(parameterName, parameterValue) method did not work, because it only works with main report object and can't be used with subreports. So, this is what I did to make it work:

1. I included additional parameters in the main report and then linked them to their corresponding counterparts in my subreports.

2. After that was done, I only had to pass their values to the main report using the SetParameterValue(parameterName, parameterValue) method.

Everything worked after I did that, which was a big relief for me, considering my deadlines :)