datagird中显示报表中不显
chpst 2007-03-29 11:25:32 private void BindIOProductData(int nStoreInOutID)
{
///定义获取数据的类
MisStock.Components.IOProduct product = new MisStock.Components.IOProduct();
SqlDataReader recp = product.GetProductByStoreInOut(nStoreInOutID);
///创建DataSet数据源
DataTable dataTable = SystemTools.ConvertDataReaderToDataTable(recp);
DataSet dataSet = new DataSet("IOProduct");
dataSet.Tables.Add(dataTable);
///设定控件的数据源
IOProductList.DataSource = dataSet;
///绑定控件的数据
IOProductList.DataBind();
}
绑定到DataGrid上显示没问题。
===============================
private void BindProductData(int nStoreInOutID)
{
MisStock.Components.IOProduct product = new MisStock.Components.IOProduct();
SqlDataReader recp = product.GetProductByStoreInOut(nStoreInOutID);
//创建DataSet数据源
DataTable dataTable = SystemTools.ConvertDataReaderToDataTable(recp);
CrystalReport2 oCR= new CrystalReport2();
DataSet1 ds = new DataSet1();
ds.Tables.Add(dataTable);
oCR.SetDataSource(ds);
oCR.SetDatabaseLogon("sa","","HWB","ASPNETMisDB");
this.CrystalReportViewer1.ReportSource=oCR;
this.CrystalReportViewer1.Zoom(1);
}
=====================================
就不显示是空的用的是模式数据集,那位高手指点一二,谢谢!