Different output when printing from preview

Stimulsoft Reports.WPF discussion
Post Reply
User avatar
PJoyeux
Posts: 160
Joined: Tue Nov 26, 2013 9:40 am
Location: Germany

Different output when printing from preview

Post 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
Attachments
Liste - Veranstaltungstermine.mrt
(29.12 KiB) Downloaded 233 times
MemoTextWrong.pdf
Scan of the wrong output (see last line). This has beend printed directly.
(56.17 KiB) Downloaded 909 times
MemoTextCorrect.pdf
Scan of the correct output. This has been printed from the preview-form.
(48.63 KiB) Downloaded 368 times
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Different output when printing from preview

Post 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.
User avatar
PJoyeux
Posts: 160
Joined: Tue Nov 26, 2013 9:40 am
Location: Germany

Re: Different output when printing from preview

Post 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? ;)
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Different output when printing from preview

Post 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.
Post Reply