Link to home
Start Free TrialLog in
Avatar of Terry Rogers
Terry RogersFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Crustal Reports VB6 to VB.NET

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?
Avatar of Terry Rogers
Terry Rogers
Flag of United Kingdom of Great Britain and Northern Ireland image

ASKER

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

ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial