Calling Crystal Report File

1.4k Views Asked by At

can you help me i have problem with vb.net language. I want to call crystal report but can't with the data format in gridview sent via crystalreport. with the following code:

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click


        Dim reports As New bpkb_1

        reports.SetDataSource(ds.Tables(0))
        viewermurabahah.CrystalReportViewer1.ReportSource = reports
        viewermurabahah.ShowDialog()
        
end sub

can you give an example of how the code to call the crystal report file outside of the visual studio vb.net project file?

1

There are 1 best solutions below

1
F0r3v3r-A-N00b On BEST ANSWER

You can call the load method of the ReportDocument

Dim rpt As New CrystalDecisions.CrystalReports.Engine.ReportDocument
rpt.Load(<Path to your crystal report file>)
rpt.SetDataSource(<your data table>)
YouReportViewer.ReportSource = rpt