1.绑定的方法 ks myReport = new ks;
myReport.SetDataSource(ds_pttpt.tables(0));
CViewer_gj.ReportSource=myReport;
CViewer_gj.RefreshReport()2.须注意,xsd数据集中的数据表 和 dataset.tables(0)中的数据表 完全相同才可
myReport.SetDataSource(ds_pttpt.tables(0));
CViewer_gj.ReportSource=myReport;
CViewer_gj.RefreshReport()2.须注意,xsd数据集中的数据表 和 dataset.tables(0)中的数据表 完全相同才可
解决方案 »
- CKeditor+CkFinder有没有漏洞,如何防止?
- .NET如何掉用highcharts
- 用TransmitFile、UrlPathEncode下载,火狐里,文件名,乱码
- gridview 绑定部分替换
- 通过Ajax方法返回的DataSet在js中没有数据,是什么原因啊
- asp.net 执行创建proc的问题,关键字报错!!
- asp.net 如何选择页面传值(编写查询页面)
- 求助:UDP
- 怎么不执行这个事件?
- ListBox的问题:如何判断是多选?多选的情况下我要把选择的内容绑定到DataGrid中去,如何用代码实现?
- 哪位能给我一个URL重写的实际例子(URLRewriting)
- 日期选择的弹出窗口,只需要年月!!!
这段代码可行吗?我的vs没法这样应用报表啊?
Dim sRptFile As String
Dim oRpt As New ReportDocument ' create a reportDocument object first 'oRpt.Refresh() ' clear the old info
getAuthorData()
sRptFile = Server.MapPath("Report.rpt") ' assign the rpt file name , if in different directory , you must specify the absoluted URL
oRpt.Load(sRptFile)
oRpt.SetDataSource(getAuthorData) CRViewer.ReportSource = oRpt
'CrystalReportViewer1.DisplayGroupTree = False End Sub Private Function getAuthorData() As DataSet
Dim oDS As New DataSet
Dim oConn As New SqlConnection
oConn.ConnectionString = "server=你的SERVER;database=pubs;user=sa;pwd=sa"
oConn.Open() Dim oCmd As New SqlCommand
oCmd.CommandText = "select au_id,au_lname,au_fname,phone,address from authors"
oCmd.CommandType = CommandType.Text
oCmd.Connection = oConn Dim oAdapter As New SqlDataAdapter(oCmd) oAdapter.Fill(oDS) oCmd.Dispose()
oAdapter.Dispose()
oConn.Close()
oConn.Dispose()
oDS.Tables(0).TableName = "authors_tbl" ' Note' the table name must the same as the table name you specify in the xsd file Return oDS End Function
请问楼主在xsd数据集的表element1是否与 dataset.tables(0)中的数据表 完全相同??
若相同的话,在设计报表的页面的时候,有没将此xsd数据集设为报表数据源?