Skip to Content
Former Member
Sep 10, 2008 at 09:51 PM

Crystal Reports .NET 2005 Subreport linked with parameters and command cols


Sorry if this has been asked before, but I cannot find the answer after looking for over an hour.

I have a Crystal XI report that I am using in .NET 2005 that links on a paramter (same parameter name in the main and sub report), AND links on 2 command object columns.

The links looks like this:


I'm trying to pass the parameters to the main report via code in ASP.NET (C#) like so:

private void SetCurrentValuesForParameterField(ReportDocument rptDoc, string szParameter, ArrayList valuesARY)


ParameterValues currParamValues = new ParameterValues();

foreach (object singleValue in valuesARY)


ParameterDiscreteValue paramDiscVal = new ParameterDiscreteValue();

paramDiscVal.Value = singleValue.ToString();



ParameterFieldDefinitions paramFldDefs = rptDoc.DataDefinition.ParameterFields;

ParameterFieldDefinition singleParamFldDef = paramFldDefs[szParameter];



This works for other reports that do NOT have sub reports. However, thsi si the first sub report we are trying to set up and cannot get it to work properly.

Error it throws is this one:


Why does this fail? Is there a workaround or fix?