|
|
Home » U++ Library support » RichText,QTF,RTF... » Weird problems with Report / PDF Export / Printing, sometimes even crashes
Weird problems with Report / PDF Export / Printing, sometimes even crashes [message #39000] |
Tue, 05 February 2013 21:15 |
frozen
Messages: 13 Registered: January 2013
|
Promising Member |
|
|
Hello guys!
I hit another problem. Ultimate++ is awesome, but as a newbie I guess I need some time to find out how everything works, especially in case of a problem. Now I hit another such problem and hope for help.
If this is the wrong section of the forum or I missed to add some important information, please tell me!
Sorry for the huuuge width of this post - I included my code as is.
I am running version 5739 on a Debian system (compiler is gcc), using the nightly package from the repository. The application I develop is intended to run on Linux and Windows.
This system doesn't have a physical printer, instead CUPS is configured to use a PDF printer (Debian package cups-pdf).
The latest thing I tried was to add a menu item that shows a QTF-Document - ready to be printed.
This is the callback for this menu entry:
Quote: |
void MyApp::preisliste()
{
Report r;
Size s;
r.ChooseDefaultPrinter("Preisliste");
s = Size(6000 * 210 / 254, 6000 * 297 / 254);
r.SetPageSize(s);
r.Margins(100, 100);
String preisliste;
preisliste << "[ [ [*2 Preisliste]&][2 &][ [2 Alle Preise sind Preise pro Anwesenheitstag.]&][2 &][ {{1935:1612:1612:1612:1612:1617h1; [= [2 Bezeichnung]]:: [= [2 Stufe 0]]:: [= [2 Stufe I]]:: [= [2 Stufe II]]:: [= [2 Stufe III]]:: [= [2 Stufe III Härtefall]]:: [ [2 Tagespflege]]:: [> [2 `_`_Preis0`_`_€]]:: [> [2 `_`_Preis1`_`_€]]:: [> [2 `_`_Preis2`_`_€]]:: [> [2 `_`_Preis3`_`_€]]:: [> [2 `_`_Preis4`_`_€]]:: [ [2 Altenpflegeumlage ][`2 `*]]:: [> [2 `_`_APU0`_`_€]]:: [> [2 `_`_APU1`_`_€]]:: [> [2 `_`_APU2`_`_€]]:: [> [2 `_`_APU3`_`_€]]:: [> [2 `_`_APU4`_`_€]]:: [ [2 Investitionskosten ][`2 `*`*]]:: [> [2 `_`_IKP0`_`_€]]:: [> [2 `_`_IKP1`_`_€]]:: [> [2 `_`_IKP2`_`_€]]:: [> [2 `_`_IKP3`_`_€]]:: [> [2 `_`_IKP4`_`_€]]:: [ [2 Unterkunft]]:: [> [2 `_`_U0`_`_€]]:: [> [2 `_`_U1`_`_€]]:: [> [2 `_`_U2`_`_€]]:: [> [2 `_`_U3`_`_€]]:: [> [2 `_`_U4`_`_€]]:: [ [2 Verpflegung]]:: [> [2 `_`_V0`_`_€]]:: [> [2 `_`_V1`_`_€]]:: [> [2 `_`_V2`_`_€]]:: [> [2 `_`_V3`_`_€]]:: [> [2 `_`_V4`_`_€]]:: [ [2 Unterkunft `+ Verpflegung]]:: [> [2 `_`_UV0`_`_€]]:: [> [2 `_`_UV1`_`_€]]:: [> [2 `_`_UV2`_`_€]]:: [> [2 `_`_UV3`_`_€]]:: [> [2 `_`_UV4`_`_€]]}}&][>2 &][# [`2 `*][2 Die Altenpflegeumlage ist im Preis für die Tagespflege enthalten.]&][# [`2 `*`*][2 Die Investitionskosten werden von der örtlichen Kommune übernommen.]&][#2 &][# [*2 Leistungen der Pflegekasse (normal)]&][#2 &][# [2 Ambulante Pflege hat Vorrang vor Tagespflege. Die Leistungen der Pflegekasse sind jeweils pro Monat zu verstehen.]&][#2 &][ {{1935:1612:1612:1612:1612:1617h1; [= [2 Bezeichnung]]:: [= [2 Stufe 0]]:: [= [2 Stufe I]]:: [= [2 Stufe II]]:: [= [2 Stufe III]]:: [= [2 Stufe III Härtefall]]:: [# [2 Pflegesachleistung (100 Prozent)]]:: [> [2 `_`_SachLeistung100St0`_`_€]]:: [> [2 `_`_SachLeistung100St1`_`_€]]:: [> [2 `_`_SachLeistung100St2`_`_€]]:: [> [2 `_`_SachLeistung100St3`_`_€]]:: [> [2 `_`_SachLeistung100St4`_`_€]]:: [# [2 Pflegesachleistung (50 Prozent)]]:: [> [2 `_`_SachLeistung50St0`_`_€]]:: [> [2 `_`_SachLeistung50St1`_`_€]]:: [> [2 `_`_SachLeistung50St2`_`_€]]:: [> [2 `_`_SachLeistung50St3`_`_€]]:: [> [2 `_`_SachLeistung50St4`_`_€]]:: [# [2 Pflegesachleistung (150 Prozent)]]:: [> [2 `_`_SachLeistung150St0`_`_€]]:: [> [2 `_`_SachLeistung150St1`_`_€]]:: [> [2 `_`_SachLeistung150St2`_`_€]]:: [> [2 `_`_SachLeistung150St3`_`_€]]:: [> [2 `_`_SachLeistung150St4`_`_€]]:: [# [2 Pflegegeld]]:: [> [2 `_`_PG0`_`_€]]:: [> [2 `_`_PG1`_`_€]]:: [> [2 `_`_PG2`_`_€]]:: [> [2 `_`_PG3`_`_€]]:: [> [2 `_`_PG4`_`_€]]}}&][#2 &][# [*2 Leistungen der Pflegekasse (bei eingeschränkter Alterskompetenz)]&][#2 &][# [2 Ambulante Pflege hat Vorrang vor Tagespflege. Die Leistungen der Pflegekasse sind jeweils pro Monat zu verstehen.]&][#2 &][ {{1935:1612:1612:1612:1612:1617h1; [= [2 Bezeichnung]]:: [= [2 Stufe 0]]:: [= [2 Stufe I]]:: [= [2 Stufe II]]:: [= [2 Stufe III]]:: [= [2 Stufe III Härtefall]]:: [# [2 Pflegesachleistung (100 Prozent)]]:: [> [2 `_`_SachLeistungeA100St0`_`_€]]:: [> [2 `_`_SachLeistungeA100St1`_`_€]]:: [> [2 `_`_SachLeistungeA100St2`_`_€]]:: [> [2 `_`_SachLeistungeA100St3`_`_€]]:: [> [2 `_`_SachLeistungeA100St4`_`_€]]:: [# [2 Pflegesachleistung (50 Prozent)]]:: [> [2 `_`_SachLeistungeA50St0`_`_€]]:: [> [2 `_`_SachLeistungeA50St1`_`_€]]:: [> [2 `_`_SachLeistungeA50St2`_`_€]]:: [> [2 `_`_SachLeistungeA50St3`_`_€]]:: [> [2 `_`_SachLeistungeA50St4`_`_€]]:: [# [2 Pflegesachleistung (150 Prozent)]]:: [> [2 `_`_SachLeistungeA150St0`_`_€]]:: [> [2 `_`_SachLeistungeA150St1`_`_€]]:: [> [2 `_`_SachLeistungeA150St2`_`_€]]:: [> [2 `_`_SachLeistungeA150St3`_`_€]]:: [> [2 `_`_SachLeistungeA150St4`_`_€]]:: [# [2 zusätzliche Betreuungsleistung]]:: [> [2 `_`_PK45`_`_€]]:: [> [2 `_`_PK45`_`_€]]:: [> [2 `_`_PK45`_`_€]]:: [> [2 `_`_PK45`_`_€]]:: [> [2 `_`_PK45`_`_€]]:: [# [2 zusätzliche Betreuungsleistung (erhöht)]]:: [> [2 `_`_PK45`+`_`_€]]:: [> [2 `_`_PK45`+`_`_€]]:: [> [2 `_`_PK45`+`_`_€]]:: [> [2 `_`_PK45`+`_`_€]]:: [> [2 `_`_PK45`+`_`_€]]:: [# [2 Pflegegeld]]:: [> [2 `_`_PGeA0`_`_€]]:: [> [2 `_`_PGeA1`_`_€]]:: [> [2 `_`_PGeA2`_`_€]]:: [> [2 `_`_PGeA3`_`_€]]:: [> [2 `_`_PGeA4`_`_€]]}}&][#2 &][# [2 Die zusätzlichen Betreuungsleistungen können zur Abrechnung von allen Leistungen der Tagespflege genutzt werden, inklusive Fahrtkosten.]&][# &][> [*1 alle Angaben ohne Gewähr]]]";
// here we have lots of Replaces, I included just one example..
preisliste.Replace("`_`_PK45`+`_`_", Format("%2,!nl", 200.0));
r << preisliste;
Perform(r);
}
|
It compiles without error.
When I click the menu entry the list shows in the print preview with all the replaces done.
The problems are:
- When I click PDF-Export I can save a PDF-File. This looks okay. But the page is too big, 227x314 mm instead of 210x297 mm.
- When I click Print it seems to print - but the resulting PDF is empty, 2.3 Kb in size but the empty page has the correct dimensions.
- I changed the code to show the Printer selection dialog by replacing ChooseDefaultPrinter with ChoosePrinter. When I select the printer manually this way and click Print the program crashes immediately, showing "Fatal error" with the message
"Assertion failed in /home/frozen/upp/uppsrc/Core/Vcont.h, line 33
i >= 0 && i < items"
It creates the same empty PDF than before though.
The QTF was created with the QTF designer.
Could the problem be cups-pdf? It prints well using other programs, but it is not a physical printer..
How do I fix the dimensions of the PDF created by the PDF-Export?
I am stuck on both problems.
Kind regards,
frozen
(Update: changed code section to a quote section so that this page renders normally and is no longer that wide..)
[Updated on: Fri, 08 February 2013 01:08] Report message to a moderator
|
|
|
|
|
Weird problems with Report / PDF Export / Printing, sometimes even crashes
By: frozen on Tue, 05 February 2013 21:15
|
|
|
Re: Weird problems with Report / PDF Export / Printing, sometimes even crashes
By: deep on Wed, 06 February 2013 14:53
|
|
|
Re: Weird problems with Report / PDF Export / Printing, sometimes even crashes
By: frozen on Wed, 06 February 2013 18:37
|
|
|
Re: Weird problems with Report / PDF Export / Printing, sometimes even crashes
By: frozen on Fri, 08 February 2013 01:06
|
|
|
Re: Weird problems with Report / PDF Export / Printing, sometimes even crashes
By: mirek on Mon, 11 February 2013 19:58
|
|
|
Re: Weird problems with Report / PDF Export / Printing, sometimes even crashes
By: frozen on Mon, 11 February 2013 21:17
|
|
|
Re: Weird problems with Report / PDF Export / Printing, sometimes even crashes
By: mirek on Mon, 11 February 2013 21:20
|
|
|
Re: Weird problems with Report / PDF Export / Printing, sometimes even crashes
By: frozen on Mon, 11 February 2013 21:45
|
|
|
Re: Weird problems with Report / PDF Export / Printing, sometimes even crashes
By: mirek on Mon, 11 February 2013 23:38
|
|
|
Re: Weird problems with Report / PDF Export / Printing, sometimes even crashes
By: frozen on Tue, 12 February 2013 00:18
|
|
|
Re: Weird problems with Report / PDF Export / Printing, sometimes even crashes
By: mirek on Tue, 12 February 2013 08:08
|
|
|
Re: Weird problems with Report / PDF Export / Printing, sometimes even crashes
By: unodgs on Tue, 12 February 2013 08:16
|
|
|
Re: Weird problems with Report / PDF Export / Printing, sometimes even crashes
By: mirek on Tue, 12 February 2013 08:20
|
|
|
Re: Weird problems with Report / PDF Export / Printing, sometimes even crashes
By: unodgs on Tue, 12 February 2013 10:07
|
|
|
Re: Weird problems with Report / PDF Export / Printing, sometimes even crashes
By: frozen on Tue, 12 February 2013 08:28
|
Goto Forum:
Current Time: Wed Apr 24 03:33:56 CEST 2024
Total time taken to generate the page: 0.01151 seconds
|
|
|