如何在水晶报表中显示两个表?

时间:2014-01-21 01:15:16

标签: vb.net crystal-reports sap

我坚持在水晶报告中显示两个表格的字段。我正在尝试手动编码,但这段代码不起作用。我觉得它只能显示一个表格。

这是我的代码:

''''''''''''''''connection to database''''''''''''''''''''''''''''''''''
connectionsrvr = New MySqlConnection("server=localhost;userid=root;password=;database=ticketing_system;")

    connectionsrvr.Open()

    If connectionsrvr.State = ConnectionState.Closed Then
        MsgBox("Cannot connect to server")
    End If
''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim ds As New DataSet
        Dim sql As String

        sql = "SELECT complaint.*,errordesc.* FROM complaint,errordesc WHERE status='finished'"
        Dim dscmd As New MySqlDataAdapter(sql, connectionsrvr)
        dscmd.Fill(ds, "complaint")


        connectionsrvr.Close()

        Dim objret As New CrystalReport1
        objret.SetDataSource(ds.Tables(0))

        CrystalReportViewer1.ReportSource = objret
        CrystalReportViewer1.Refresh()

0 个答案:

没有答案