Page 1 of 1

Different output when printing from preview

Posted: Tue Feb 04, 2014 4:29 pm
by PJoyeux
Hi,

using your newest version I have the problem, that Text-Fields wich contains Text with many Carriage Returns somehow do not print completely. The strange thing is, that when I print the exact same report with the same data from the preview-window then everything is correct. When I print directly, then the last row is cut... When you align both prints it seems like the line spacing is a little bit higher when printer directly...

I have attached two scans of the printed reports and the report itself.

Any idea?

Cheers,
Pascal

Re: Different output when printing from preview

Posted: Wed Feb 05, 2014 7:34 am
by HighAley
Hello.

Could you specify what code do you use for printing?
It seems that you use WinForms methods for printing with code.
You should use PrintWithWpf() method.

Thank you.

Re: Different output when printing from preview

Posted: Wed Feb 05, 2014 8:42 am
by PJoyeux
Oh man, you are so right...

I used objReport.Print() instead of objReport.PrintWithWpf() because I was "playing around" with PrinterSettings and since PrintToWpf() does not offer an overload with PrinterSettings I had replaced it with Print()... :roll:

Thank you very much for pointing that out! Works now as it should.

Cheers,
Pascal

PS: By the way: How did you see that? Is that because the "DEMO" is horizontal when printed via WPF and oblique when Printer with WinForms? ;)

Re: Different output when printing from preview

Posted: Thu Feb 06, 2014 6:33 am
by HighAley
Hello.

Yes, the difference is in the DEMO watermark :)
The StiPrinterSettings is made for WinForms. In WPF the analog is printTicket.
And there is a PrintWithWpf(object printTicket) overload for WPF.

Thank you.