急关于C#水晶报表的有关问题

急,关于C#水晶报表的问题
如何将水晶报表的SetDataSource()绑定自定义的DataTable,我的DataTable不来自任何数据库数据,是在程序运行当中根据用户输入生成的,请高手指教

急急急~

------解决方案--------------------
DataSet myDataSet= new DataSet();
DataTable table = new System.Data.DataTable();
table.TableName = "Mytable";
table.Columns.Add(new System.Data.DataColumn("field1"));
table.Columns.Add(new System.Data.DataColumn("field2"));
...//添加数据

myDataSet.tables.add(table);

_ReportDoc.Load(this.m_strRptFileName,CrystalDecisions.Shared.OpenReportMethod.OpenReportByTempCopy);
_ReportDoc.SetDataSource(myDataSet);

注意:你的报表做的时候用推模式,而且名称(表名,字段名)要与你新建的table一样
------解决方案--------------------
捕获输入,生成DataTable就是了
------解决方案--------------------
ReportDocument reportDemo = new ReportDocument();
reportDemo.Load(Server.MapPath("報表名稱.rpt"););

DataTable dt = ......... \\根據輸入的值取得報表的數據源 DataTable
reportDemo.SetDataSource(dt);

CrystalReportViewer1.ReportSource = reportDemo;
this.CrystalReportViewer1.DataBind();

樓主可以自己先建一個XSD,里面包含你要用的所有的欄位名稱,
在設計報表的時候,只要把對應的欄位名稱拉倒 .rpt 設計頁面,這樣CrystalReport就會自動
幫你呈現數據