cancel
Showing results for 
Search instead for 
Did you mean: 

Parameter values not Staying set

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

Have a look at the sample app csharp_win_paramengine.zip here:

http://wiki.sdn.sap.com/wiki/display/BOBJ/CrystalReportsfor.NETSDK+Samples

There are also a few other parameter apps at the above link that may be helpful

Ludek

Follow us on Twitter http://twitter.com/SAPCRNetSup

Got Enhancement ideas? Try the [SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports]

saurabh_pathak
Active Contributor
0 Kudos

Adding to Ludek's response, you can also check the [Developer's Guide|http://help.sap.com/businessobject/product_guides/boexir31/en/crsdk_net_dg_12_en.chm] and [API Reference|http://help.sap.com/businessobject/product_guides/boexir31/en/crsdk_net_apiRef_12_en.chm]

- Saurabh

Answers (0)