0

I have done a tonne of work in porting quite a large VB6 project over to .NET but have hit a snag on the crystal reports. I've converted the dsr files to rpt. The next stage is getting it into the code

The VB6 way was to use the following

Dim report As New cryMyReport

Even after importing the rpt files into the project, cryMyReport is not recognised.

What do I need to do to get my .NET app recognise and use the rpt files?

Rudi Visser
  • 21,350
  • 5
  • 71
  • 97
Nodoid
  • 1,449
  • 3
  • 24
  • 42

1 Answers1

0

I often refer people to http://vb.net-informations.com/crystal-report/vb.net_crystal_report_step_by_step.htm

Essentially you need to add the Crystal references (you will need the Crystal reports for visual studio runtimes installed), add a CrystalReportViewer and then use some code along the lines of:

Imports CrystalDecisions.CrystalReports.Engine
Public Class Form1
    Private Sub Button1_Click(ByVal sender As System.Object, 
    ByVal e As System.EventArgs) Handles Button1.Click
        Dim cryRpt As New ReportDocument
        cryRpt.Load("PUT CRYSTAL REPORT PATH HERE\CrystalReport1.rpt")
        CrystalReportViewer1.ReportSource = cryRpt
        CrystalReportViewer1.Refresh()
    End Sub
End Class
Lee Tickett
  • 5,847
  • 8
  • 31
  • 55