471,897 Members | 2,191 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,897 software developers and data experts.

Printing problems


I am using Visual Studio 2005 and the bundled Crystal Reports
(previously I used .net 2003 and bundled Crystal Reports for 2 years -
same issues!)

I have a report which is displayed in the crystal reports viewer. This
report needs to be printed. Its that simple!

I would like to use the report.printtoprinter method as this is direct
to the printer and hence I can control the showing/supressing of a print
options dialog.

However, this causes problems with quality/resolution which is important
to my application. I am unable to get the report to print with the
selected options in the print dialog.

I would be happy to use the other method of printing which is linked to
the CrystalReportViewer (CrystalReportViewer.PrintReport), but this
automatically pops up a dialog box and this is not always appropriate
(especially when printing 34 separate reports automatically).

So my need is either to be able to set quality/resolution using the
PrintToPrinter method or to suppress the dialog options when using the
PrintReport method!

For example (I am using CutePDF as a test base - I have performed
similar tests on physical printers)...

I open the report in a CrystalReportViewer and call the
crystalreportviewer.printreport using a button. Up pops the print
options. I choose 'properties', set the colour to black and white,
select 'advanced' and change the resolution to 2400. I then print, in
this case, to a PFD file called 'Test A'

Using a second button I invoke the CrystalReport.PrintToPrinter using
code similar to below...

'Specify current page settings
PrintDocument1.DefaultPageSettings = PrintPageSettings
PrintDialog1.Document = PrintDocument1

Dim result As DialogResult = PrintDialog1.ShowDialog()

'If click OK, print document to printer
If result = Windows.Forms.DialogResult.OK Then
_template.PrintOptions.PrinterName =

_template.PrintToPrinter(PrintDialog1.PrinterSetti ngs.Copies,
End If
Catch ex As Exception
'Display error message
End Try

I set black and white and a resolution of 2400 and save as a file called
'Test B'

As you probably guess, Test A is b&w @ 2400, Test B is printer default
(colour, 600dpi). How can I get the PrintToPrinter method to use the
settings made in a Print Options dialog? Is my code missing something.

I would really appreciate any thoughts as my deadline is tight.

Maybe there are better ways to print reliably. My application gets used
on a whole range of printers and printing has always been my biggest
headache. I have never been able to guarantee it will work?!

Thank you.
Feb 28 '06 #1
1 4857

Crystal is a product that is redistributed with VS.NET. However, it is not
supported by Microsoft. For CrystalReport issues, please try the following
link for support.


Kevin Yu
"This posting is provided "AS IS" with no warranties, and confers no

Mar 1 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Programatix | last post: by
reply views Thread by Programatix | last post: by
5 posts views Thread by Mark Preston | last post: by
3 posts views Thread by Grim Reaper | last post: by
1 post views Thread by G.Esmeijer | last post: by
4 posts views Thread by Arif | last post: by
4 posts views Thread by Tracey | last post: by
18 posts views Thread by Brett | last post: by
reply views Thread by YellowAndGreen | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.