Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » RichText,QTF,RTF... » Weird problems with Report / PDF Export / Printing, sometimes even crashes
Re: Weird problems with Report / PDF Export / Printing, sometimes even crashes [message #39030 is a reply to message #39000] Fri, 08 February 2013 01:06 Go to previous messageGo to previous message
frozen is currently offline  frozen
Messages: 13
Registered: January 2013
Promising Member
Update:

Is it possible, that Report is rather to be used very carefully? Maybe even buggy?

Today I spent some hours playing around with the report.
I couldn't fix it but I found some confusing things.

Removing everything manipulating the output (so it is just Report r; r << preisliste; Perform(r); ) leads to no more crashes! The page that is printed has exactly the correct size - but now we have TWO pages! And magically there is some rather big margin added all around the pages.
But the exported PDF now is too small. 185mm x 274mm. It also gets some margins, but these are smaller than the ones from the "print". This PDF also has two pages.

Just putting r.Margins(100,100); back into the code changes things a lot.
It still doesn't crash on printing. The resulting print still has two pages and the correct size. It has very small margins to the left and top. On the right and bottom the margins are huge though. As if the margins from the previous try were combined on the right and bottom.
The exported PDF is exactly the same as it was when Margins() wasn't used.

Using r.Margins(200,200) doesn't change the exported PDF. It is exactly the same again.
On the printed document the margins are larger now, the content seems to be shifted around by them.

Using no r.Margins() but reinserting r.SetPageSize(s); leads to a printed document that has one page, the correct size and absolutely no margins.
The exported PDF also has just one page but it added margins all around the document. It seems these margins are added to the size I have set which results in a page size that is too big.

Combining r.Margins(200,200) and r.SetPageSize(s) just adds the left and top margins to the printed document, leaving none to the right and bottom - and thus moving some content outside of the page.
The exported PDF again doesn't change compared to the one with just size set.

As a last test I readded the ChoosePrinter() without setting margins or size - boom, printing leads to the crash.
The exported PDF now is again too small and has two pages with some margins.

This is pretty confusing...

I expect
  • the printed document to look the same as the exported PDF. In no situation this was achieved.
  • r.Margins() to set a margin all around the page, but at least to the left and top (as it is documented) without changing the right and bottom one.
  • r.ChoosePrinter() or r.ChooseDefaultPrinter() not to lead to a crash.


Should my expectations be wrong but the code right, could someone please tell me how I can build this functionality? Maybe I need to "build it by hand" by drawing all the texts using Draw or DrawingDraw and/or PDFDraw and a PrinterJob and a TopWindow or maybe a Ctrl to do a preview (please say I don't have to do this.. Very Happy )?

Thanks again,

frozen
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Is there a way to set page width in the QTF Designer / Topic++ editor / UWord ?
Next Topic: [Minor bug report & patch] RichTextView should use native ibeam icon.
Goto Forum:
  


Current Time: Mon May 06 07:49:08 CEST 2024

Total time taken to generate the page: 0.03604 seconds