0

这是我的代码:

    Dim ds As New DataSet1
    Dim cnn As SqlConnection
    Dim con1 As String = "Data Source=;Initial Catalog=;Integrated Security=True"
    Dim sql As String = "SELECT * FROM POBasket where POBNumber='" + txtorderno.Text + "'"
    cnn = New SqlConnection(con1)
    cnn.Open()
    Dim dscmd As New SqlDataAdapter(sql, cnn)
    Dim dscrystal As New DataSet1
    dscmd.Fill(dscrystal, "POBasket")
    cnn.Close()

    Dim report As CrystalReport1 = New CrystalReport1
    report.SetDataSource(dscrystal.Tables("POBasket"))
    report.SetParameterValue("ProductName", "+")
    poreport.pocrystalviewer.ReportSource = report
    poreport.pocrystalviewer.Refresh()
    poreport.Show()

我总是得到错误:

报告没有表格

请帮我!

4

1 回答 1

0

使用下面的代码:

report.database.table[0].setdatasource(dscrystal.Tables("POBasket"))

代替

report.SetDataSource(dscrystal.Tables("POBasket"))

它为我工作。

我想它会对你有所帮助。

于 2015-02-06T07:27:48.673 回答