I just upgraded my application from Visual Studio 2005 to Visual Studio 2015 and I use Crystal Reports within my program to run my reports. The problem is when I run the reports from my application in VS2015, it gives me every record in the database. When I run in VS2005, it would give me only the records that matched the specified criteria. It has been working fine for several years in VS2005.
In my code, I do the following:
<code>Reports.crDailyProductionByCsr myRpt =newReports.crDailyProductionByCsr();<br>ConfigureCrystalReports(myRpt);
for(int i =0; i <UsedReportFieldCount; i++) {
myPField[i].ParameterFieldName=ReportField[i];
myDValue[i].Value=ReportFieldValue[i];
myPField[i].CurrentValues.Add(myDValue[i]);
myPFields.Add(myPField[i]);
}
}
privatevoidDisplayReport(ReportDocument myRptDoc)
crvViewer.BackColor=System.Drawing.SystemColors.Control;
crvViewer.ParameterFieldInfo= myPFields;// ParameterField[]
crvViewer.ToolPanelView=CrystalDecisions.Windows.Forms.ToolPanelViewType.None;
crvViewer.ReportSource= myRptDoc; crvViewer.Zoom(90);
}
When I run this in the viewer in Visual Studio 2015, I get the expected results fine. But when I run from my program, it returns all daily production records in the whole database concluding that for some reason the code is not passing the parameter values correctly to the report.