cancel
Showing results for 
Search instead for 
Did you mean: 

Missing Parameter problem when executing a crystal report from .net

Former Member
0 Kudos

I have a report that I'm calling from a .NET windows application using the CrystalDecisions.Windows.Forms.CrystalReportViewer class. The report takes several parameters but I'm not passing any through from .NET (I'm leaving crystal to prompt for the parameters manually before producing the report).

For some reason (and not all of the time) after the parameter selection page comes up from crystal and ALL of the parameters are entered in manually then click 'OK' I get a message 'Missing Parameter' followed by another message 'Object reference not found'. The report still appears to bring up the data but when I export the data I get an exception error of the type CrystalDecisions.CrystalReports.Engine.ParameterFieldCurrentValueException (more detail below)

The code I'm using the execute the crystal report is as follows

CrystalDecisions.Windows.Forms.CrystalReportViewer m_CrystalReportViewerOne;

m_CrystalReportViewerOne.ReportSource = ReportToLoad; (a CrystalDecisions.CrystalReports.Engine.ReportDocument object)

m_CrystalReportViewerOne.ShowFirstPage();

The report itself is very straightforward, just 2 tables used (no views or procedures and no sub-reports).

The version of Crystal is XI and .NET 1.1.

Has anybody else come across this problem before and if so is there a way to fix it? Please help!

Thank you

Error Message :

CrystalDecisions.CrystalReports.Engine.ParameterFieldCurrentValueException, CrystalDecisions.Shared, Version=11.0.3300.0, Culture=neutral, PublicKeyToken=692fbea5521e1304

Message : Missing parameter values.

Source : CrystalDecisions.ReportAppServer.DataSetConversion

Help link :

PromptEngineAvailable : False

ErrorID : MissingParameterFieldCurrentValue

TargetSite : Boolean ThrowDotNetException(System.Exception)

Stack Trace : at CrystalDecisions.ReportAppServer.ConvertDotNetToErom.ThrowDotNetException(Exception e)

at CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext)

at CrystalDecisions.CrystalReports.Engine.FormatEngine.ExportToStream(ExportRequestContext reqContext)

at CrystalDecisions.CrystalReports.Engine.ReportDocument.y(ExportOptions R)

...

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

First place to start is with the most recent update for CR XI. The latest update is here:

https://smpdl.sap-ag.de/~sapidp/012002523100006008952008E/crXIwin_sp4.zip

Next, try it without the line:

m_CrystalReportViewerOne.ShowFirstPage();

It should not be neccessary.

Make sure you are using .close and .dispose once you are done with the report.

If none of the above helps;

are you using sessions / postbacks, etc?

what version of .NET are you using?

confirm that this is happening on your development computer?

Ludek

Edited by: Ludek Uher on Aug 13, 2009 6:30 AM

Answers (1)

Answers (1)

Former Member
0 Kudos

Thanks very much for the help. It was the ShowFirstPage() that caused the trouble. Using Show() avoided the problem.

Thanks again

Simon