Skip to Content
0

CR printing from VS.NET windows srvce can page orientation default to what was saved in report?

May 02, 2017 at 03:06 PM

25

avatar image

Hi

When printing the crystal report I now have to use this method to get the printer name set for the report:

Report.PrintToPrinter(printerSettings, pSettings, False, PrintLayout)

It would be preferable to have this default to use the page orientation that was saved off in the report.

Is it possible to do that or do I need to set it in these two places every time?

Report.PrintOptions.PaperOrientation = CrystalDecisions.Shared.PaperOrientation.Portrait

pSettings.Landscape = False

If I do need to set it every time do I need to set it in both places, just one of these places or in another setting?

In the past when I was using Crystal Runtime Engine 2008 I was able to use

Report.PrintToPrinter(1, False, 1, 1) and it would print in the orientation that was saved in the report.

Thank you,

Michael Helduser

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Don Williams
May 02, 2017 at 04:38 PM
0

Use PrintOutputController() to do the printing for reports with saved printer names etc.

Updates to these functions altered the way PrintToPrinter(0 works, it will only use the PC's default printer settings now.

You can also change the default printer API in the Viewer to use either P2P or POC as the default. POC uses the same printer UI CR Designer uses.

See KBA 2163438 for an example on using them.

Updating the reports will also save the printer and paper info in the RTP file now as well so be sure to update to the latest patch for your full version of CR 2008 SP 7 or higher Designer.

Don

Show 2 Share
10 |10000 characters needed characters left characters exceeded

Hi Don,

I'm about to submit a case with support this evening to describe all that I have been attempting with report printing from a windows service. If you would, please review that case and let me know if the PrinterOutputController still applies. My reports do not have saved printer names they need to be printed on the fly to a specific printer that is passed into the PrintThread after first obtaining it from a database configuration table. The reports can be directed to any printer in the plant. All of the printers are of the same type and use the same print drivers.

I'll provide you with the case number a little later when I complete my first support request with my s-user-id.

Thank you,
Michael Helduser

0

So why don't you simply update the reports with the printer and use POC to do the printing?

We WILL NOT change the behaviour of P2P so no point in logging a case. But up to you...

Thanks again

Don

0