Crustal Reports VB6 to VB.NET

Terry Rogers
Terry Rogers used Ask the Experts™
on
I am converting a vb6 app that uses crystal reports into a vb.net app.

I have completed most of the coding with the exception of a small bit that relates to customising the report before showing it in the report window.

Code is...

    Set Application = New CRAXDRT.Application
    vConStr = "DRIVER={MySQL ODBC 3.51 Driver};SERVER=" & vServer & ";DATABASE=" & vDatabase & ";USER=" & vUsername & ";PASSWORD=" & vPassword & ";OPTION=3;"
    Set Report = Application.OpenReport(App.Path & "\" & vReport & ".rpt")
    Report.Database.Tables(1).ConnectionProperties("Connection String") = vConStr
    Report.ParameterFields(1).AddCurrentValue (vQuery)
    Report.EnableParameterPrompting = False
    ReportViewer.ReportSource = Report
    ReportViewer.ViewReport
    Do While ReportViewer.IsBusy = True
        DoEvents
    Loop

Open in new window


What would be the alternative for above in VB.NET code?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Terry RogersIT Technical Architect

Author

Commented:
Oops, forgot to include the declaration in the code snippet...

Dim Application         As CRAXDRT.Application
Dim Report              As CRAXDRT.Report

    Set Application = New CRAXDRT.Application
    vConStr = "DRIVER={MySQL ODBC 3.51 Driver};SERVER=" & vServer & ";DATABASE=" & vDatabase & ";USER=" & vUsername & ";PASSWORD=" & vPassword & ";OPTION=3;"
    Set Report = Application.OpenReport(App.Path & "\" & vReport & ".rpt")
    Report.Database.Tables(1).ConnectionProperties("Connection String") = vConStr
    Report.ParameterFields(1).AddCurrentValue (vQuery)
    Report.EnableParameterPrompting = False
    ReportViewer.ReportSource = Report
    ReportViewer.ViewReport
    Do While ReportViewer.IsBusy = True
        DoEvents
    Loop

Open in new window

Senior Consultant
Most Valuable Expert 2011
Top Expert 2013
Commented:
What version of Crystal?
To the best of my knowledge, the CRAXDRT metod is not licensed for use in .Net applications

Check this white paper
Migrating Applications from the RDC to the .NET assemblies
http://www.sdn.sap.com/irj/boc/go/portal/prtroot/docs/library/uuid/e0eb394f-931e-2b10-3b82-9413bfc3f457?QuickLink=index&overridelayout=true&29669634095258

mlmcc

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial