I am getting the following error when I produce a report which contains a sub report, and the sub report relies on filtering using a parameter: - The expression contains object 'parExpenseFormId' that is not defined in the current context. It doesnt seem to recognise that I have already added the parameter although I have.
This worked absolutely fine in an older version of Telerik Reporting but I have now had to upgrade to version 4.1.10.71 (Q2 2010) I am getting the error. I cannot use Q3 because it has another bug which prevents me from using it.
Can someone please help me - I am generating my SubReport in the following manner:
1. Main Report
SubReport
oSubRep = new SubReport();
Report oEntriesRep = ExpenseEntriesReportBuilder.GetReport(); // Create the sub report (see extract below)
oSubRep.Width =
new Unit(735, UnitType.Pixel);
oEntriesRep.DataSource = dsData.Tables[1];
oSubRep.ReportSource = oEntriesRep;
oSubRep.Parameters.Add(
"parExpenseFormId","Fields.[expense_form_id]");
oDetails.Items.Add(oSubRep); // Add the subreport to the details section of the report
2. This is how I generate the actual sub Report
ExpenseEntriesReportBuilder. GetReport()
{
Report oRep = new Report();
oRep.PageSettings = GetPageSettings();
oRep.Items.Add(GetHeaderSection());
oRep.Items.Add(GetDetailSection());
oRep.Items.Add(GetFooterSection());
oRep.Filters.Add(
new Filter("=Fields.[expense_form_id]", FilterOperator.Equal, "=Parameters.parExpenseFormId"));
return oRep;
}
Thanks in advance