Click here to Skip to main content
15,949,741 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi frnds...

I my project i am using crystal reports.. for that i have to pass parameter programmatically but it is always prompting a message set parameter value in runtime... if i set the parameter value the crystal report is showing and its working fine... Any Suggestion pls..

Here is my piece of code...

C#
string quoteid = Session["Quote ID"].ToString();

ReportDocument doc = new ReportDocument();

ParameterDiscreteValue paramvalue = new ParameterDiscreteValue();

ParameterValues paramvals = new ParameterValues();


doc.Load(Server.MapPath("QuoteCrystalReport.rpt"), CrystalDecisions.Shared.OpenReportMethod.OpenReportByTempCopy);
paramvalue.Value = quoteid;
paramvals.Add(paramvalue);
CrystalReportViewer1.ParameterFieldInfo["@Quote_ID"].CurrentValues.Add(paramvalue);
doc.DataDefinition.ParameterFields[0].ApplyCurrentValues(paramvals);
doc.SetDataSource(ds);
// CrystalReportSource1.ReportDocument.SetParameterValue(0, Convert.ToInt32(Request.QueryString["quoteid"]));
doc.SetParameterValue(0, Convert.ToInt32(Request.QueryString["quoteid"]));
//doc.SetParameterValue(1, Request.QueryString["quoteid"]);
CrystalReportViewer1.ReportSource = doc;
CrystalReportViewer1.DataBind();


Thanks in advance...

[edit]Tags, subject - OriginalGriff[/edit]
Posted
Updated 1-Aug-11 21:08pm
v3

Today I'm not well, so I don't want to check your code but I'll give you links

Here you go

C# Crystal Reports String parameter[^]
C# Crystal Reports Integer parameter[^]
C# Crystal Reports Date parameter[^]
 
Share this answer
 
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900