0

我正在使用以下代码动态创建报告:

Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click

        Dim mycon As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" & _
                    "Data Source=" + My.Application.Info.DirectoryPath + "\mswd-rms.mdb")
        Dim mycomm As New OleDbCommand("SELECT * FROM tbl_day_care", mycon)
        Dim da As New OleDbDataAdapter()
        da.SelectCommand = mycomm
        Dim ds As New DataSet()
        da.Fill(ds, "tbl_day_care")

        Dim rpt As New CrystalReport1() 'The report you created. 

        rpt.SetDataSource(ds)
        frmViewReport.CrystalReportViewer1.ReportSource = rpt
        frmViewReport.Show()
    End Sub

但是当报告加载时,报告是空白的。我从中获取记录的表不是空的。

4

1 回答 1

2

只需按照以下步骤操作,希望对您有所帮助:)

链接:http: //vb.net-informations.com/crystal-report/vb.net_crystal_report_step_by_step.htm

于 2013-01-28T03:39:40.200 回答