Printing problems

D

Dreamtime

Hi

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...

Try
'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 =
PrintDialog1.PrinterSettings.PrinterName

_template.PrintToPrinter(PrintDialog1.PrinterSettings.Copies,
PrintDialog1.PrinterSettings.Collate,
Me.PrintDialog1.PrinterSettings.FromPage,
Me.PrintDialog1.PrinterSettings.ToPage)
End If
Catch ex As Exception
'Display error message
MessageBox.Show(ex.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.
 
K

Kevin Yu [MSFT]

Hi,

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.

http://support.businessobjects.com

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top