Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing Crystal Reports

Status
Not open for further replies.

SqueakinSweep

Programmer
Jun 20, 2002
945
GB
Ok...heres the scanario. I have a crystal viewer form, and all my reports are loaded, dataset applied etc and preview displayed.

There are 2 ways to print the report.
1) viewer.printreport (shows print dialog box)
2) report.PrintToPrinter(1, True, 0, 0) (goes direct to printer)

Now..here is my dilemna. There is a known bug with option 1, in that calling this method, ignores various page formatting you may have already done with the report object, even so far as defaulting the paper type back to Letter format regardless. So I thought Id stick to option 2, but I would also like to be able to use a print dialog option also to allow my users to select the printer to print to. I cant use the standard Printdialog, as it wants to be told what the Printdocument is and not the Crystal report.

Im sure Im missing something so obvious, but would appreciate anyone letting me in on how best to utilise a Printdialog when printing a CR?

Regards
Sweep




Sweep
...if it works dont mess with it
 
Hey Sweep, I would say use the standard print dialog, make a new print document, show the print dialog, then take to printer settings off of the print document and use printtopages.

-Rick

----------------------
[banghead]If you're about to post an ASP.Net question,
please don't do it in the VB.Net forum[banghead]

[monkey] I believe in killer coding ninja monkeys.[monkey]
 
Rick

Thats the direction that I'm heading in. The only drawback with this is that I cant see a way to pass in the selected range of pages, so that the print dialog knows for example there is 6 pages on the Crystal report.

To my mind there should either be a CrystalPrintDialog, or they should sort out the horrendous bug with viewer.printreport.

Regards
Swp

Sweep
...if it works dont mess with it
 
[rant]

And while I've got my "moaning like an old woman head on", why do reports vary so wildly on printer to printer. Its driving me nuts. I know its all to do with the printable area available to the printers, but Im seriously going to have to look at building in adjustable margins based upon the selected printer. Its an absolute nightmare where you have to hit preprinted stationary and every man and his dog is determined to have "his own printer".

[/rant]
Takes several deep breaths.....


Sweep
...if it works dont mess with it
 
To my mind there should either be a CrystalPrintDialog, or they should sort out the horrendous bug with viewer.printreport.

Maybe they will, but it would have to be a new version. I mean look at CR's track record. 9 versions and the still don't have a properly functioning Copy/Paste system! It's was a $500 upgrade to get all the bug fixes from 8 to 8.5. Something like a correctly opperating print dialog will be available in version 13 in another 2 years, and functionally, the only difference from version 12 will be the print dialog bug and a new splash screen.

And with the print to pages method, you can specify 1, 99999 and it'll work fine. As long as the first number is within the page range, you should be fine.

-Rick

----------------------
[banghead]If you're about to post an ASP.Net question,
please don't do it in the VB.Net forum[banghead]

[monkey] I believe in killer coding ninja monkeys.[monkey]
 
Rick

I should rename the thread to "Have a Pop at Crystal Reports". I upgraded to CR10, and thankfully or mercifully it had a verify database command which works 90% of the time. In V9.0 that alone drove me insane, and I pity anyone who tries to get along with the dung filled bundle that ships with .Net

Im going to go along the Print Dialog route. I understand what you mean about pages 1 to 99999, what I cant see is thta if my report has say 10 pages, I cant pass in the number of pages that exist to my print dialog. I'll put up with that for the sake of the the benefits of the PrinttoPrinter command.



Sweep
...if it works dont mess with it
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top