mogh.computer
پنج شنبه 19 بهمن 1391, 08:36 صبح
با عرض سلام
وقتی که گزارش میگیرم فقط یک سطر چاپ میکند.مشکل کجاست؟
کدم به صورت زیر است :
SqlConnection con = new SqlConnection();
con.ConnectionString = @"Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirector y|\Database1.mdf;Integrated Security=True;User Instance=True";
string strSql = "SELECT name, grade FROM View1";
SqlDataAdapter da = new SqlDataAdapter(strSql, con);
DataTable dt = new DataTable();
da.Fill(dt);
//-------------------------------------------------------
StiReport sr = new StiReport();
sr.Load(@"C:\Users\Administrator\Desktop\DB\Report.mrt");
StiDataBand band = sr.GetComponents()["DataBand1"] as StiDataBand;
band.DataSourceName = "d";
sr.RegBusinessObject("d", dt);
sr.Dictionary.Synchronize();
sr.Compile();
sr.Show();
وقتی که گزارش میگیرم فقط یک سطر چاپ میکند.مشکل کجاست؟
کدم به صورت زیر است :
SqlConnection con = new SqlConnection();
con.ConnectionString = @"Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirector y|\Database1.mdf;Integrated Security=True;User Instance=True";
string strSql = "SELECT name, grade FROM View1";
SqlDataAdapter da = new SqlDataAdapter(strSql, con);
DataTable dt = new DataTable();
da.Fill(dt);
//-------------------------------------------------------
StiReport sr = new StiReport();
sr.Load(@"C:\Users\Administrator\Desktop\DB\Report.mrt");
StiDataBand band = sr.GetComponents()["DataBand1"] as StiDataBand;
band.DataSourceName = "d";
sr.RegBusinessObject("d", dt);
sr.Dictionary.Synchronize();
sr.Compile();
sr.Show();