HMG_HPDF - Export to PDF made easy... (New Version)

Moderator: Rathinagiri

User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: HMG_HPDF - Export to PDF made easy... (New Version)

Post by Rathinagiri »

Thanks Roberto.

You want to specify some columns only for exporting?
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Re: HMG_HPDF - Export to PDF made easy... (New Version)

Post by Roberto Lopez »

rathinagiri wrote:Thanks Roberto.

You want to specify some columns only for exporting?
Usually, my application's grids has lots of columns, but I only need to print the most relevant (because space limitations), so have an option to specify which columns to print programmatically, could be great.

If such option does not exists yet, I guess that a logical array parameter could be a good solution.

TIA.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: HMG_HPDF - Export to PDF made easy... (New Version)

Post by Rathinagiri »

Hi Roberto,

Since I have adapted _GridPDF from _GridPrint we can select the columns to be printed as well.

These are the parameters for the function _GridPDF. This function can be used to make a PDF of a two dimensional array also.

_gridpdf(cGrid, cWindow, cPDFFile, fontsize, orientation, aHeaders, fontname1, showwindow1, mheaders, summation, aArrayData, aArrayHeaders, aArrayJustify, aColumnWidths, nPaperSize, nPaperWidth, nPaperHeight, lVerticalLines, lHorizontalLines, nLeft, nTop, nRight, nBottom )

I will explain one by one:

cGrid - Name of the Grid control. Can be omitted if an array is to be exported.
cWindow - Name of the Window. Can be omitted if an array is to be exported.
cPDFFile - Name of the PDF file to be exported.
fontsize - Normal print fontsize.
orientation - "P" for portrait and "L" for Landscape
aHeaders - An array of Headers having maximum three strings to be repeated on each page. This will be printed bold with a higher fontsize than the normal one.
fontname1 - Name of the font
showwindow1 - GridPDF window to be shown or not.
mHeaders - An array of Merge Headers in the format { { nStartCol, nEndCol, cHeaderName },... } eg., { { 2, 4, 'This is the merged header for columns 2, 3, 4 } }
Summation - An array of '0's and '1's to specify which column values are to be summed up.
aArrayData - Only required in array printing mode. If it is for Grid, it can be omitted.
aArrayHeaders - Column Headers in case of array mode.
aArrayJustify - Column Justification in array mode.
aColumnWidths - An array of column widths in mm for each column. You can put '0' if you don't want to print a column.
nPaperSize - Paper size constant from ch file.
nPaperWidth - User defined Paper Width in mm
nPaperHeight - User defined Paper Height in mm
lVerticalLines - .t. if column separation line required.
lHorizontalLines - .t. if row separation line required.
nLeft - Left margin of the page in mm
nTop - Top margin of the page in mm
nRight - Right margin of the page in mm
nBottom - Bottom margin of the page in mm

So, you can leave column without exporting using the values in aColumnWidths to be 0.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Re: HMG_HPDF - Export to PDF made easy... (New Version)

Post by Roberto Lopez »

rathinagiri wrote:Hi Roberto,

Since I have adapted _GridPDF from _GridPrint we can select the columns to be printed as well.
<...>
So, you can leave column without exporting using the values in aColumnWidths to be 0.
Thanks for the detailed explanation.

It will be extremely useful for me.

As I've said in a previous message, IMHO, it should be integrated at HMG core as a method for grid.

Thanks again for your great work.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Re: HMG_HPDF - Export to PDF made easy... (New Version)

Post by Roberto Lopez »

Hi All,

I've made another little modification, added a command to print directly (from a post on this thread).
Attachments
pdf.zip
(245.64 KiB) Downloaded 443 times
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Re: HMG_HPDF - Export to PDF made easy... (New Version)

Post by Roberto Lopez »

OOPS!

I've realized that I've was not working with the last HPDF version.

Could be you so kind to provide a link to it?

TIA.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: HMG_HPDF - Export to PDF made easy... (New Version)

Post by esgici »

Hi Roberto

It's here.

Best regards

PS: I guess that our diamond is in weekend holiday ;)
Viva INTERNATIONAL HMG :D
User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Re: HMG_HPDF - Export to PDF made easy... (New Version)

Post by Roberto Lopez »

esgici wrote:Hi Roberto

It's here.
Thanks!
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Re: HMG_HPDF - Export to PDF made easy... (New Version)

Post by Roberto Lopez »

Hi All,

This is the final version of modified HPDF (I've applied changes to its current version now).

Summary of changes:

- New SET PRINTSYSTEM PDF command.

- 'HPDF' prefix to commands and constants changed to 'PRINT'

- New clause 'PREVIEW' to SELECT PRINTER command.

- New command 'OPEN FILE' (alias for EXECUTE FILE)

- New command PRINT FILE <cFile> [ TO <cPrinter> ]

I'll add this modified HPDF version to uHTTP server bundled with HMGSCRIPT and work on server side PDF generation.

Hopefully (if I find enough time to do it) I'll publish a new HMGSCRIPT version soon.
Attachments
HPDF.zip
(374.37 KiB) Downloaded 500 times
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: HMG_HPDF - Export to PDF made easy... (New Version)

Post by esgici »

Thanks a lot Roberto;

It's wonderful as always :)

I hope a new version of HMG_3 before HMG_5 ( HMG_Script )

With my best regards.
Viva INTERNATIONAL HMG :D
Post Reply