Click here to Skip to main content
15,891,248 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
i created a data set manually and created a datatable pricelist. The reportviewr is in a usercontrol ucReport, which is loaded inside a panel at run tyime

i have created the report i want to bound its data to by doing this
Dim oRpt As New ucReport

VB
Dim ds As DataSet = GetDataset("prices")
     Dim rds As ReportDataSource = New ReportDataSource("ReportDataSet", ds.Tables(0))
                With oRpt.rvMain.LocalReport
                    .ReportPath = "Reports\pricelist.rdlc"
                    .DataSources.Clear()
                    .DataSources.Add(rds)
                    .Refresh()
                End With



ths getdata source looks like

VB
Private Function GetDataset(ByVal sName As String) As DataSet

        Dim conn As New SQLiteConnection("Data Source=" & dbPath)
        conn.Open()
        Dim sql As String = Nothing
        Select Case sName.ToLower
            Case "prices"
                sql = "Select * FROM prices_view"
        End Select

        Dim ad As SQLiteDataAdapter = New SQLiteDataAdapter(sql, conn)
        Dim ds As DataSet = New DataSet
        ad.Fill(ds)
        Return ds
   End Function


When i run the report, i don't get anything in the report viewer
Posted

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900