Crystal Reports Error: "Missing parameter field current value."

D

drisso

Hello,

I have searched that error on these message boards, msdn and
crystaldecisions.com. I found tutorials that showed how to export a
crystal report to pdf, but like many others I am getting an error when
I actually do the oRpt.Export() command. The error is "Missing
parameter field current value." I looked this error up on
crystaldecisions.com and they had a patch which I downloaded, installed
and rebooted the machine, but still same error. I set the parameters
and report in the Page Load method. I set the export options in the
Button event. I have a print button that will sets all the export
options and calls export, etc. I even tried adding a value right
before oRpt.Export() is called. I wrote this line before oRpt.Export()

this.oRpt.ParameterName.CurrentValues.Add(discretevalue);

discrete value has a value with string "None" so I know there is a
value there, but it still errors out. Please can someone tell me why
this always comes up and a way around it? Since you can't print with
crystal report 9 directly in web forms I need to use this.

Thanks,

David
 
G

Guest

Hi David,

Try following code to assign parameter to CR report:

ParameterDiscreteValue discretevalue = new ParameterDiscreteValue();
discretevalue.Value = objValue; // Assign parameter
ParameterValues values = new ParameterValues();
values.Add(discretevalue);
crReport.DataDefinition.ParameterFields(i).ApplyCurrentValues(values);

HTH

Elton Wang
(e-mail address removed)
 
D

drisso

Thanks,

I used that code in the button event handler right before oRpt.Export()
was called and it worked. I believe the function
ApplyCurrentValues(values) is what makes the difference.


Thanks again,

David
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,154
Members
46,701
Latest member
XavierQ83

Latest Threads

Top