Avatar of Terry Rogers
Terry Rogers
Flag 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?
Visual Basic.NETCrystal Reports.NET Programming

Avatar of undefined
Last Comment
Mike McCracken

8/22/2022 - Mon
Terry Rogers

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
Mike McCracken

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Your help has saved me hundreds of hours of internet surfing.
fblack61