Report PDF export function does not work HMG 3.3.1

Moderator: Rathinagiri

trmpluym
Posts: 183
Joined: Tue Jul 15, 2014 6:52 pm
Location: The Netherlands
Has thanked: 4 times
Been thanked: 10 times

Re: Report PDF export function does not work HMG 3.3.1

Post by trmpluym » Mon Feb 06, 2017 6:53 pm

Eduardo,

Thanks for taking the time to help me !
Could you post an small sample, because i can't find your issue.-
I use the PrintSystem sample distributed with the HMG release (c:\hmg.3.4.3\SAMPLES\PrintSystem). The only change is a modified (larger) DBF file. But to make it easy i will attach the complete folder (source, exe and DBF) to this post (printsystem.zip).

Everything seems to work well until i press the export button.
Report1.png
Report1.png (8.85 KiB) Viewed 155 times
Then I browse to a folder and try to save the PDF file.
Report2.png
Report2.png (5.88 KiB) Viewed 155 times
I press the save button ... and .... there is the error ...
Report3.png
Report3.png (3.88 KiB) Viewed 155 times
I found out this error occurs when there are more than 18 pages in the report.

The previous HMG releases got the same problem.

Theo
Attachments
PrintSystem.zip
(1.53 MiB) Downloaded 9 times

EduardoLuis
Posts: 476
Joined: Tue Jun 04, 2013 6:33 pm
Location: Argentina
Been thanked: 20 times

Post by EduardoLuis » Tue Feb 07, 2017 1:38 pm

Hi Trmpluym:

I've test your sample, and you are right.-
I do test with full dbf records and other with only 150 records.-
With small quantity of records there is no trouble, but with full database collapses and don't generate PDF file.-
I don't use printsystem, because i prefer developing my personal printsystem.-
For that i use HMGHPDF (see HMG3.4.3.\SAMPLES\HPDF\HMG_HPDF or HMG_HPDFUNI)
It's more versatil, and you can with less effort develope proffessional PDF with practically no limits.-
Sorry if i can't help you to continue using printsystem.-
With regards. Eduardo

trmpluym
Posts: 183
Joined: Tue Jul 15, 2014 6:52 pm
Location: The Netherlands
Has thanked: 4 times
Been thanked: 10 times

Post by trmpluym » Tue Feb 07, 2017 6:02 pm

Sorry if i can't help you to continue using printsystem
Hopefully some other developer can help me out. Otherwise it is better to remove the whole PDF export option. By using a PDF based printer (for example PDFCreator) i can achieve the same functionality.
But now (when the button is available) end users use the button with the ugly error as an result.

But anyway thank you Eduardo for trying..

EduardoLuis
Posts: 476
Joined: Tue Jun 04, 2013 6:33 pm
Location: Argentina
Been thanked: 20 times

Post by EduardoLuis » Tue Feb 07, 2017 6:50 pm

Hi Trmpluym:

First, every member on this forum allways have a solution if that it's possible.- On this community everyone helps eachother, ever.- Sometime the help comes on time other, some day post, but allways come.- ;)
Second, printsystem, unless for me, it's not the best way to perform a high quality report.-
Just for your information, with HMGHPDF i've create an app than performs a PDF report with 144 pages (about 40'' to do that job).- I put away the idea of a "preview" for the reports; i generate then directly to a PDF, and initiate PDFReader, so end user see the report inmediatly, store it, or do what he want.-
IMHO, in some cases it's neccesary to open our minds and go for the best solution, although this way mean investing several hours of developement or writing long code.-
The best of HMG is that you can do practically everything, what means the only limit is your imagination.-
This is not cheap, but finally the work is done.-
With regards.
Eduardo

User avatar
mol
Posts: 2670
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 69 times
Been thanked: 24 times
Contact:

Post by mol » Tue Feb 07, 2017 7:55 pm

It's better to decide how to generate report - to printer or to pdf before generating it. In this way I generate two hundred pages report to pdf without any problem.

Save function from printing system generates picture for every page, so result file is very big

User avatar
Pablo César
Posts: 3987
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil
Has thanked: 97 times
Been thanked: 158 times

Post by Pablo César » Tue Feb 07, 2017 9:22 pm

trmpluym wrote:
Sun Aug 10, 2014 12:29 pm
When using the PDF export function with large reports (more then 18 pages) the export failes with the message:

image cannot be loaded

...

When using the JPG export not all pages are exported and the last exported page is black.
Hi Theo, I have not read all topic yet but would you explain when this error occurs:

1. Is for JPG or PNG
2. Are you alternating images files according any conditional being placed for some records ?
3. These images are coming from ressources or directly to file name ?

Because "image cannot be loaded" is coming only when try to load the image.

I can not tell you if is this the main cause but probably it's not giving time to release handle from the memory, I guess.
In case we are sure the image is loadable one. I mensa loaded at least one time...
Probably the problem it's in the C function. I my mind I believe should load image once and not all the time...

Now I see you posted here http://www.hmgforum.com/viewtopic.php?p=49130#p49130 the quite complete your sample but... is not any image in it... :|

I have executed this your example and not problem at all. It's has created the HMG_PrintFile.PDF but I choose to be written at local folder (not other place). But withou image... :|
Rathinagiri wrote:
Sun Mar 13, 2016 12:43 pm
Sure we shall remove this option inside the print preview. Now you can directly print to pdf if you want to.

This is an old rude method saving the report pages as images. The size of pdf files would be huge if the number of pages are more.
Dear Rathi, are you replacing this feature with something improved or similar ? Because to export method is usefull too even for PDFs files.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein

User avatar
Pablo César
Posts: 3987
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil
Has thanked: 97 times
Been thanked: 158 times

Post by Pablo César » Tue Feb 07, 2017 9:40 pm

Rathinagiri wrote:PDF export from HMG PrintSystem is just saving the print page(s) as image(s) inside a PDF. So, it is not advisable for reports having many pages.
Marek wrote:Save function from printing system generates picture for every page, so result file is very big
Yes, probably exhaustion of memory. Images takes a lot of memory.

But I run the same example here without any problem... :?
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein

User avatar
Pablo César
Posts: 3987
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil
Has thanked: 97 times
Been thanked: 158 times

Post by Pablo César » Thu Feb 09, 2017 10:33 pm

Screen90.png
Screen90.png (16.5 KiB) Viewed 44 times
Sure Theo !
Attachments
HMG_PrintFile.rar
PDF generated
(1.03 MiB) Downloaded 12 times
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein

trmpluym
Posts: 183
Joined: Tue Jul 15, 2014 6:52 pm
Location: The Netherlands
Has thanked: 4 times
Been thanked: 10 times

Post by trmpluym » Thu Feb 09, 2017 10:36 pm

Pablo,
Pablo César wrote:
Tue Feb 07, 2017 9:22 pm

1. Is for JPG or PNG
2. Are you alternating images files according any conditional being placed for some records ?
3. These images are coming from ressources or directly to file name ?
I do not use images. The demo explains. The preview shows a text only report. Then i click export and save the PDF file.

Cay you use the demo in my last post and post the exported PDF ?

Theo

User avatar
Pablo César
Posts: 3987
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil
Has thanked: 97 times
Been thanked: 158 times

Post by Pablo César » Thu Feb 09, 2017 10:38 pm

Thank for your answers. I surely used your example.

I would not say it worked for me without having tested your example ...

P.S. (Added later):
  • Sorry to be attached captured screen in my previous messages.
    I did this, because it was missing the message but now I see that you have redone the message.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests