Topic: Error: Missing parameter values
Oldest Post First
Newest Post First
Author
Message
mixarstudio
Newbie
Joined: 11 May 2009
Online Status: Offline
Posts: 3
Topic: Error: Missing parameter values Posted: 19 May 2009 at 10:32pm
i've got one problem when i sending parameter to cr page the problem is Missing parameter values in the first time, when my report loaded it can show parameters but when i click on export/print/next page error will come i'm already test this my parameter is keeping but my page told Missing here is my code string fDate; string tDate; string viewBy; string fullName; ReportDocument report = new ReportDocument(); ParameterFields pfields = new ParameterFields(); protected void Page_Load(object sender, EventArgs e) { crvBinding(); } private void crvBinding() { fDate = Session["FDATE"].ToString(); tDate = Session["TDATE"].ToString(); viewBy = Session["VIEWBY"].ToString(); string staffID = "0000000001"; //Integrate remove this line Session["staffID"] = staffID; //Integrate remove this line Session["StaffID"] = Session["staffID"]; string strConn = "Data Source=MIXAR-PC;Initial Catalog=StockProductInfo;Integrated Security=True"; SqlConnection Conn = new SqlConnection(strConn); if (Conn.State == ConnectionState.Open) { Conn.Close(); } Conn.ConnectionString = strConn; Conn.Open(); string sqlStaffName = "select Staff_FName, Staff_LName "; sqlStaffName += "from masStaff "; sqlStaffName += "where Staff_ID = " + Session["StaffID"].ToString(); SqlDataAdapter daStaff = new SqlDataAdapter(sqlStaffName, Conn); DataSet dsStaff = new DataSet(); daStaff.Fill(dsStaff, "Staff"); string fName = dsStaff.Tables["Staff"].Rows[0]["Staff_FName"].ToString(); string lName = dsStaff.Tables["Staff"].Rows[0]["Staff_LName"].ToString(); fullName = fName + " " + lName; DateTime fd = DateTime.Parse(fDate); DateTime td = DateTime.Parse(tDate); string FromDate = fd.ToString("yyyy-MM-dd"); string ToDate = td.ToString("yyyy-MM-dd"); ParameterField pfieldFDATE = new ParameterField(); ParameterDiscreteValue disValFDATE = new ParameterDiscreteValue(); disValFDATE.Value = DateTime.Parse(fDate); pfieldFDATE.Name = "FDate"; pfieldFDATE.DefaultValues.Add(disValFDATE); pfieldFDATE.CurrentValues.Add(disValFDATE); ParameterField pfieldTDATE = new ParameterField(); ParameterDiscreteValue disValTDATE = new ParameterDiscreteValue(); disValTDATE.Value = DateTime.Parse(tDate); pfieldTDATE.Name = "TDate"; pfieldTDATE.DefaultValues.Add(disValTDATE); pfieldTDATE.CurrentValues.Add(disValTDATE); ParameterField pfieldSTAFF = new ParameterField(); ParameterDiscreteValue disValSTAFF = new ParameterDiscreteValue(); disValSTAFF.Value = fullName; pfieldSTAFF.Name = "StaffName"; pfieldSTAFF.DefaultValues.Add(disValSTAFF); pfieldSTAFF.CurrentValues.Add(disValSTAFF); pfields.Add(pfieldFDATE); pfields.Add(pfieldTDATE); pfields.Add(pfieldSTAFF); CrystalReportViewer1.ParameterFieldInfo.Clear(); CrystalReportViewer1.ParameterFieldInfo = pfields; report.Load(Server.MapPath("../SalesReport/ShippingSummByProductReport.rpt")); SPShipSummByProductTableAdapter adapter = new SPShipSummByProductTableAdapter(); CrystalReportManager crManager = new CrystalReportManager(report, adapter.GetData(FromDate, ToDate)); //Page.RegisterStartupScript("Alert", "<script>alert('From date: " + FromDate + " ');</script>"); //Page.RegisterStartupScript("Alert", "<script>alert('To date: " + ToDate + " ');</script>"); //Page.RegisterStartupScript("Alert", "<script>alert('Staff: " + fullName + " ');</script>"); CrystalReportViewer1.ReportSource = crManager.Report; CrystalReportViewer1.Visible = true; } protected void CrystalReportViewer1_ViewZoom(object source, CrystalDecisions.Web.ZoomEventArgs e) { crvBinding(); } protected void CrystalReportViewer1_Search(object source, CrystalDecisions.Web.SearchEventArgs e) { crvBinding(); } protected void CrystalReportViewer1_Navigate(object source, CrystalDecisions.Web.NavigateEventArgs e) { crvBinding(); }
IP Logged
Forum Jump
-- Select Forum --
Announcements
Talk with the Author
Self-Publishing
Job Postings
New feature request
Report Design
Data Connectivity
Technical Questions
Tips and Tricks
Crystal Xcelsius
Report Design
Data Connectivity
Writing Code
Tips and Tricks
Report Design
Data Connectivity
Writing Code
Tips and Tricks
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum
This page was generated in 0.047 seconds.