问题描述
我想创建一个包含两个数据表的动态数据集,这样我就可以使用水晶报表中的数据集我想从访问数据库中放入值并将值放入数据集中的两个数据表中现在我是能够在水晶报告中使用一个数据集和一个数据表
我尝试过:
Private Sub ChallanReports_Load(发送者作为对象,e作为EventArgs)处理MyBase.Load
如果rpt2 =ChallanBlack那么
Dim objrpt As New ChallanBlack''水晶报告
Dim query As String =select * from Challan where ChallID =& dts2
Dim ad As OleDbDataAdapter = New OleDbDataAdapter(query,conn)
Dim ds As ChallanDataSet = New ChallanDataSet'''数据集
ad。填充(ds,Challan)''数据表
objrpt.SetDataSource(ds)
CrystalReportViewer1.ReportSource = objrpt
ElseIf rpt2 =BGLChallanBlack然后
结束如果
结束次级
结束类
I want to create a dynamic dataset with two data table such that I can use the dataset in the crystal report I want to put the values from access database and put the values into the two data tables in the dataset Right now I am able to use one dataset and one data table in the crystal report
What I have tried:
Private Sub ChallanReports_Load(sender As Object, e As EventArgs) Handles MyBase.Load
If rpt2 = "ChallanBlack" Then
Dim objrpt As New ChallanBlack '' crystal report
Dim query As String = "select * from Challan where ChallID = " & dts2
Dim ad As OleDbDataAdapter = New OleDbDataAdapter(query, conn)
Dim ds As ChallanDataSet = New ChallanDataSet '''dataset
ad.Fill(ds, "Challan") '' datatable
objrpt.SetDataSource(ds)
CrystalReportViewer1.ReportSource = objrpt
ElseIf rpt2 = "BGLChallanBlack" Then
End If
End Sub
End Class
推荐答案
这篇关于如何使用两个数据表创建动态数据集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!