Showing results for 
Search instead for 
Did you mean: 

Crystal Reports Not Accepting Parameters From Visual Studio 2015 Program

Former Member
0 Kudos

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>
InitReportParameters();// Initialize the report parameter fields
AssignReportValue(@"CompanyName","Company Name");
AssignReportValue(@"ReportTitle","Daily Production ");
AssignReportValue(@"CSRId",CSRId);// Move the Parameters to the report

// SetReportParameters takes the ReportField values from the program and
// moves them to myPFields for Crystal Reports. I have verified the values
// are correctly filled into ReportField from the AssignReportValue methods
// above.

for(int i =0; i <UsedReportFieldCount; i++) {

privatevoidDisplayReport(ReportDocument myRptDoc)
crvViewer.ParameterFieldInfo= myPFields;// ParameterField[]
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.

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi Allan,

CR no longer installs the runtime for applications. All runtime is available from this WIKI:

Read the info on that page, it does have a lot of info required.

On that page there is a sample app as well on using Parameters.


Answers (0)