blackWolf
Feb 19th, 2005, 07:09 AM
Hi All,
i have created a Report that is designed on atable from my database, but i want it to display as i fill in the dataset !! and it keeps displaying all data in a table not the one that is displayed in datagrid that i populate from my Dataset
here is the code:
Report1 sReport1 = new Report1();
DataSet xmlDs = new DataSet();
SqlConnection dbConn = new SqlConnection("data source=.;initial catalog=myDB;persist security info=False;user id=sa;password=");
dbConn.Open();
string strSql= "select * from orders where security_id='test;
SqlCommand dbCmd = new SqlCommand(strSql,dbConn);
SqlDataAdapter dbAdpt = new SqlDataAdapter(dbCmd);
dbAdpt.Fill(xmlDs,"Table");
dataGrid1.DataSource = xmlDs;
dataGrid1.SetDataBinding(xmlDs,"Table");
sReport1.SetDataSource(xmlDs);
crystalReportViewer1.ReportSource = sReport1;
dbConn.Close();
On the datagrid its displaying the actual query data but in report its displaying all data not as the query dpecify ??
Any help please ?
i have created a Report that is designed on atable from my database, but i want it to display as i fill in the dataset !! and it keeps displaying all data in a table not the one that is displayed in datagrid that i populate from my Dataset
here is the code:
Report1 sReport1 = new Report1();
DataSet xmlDs = new DataSet();
SqlConnection dbConn = new SqlConnection("data source=.;initial catalog=myDB;persist security info=False;user id=sa;password=");
dbConn.Open();
string strSql= "select * from orders where security_id='test;
SqlCommand dbCmd = new SqlCommand(strSql,dbConn);
SqlDataAdapter dbAdpt = new SqlDataAdapter(dbCmd);
dbAdpt.Fill(xmlDs,"Table");
dataGrid1.DataSource = xmlDs;
dataGrid1.SetDataBinding(xmlDs,"Table");
sReport1.SetDataSource(xmlDs);
crystalReportViewer1.ReportSource = sReport1;
dbConn.Close();
On the datagrid its displaying the actual query data but in report its displaying all data not as the query dpecify ??
Any help please ?