I am trying to export a report in pdf that requires two parameter values "paraSessID" and "paraClassID". It worked perfectly on machine before I included connection for the report. But now all I get is the "missing parameter values" on deployment. Below is the code:
// creating object of crystal report ReportDocument crystalReport = new ReportDocument(); crystalReport.Load(Server.MapPath("~/termreport/first.rpt")); // path of report // Once I have the data I need to apply it to the connection of the report ConnectionInfo crConnection = new ConnectionInfo(); crConnection.UserID = ""; crConnection.ServerName = ""; crConnection.DatabaseName = ""; crConnection.Password = ""; AssignConnectionInfo(crystalReport, crConnection); crystalReport.SetDatabaseLogon(crConnection.UserID, crConnection.Password, crConnection.ServerName, crConnection.DatabaseName); crystalReport.SetDataSource(dss.Tables[0].DefaultView); // binding dataset ParameterFields paraField = new ParameterFields(); ParameterField paraSessID = new ParameterField(); ParameterField paraClassID = new ParameterField(); ParameterDiscreteValue paraSessDiscrete; ParameterDiscreteValue paraClassDiscrete; paraSessID.Name = "paraSessID"; paraSessID.CurrentValues.Clear(); paraSessDiscrete = new ParameterDiscreteValue(); paraSessDiscrete.Value = SessID; paraSessID.CurrentValues.Add(paraSessDiscrete); paraField.Add(paraSessID); paraClassID.Name = "paraClassID"; paraClassID.CurrentValues.Clear(); paraClassDiscrete = new ParameterDiscreteValue(); paraClassDiscrete.Value = ClassID; paraClassID.CurrentValues.Add(paraClassDiscrete); paraField.Add(paraClassID); CrystalReportViewer1.ParameterFieldInfo = paraField; //crystalReport.SetParameterValue("paraSessID", SessID); //crystalReport.SetParameterValue("paraClassID", ClassID); CrystalReportViewer1.ReportSource = crystalReport; //CrystalReportViewer1.RefreshReport(); crystalReport.ExportToHttpResponse(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, Response, true, "First Term Report");
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)