Joined: 27 Feb 2008
Online Status: Offline
Posts: 2
Topic: No data in report on webform Posted: 27 Feb 2008 at 8:15pm
I am new to crystal reports , i am using crytal reports to display data in a asp.net form . on basis of selection from the dropdown i fill a table in database having same structure as of in .Xsd file , then assign the data set to report datasource . report is loading but the data is not coming kindly help
code
int sbu = Convert.ToInt32(ddl1.SelectedItem.Value); report=new CrystalReport1(); string conn1 = " "; SqlConnection conn = new SqlConnection(conn1); conn.Open(); SqlDataAdapter da = new SqlDataAdapter("sp_cis",conn);
DataSet Dataset1 = new DataSet(); DataTable Temp = Dataset1.Tables.Add(); // Dataset1.Tables.Add("CISTemp"); Temp.TableName="CISTemp"; SqlCommand cmd = new SqlCommand("sp_cis",conn); cmd.CommandType= CommandType.StoredProcedure ; cmd.Parameters.Add( new SqlParameter("@hlevelid",sbu)); da.SelectCommand=cmd; da.Fill(Dataset1,"CISTemp"); CrystalDecisions.CrystalReports.Engine.ReportDocument myReportDocument; myReportDocument = new CrystalDecisions.CrystalReports.Engine.ReportDocument(); myReportDocument.Load(Server.MapPath("CrystalReport1.rpt")); myReportDocument.SetDataSource(Dataset1); CrystalReportViewer1.ReportSource = myReportDocument; CrystalReportViewer1.DataBind(); conn.Close();
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