473,480 Members | 1,799 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Printing problems

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.PrinterSetti ngs.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.
Feb 28 '06 #1
1 5052
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."

Mar 1 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2259
by: Programatix | last post by:
Hi, I am working on the PrintDocument, PrintDialog, PageSetupDialog and PrintPreviewControl components of Visual Studio .NET 2003. My developement machine is running Windows XP. There are...
0
2102
by: Programatix | last post by:
Hi, I am working on the PrintDocument, PrintDialog, PageSetupDialog and PrintPreviewControl components of Visual Studio .NET 2003. My developement machine is running Windows XP. There are...
5
2191
by: Mark Preston | last post by:
Admission first - I don't actually have a problem here but have noticed that a lot of people have been asking similar questions and getting very varied answers. What I've done is to sort of...
3
4297
by: Grim Reaper | last post by:
I print mailing labels out of Access 2000 databases about 3 to 4 times a week. I have been having problems with one thing since I have been printing mailing labels. I print mailing labels by...
1
2468
by: G.Esmeijer | last post by:
Friends, I'm (a bit) dissapointed about the printing possibilities in c#. It could also be lack of knowedge. I would like to align a text on the right side of the paper when printing. For...
4
9162
by: Arif | last post by:
I C# code prints very slow as compared to a third party barcode printing software. That software prints approximately 10 labels in 2 seconds while my C# code prints 10 labels in 5 to 6 seconds. And...
4
1811
by: Tracey | last post by:
Hey folks, I have an ASP.NET web app that's working just fine, but a small percentage have two printing problems that don't happen to the vast majority of users. These problems are listed below...
8
5866
by: Neo Geshel | last post by:
Greetings. BACKGROUND: My sites are pure XHTML 1.1 with CSS 2.1 for markup. My pages are delivered as application/xhtml+xml for all non-MS web clients, and as text/xml for all MS web...
18
11258
by: Brett | last post by:
I have an ASP.NET page that displays work orders in a GridView. In that GridView is a checkbox column. When the user clicks a "Print" button, I create a report, using the .NET Framework printing...
0
7037
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7034
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7076
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6732
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
6886
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4768
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4472
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2976
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1294
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.