Solved

Pass 3 Parameters to crystal report from form TextBoxes

Posted on 2009-07-15
8
1,064 Views
Last Modified: 2012-05-07
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??
0
Comment
Question by:H-SC
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
8 Comments
 
LVL 7

Accepted Solution

by:
Mohed Sharfi earned 500 total points
ID: 24859607
Hi H-SC,
How are you
please try this code
thanks
 Dim rpt As New rpt_Name
                rpt.SetDataSource(ds)
                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
                    .Show()
                End With
            Catch ex As Exception
                MsgBox(ex.ToString)
            Finally
                Me.Cursor = Cursors.Default
            End Try

Open in new window

0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 24859703
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 24859732
and to be able to print without the preview screen, you can call the PrintToPrinter method of the ReportDocument object.
0
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 
LVL 1

Author Comment

by:H-SC
ID: 24859897
mSharfi,

The parameters work great
0
 
LVL 1

Author Comment

by:H-SC
ID: 24859912
emoreau,

Many thanks for the suggestions as well.  I have had your site bookmarked for quite some time.  A great site.
0
 
LVL 1

Author Comment

by:H-SC
ID: 24859953
one more thought...

in the PrintToPrinter  can I pass a numeric updown value for the number of copies to print?
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 24860034
yes you can
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 24860316
I thought I would have received some points for the PrintToPrinter! Too bad.
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question