Skip to Content
author's profile photo Former Member
Former Member

Parameter values not Staying set

Hello All,

I have a report with 17 parameter fields. They are named "Title0", "Title1", "Title2"... "Title16".

In my code, I have a loop which sets the values from a list of values. I can set the value of my first parameter, but as soon as I set the value of the second parameter, the value of the first parameter is cleared out.

Has anyone seen this before? Is there a workaround?

Here is some sample code

string []  paramValues =SetParameterValues(); // sets the values to be used. Gets 17 strings
ReportDocument myReport = new ReportDocument();
myReport.Load(<my report path>);
for (int i = 0; i < 17; i++)
{
   string paramName = "Title" + i.ToString();
    myReport.SetParameterValue(paramName, paramValues<i>);
}

Stepping though this code in the debugger, the first time through the loop works as expected. But on the second time through the loop (i=1) the value for myReport parameter [0] is cleared out.

How should I be setting these values?

Thanks,

-tomas

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.