[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

PrintReport dialogbox with Crystal report in visual basic 2008

Posted on 2009-02-23
9
Medium Priority
?
446 Views
Last Modified: 2013-11-26
I'm using Visual basic 2008 and  I would like to know if there Is there a way to not have the Print Dialog pop up when I use printreport to send to printer
Private Sub frmRapport_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
 
        Me.CrystalReport31.SetParameterValue(0, My.Settings.NoContrat.ToString)
        If not PrintDocument1.PrinterSettings.IsValid = False Then
            Me.CrystalReportViewer1.PrintReport()
            Me.Close()
        End If
    End Sub

Open in new window

0
Comment
Question by:sylvainhotte
  • 4
  • 2
  • 2
  • +1
9 Comments
 
LVL 101

Expert Comment

by:mlmcc
ID: 23724246
I believe there is a flag.

Try

Me.CrystalReportViewer1.PrintReport(true)

It may be that false is the value

mlmcc
0
 

Author Comment

by:sylvainhotte
ID: 23724627
Well I tried but it does not take a boolean value or a number value.

Thank but it's not the answer!
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 23726488
I don't know.  The method I used had a flag to show or not show the printer options

mlmcc
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:sylvainhotte
ID: 23726659
Thanks anyway.

I tried different way dut as soon as I add False. False become underlined in bleu.

So it does not seem to accept the false

Thanks

Sylvain
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 23727373
I believe that you cannot override the PrintReport method to not display the dialog.  I would use the ReportDocument.PrintToPrinter method instead of the CrystalReportViewer.PrintReport method.
0
 

Author Comment

by:sylvainhotte
ID: 23727474
Hi, thank this seems like a good idea. Except that I may be missing some reference can you help me

When i write
ReportDoucument.

The choice that show are EnabledEventLog
Equals
ReferenceEquals

But not PrintToPrinter

Am I doing something wrong?


Thanks a lot
sylvain
0
 

Author Comment

by:sylvainhotte
ID: 23727696
Well Ok I got It.

Thanks
Wow I was slow on this.
sylvain
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 900 total points
ID: 23728548
All Crystal Reports class instances inherit from ReportClass/ReportDocument, and so if you have a report instance, then it should have the PrintToPrinter method.
0
 
LVL 83

Assisted Solution

by:CodeCruiser
CodeCruiser earned 600 total points
ID: 23731693
Use this function
PrintToPrinter

More Info
http://www.vbforums.com/archive/index.php/t-242041.html
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying 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

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Loops Section Overview
Suggested Courses
Course of the Month17 days, 16 hours left to enroll

830 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