Skip to Content
author's profile photo Former Member
Former Member

Missing Parameter problem when executing a crystal report from .net

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)

...

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    Posted on Aug 13, 2009 at 01:30 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 13, 2009 at 03:31 PM

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

    Thanks again

    Simon

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.