Report PDF export function does not work HMG 3.3.1

Moderator: Rathinagiri

trmpluym
Posts: 303
Joined: Tue Jul 15, 2014 6:52 pm
Location: The Netherlands

Re: Report PDF export function does not work HMG 3.3.1

Post by trmpluym »

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 4464 times
Then I browse to a folder and try to save the PDF file.
Report2.png
Report2.png (5.88 KiB) Viewed 4464 times
I press the save button ... and .... there is the error ...
Report3.png
Report3.png (3.88 KiB) Viewed 4464 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 226 times
EduardoLuis
Posts: 682
Joined: Tue Jun 04, 2013 6:33 pm
Location: Argentina

Re: Report PDF export function does not work HMG 3.3.1

Post by EduardoLuis »

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: 303
Joined: Tue Jul 15, 2014 6:52 pm
Location: The Netherlands

Re: Report PDF export function does not work HMG 3.3.1

Post by trmpluym »

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: 682
Joined: Tue Jun 04, 2013 6:33 pm
Location: Argentina

Re: Report PDF export function does not work HMG 3.3.1

Post by EduardoLuis »

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: 3718
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Report PDF export function does not work HMG 3.3.1

Post by mol »

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: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Report PDF export function does not work HMG 3.3.1

Post by Pablo César »

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: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Report PDF export function does not work HMG 3.3.1

Post by Pablo César »

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: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Report PDF export function does not work HMG 3.3.1

Post by Pablo César »

Screen90.png
Screen90.png (16.5 KiB) Viewed 4353 times
Sure Theo !
Attachments
HMG_PrintFile.rar
PDF generated
(1.03 MiB) Downloaded 242 times
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
trmpluym
Posts: 303
Joined: Tue Jul 15, 2014 6:52 pm
Location: The Netherlands

Re: Report PDF export function does not work HMG 3.3.1

Post by trmpluym »

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: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Report PDF export function does not work HMG 3.3.1

Post by Pablo César »

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