Avatar of EYoung
EYoungFlag for United States of America asked on

How pass parameters in VB.net 2008 using the CrystalReportViewer?

I am new to VB.net 2008 (Windows forms) but have done a lot of applications in VB6.  I am writing a new vb.net 2008 application and I want to call a Crystal Reports 2008 (Vendor_Master.rpt) that I have included in my application.  In VB6, the way I passed parameters was as follows:

Dim Report As dsrVendor_Master
Set Report = New dsrVendor_Master
Report.EnableParameterPrompting = False
Report.ParameterFields(1).AddCurrentValue mReport_Sort_Order_Parm
Report.ParameterFields(2).AddCurrentValue mReport_Dollars_Parm

Now in VB.net 2008 I don't know how to pass parameters to a Crystal Report using the CrystalReportViewer.  Below is the code I currently am trying in the application but it errors out:

Public Class crvVendor_Master
    Private Sub crvVendor_Master_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Activated
        CrystalReportViewer1.ParameterFieldInfo(1).Add(mReport_Sort_Order_Parm)
        CrystalReportViewer1.ParameterFieldInfo(2).Add(mReport_Dollars_Parm)
        CrystalReportViewer1.ShowLogo = False
        CrystalReportViewer1.Zoom(80)
    End Sub
End Class


Thank you for any help.
Visual Basic.NET

Avatar of undefined
Last Comment
EYoung

8/22/2022 - Mon
Bob Learned

What kind of errors are you getting?
ASKER
EYoung

Just a variety.  Can someone provide a simple example of passing a couple of parms from the CRV in VB.net 2008 to a CR 2008 report?  Thanks
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.
See how we're fighting big data
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
ASKER
EYoung

Excellent.  That worked perfectly.  Thank you again.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
ASKER
EYoung

mlmcc,

I have started a new question that I would appreciate your help with.  Here is the link:
https://www.experts-exchange.com/Programming/Languages/.NET/Visual_Basic.NET/Q_24080419.html

Regards,
EYoung