Pass 3 Parameters to crystal report from form TextBoxes

I have a form with 3 TextBoxes unbound.  The user will enter all of the data in those 3 boxes.  When a button is clicked I would like to pass those three into parameters that I have already set-up in my crystal report and then print the report without preview.  How can this be done??
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Mohed SharfiVice CEOCommented:
Hi H-SC,
How are you
please try this code
 Dim rpt As New rpt_Name
                rpt.SetParameterValue("Computer_Name", My.Computer.Name)
                rpt.SetParameterValue("User_Name", User_Full_Name)
                Dim objViewer As New Reports_Viewer
                With objViewer
                    .CrystalReportViewer.ReportSource = rpt
                End With
            Catch ex As Exception
                Me.Cursor = Cursors.Default
            End Try

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Éric MoreauSenior .Net ConsultantCommented:
Éric MoreauSenior .Net ConsultantCommented:
and to be able to print without the preview screen, you can call the PrintToPrinter method of the ReportDocument object.
Why Diversity in Tech Matter

Kesha Williams, certified professional and software developer, explores the imbalance of diversity in the world of technology -- especially when it comes to hiring women. She showcases ways she's making a difference ithrough the Colors of STEM program.

H-SCAuthor Commented:

The parameters work great
H-SCAuthor Commented:

Many thanks for the suggestions as well.  I have had your site bookmarked for quite some time.  A great site.
H-SCAuthor Commented:
one more thought...

in the PrintToPrinter  can I pass a numeric updown value for the number of copies to print?
Éric MoreauSenior .Net ConsultantCommented:
yes you can
Éric MoreauSenior .Net ConsultantCommented:
I thought I would have received some points for the PrintToPrinter! Too bad.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.