Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Pass 3 Parameters to crystal report from form TextBoxes

Posted on 2009-07-15
8
Medium Priority
?
1,082 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 2000 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
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…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

730 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