on ‎2022 Apr 12 9:23 PM
I have a report that uses the Generic/Text Only printer driver with the Device Font 12cpi. When it's printed (to a file) from the Crystal Reports designer the layout is correct. When I print from the runtime (latest SP, using the RAS engine) there are some alignment issues.
Any suggestions on what to look at, or known issues to be aware of?
The report is very complicated with a lot of subreports, and the alignment issues are happening in subreports. The report is from a customer and I've so far been unsuccessful in reproducing the problem in a simpler report or isolating anything different about the fields that have the problem. They all seem to be aligned and sized correctly.
Request clarification before answering.
Likely is when in CR Designer it uses GDI.dll to render the page.
CR .NET uses GDIPlus so there can be slight differences which is why I also suggest when creating the report don't use no printer.
Margins can play a big part when the formatting engine lays out the objects.
It's also know that Microsoft has issues with their print drivers.
Try a different printer like an HP or something more up to date and see if that helps.
Curious why they are printing to a file first and not directly to the printer?
Don
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the suggestions. The main thing as far as I'm concerned is that the report does render correctly to the file when printed from Crystal Reports itself, so I'm trying to understand why the runtime is producing a different result if they're both using the same print engine.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bill,
Actually P2P and POC still uses the Windows DEVMODE structure to format the report based on the C++ DEVMODE structure for that printer driver. All of our printer calls get down to the core engine crpe32.dll.
We do use the TT fonts and the Glyphs embedded within the font so that may be the issue.
As for the old app it's hard to say what they were/are using and why it works without knowing what SDK it used.
All I can suggest is they use Times New Roman, it's a fixed size font so it may reduce the offsets they are seeing.
The other option that might work is to add a new printer and set the output to a file, it's be a PRN file type, use a real printer rather than the generic Windows Printer. Not sure if that would help though.
Another option is export to xml or CSV and use it as the printer source.
Can't really suggest anything else since they are comparing .NET printing to what is likely a very old platform and lots of changes obviously.
How did they configure the Generic Text printer?
Don
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, Don.
I'm using PrintOutputController.PrintReport.
The "Generic / Text Only" printer is a Windows generic driver that sends the output to a text file (with some control codes) to be sent to a printer that's not connected to Windows. The driver only supports fixed-width device fonts (not TrueType or OpenType). My understanding is that PrintOutputController bypasses .NET so the device fonts should still work.
My customer is currently running this report using a much older program that uses an old CR runtime (before .NET, I think) and the output is formatted correctly when it's printed from that.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bill,
Are you using PrintToPrinter (P2P) or PrintOutputController to set/print the report?
When you say text only printer do you mean a Dot Matrix printer?
Don
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 9 | |
| 7 | |
| 6 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.