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

Moderator: Rathinagiri

User avatar
Rathinagiri
Posts: 5181
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 142 times
Been thanked: 131 times
Contact:

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

Post by Rathinagiri » Sun Feb 10, 2013 1:10 am

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: 3902
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 13 times
Been thanked: 137 times

Post by Roberto Lopez » Sun Feb 10, 2013 1:35 am

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: 5181
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 142 times
Been thanked: 131 times
Contact:

Post by Rathinagiri » Sun Feb 10, 2013 9:42 am

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: 3902
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 13 times
Been thanked: 137 times

Post by Roberto Lopez » Sun Feb 10, 2013 12:06 pm

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: 3902
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 13 times
Been thanked: 137 times

Post by Roberto Lopez » Sun Feb 10, 2013 12:27 pm

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 135 times
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

User avatar
Roberto Lopez
HMG Founder
Posts: 3902
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 13 times
Been thanked: 137 times

Post by Roberto Lopez » Sun Feb 10, 2013 12:32 pm

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: 4363
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 247 times
Been thanked: 91 times
Contact:

Post by esgici » Sun Feb 10, 2013 1:02 pm

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: 3902
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 13 times
Been thanked: 137 times

Post by Roberto Lopez » Sun Feb 10, 2013 2:38 pm

esgici wrote:Hi Roberto

It's here.
Thanks!
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

User avatar
Roberto Lopez
HMG Founder
Posts: 3902
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 13 times
Been thanked: 137 times

Post by Roberto Lopez » Sun Feb 10, 2013 3:29 pm

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 186 times
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

User avatar
esgici
Posts: 4363
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 247 times
Been thanked: 91 times
Contact:

Post by esgici » Sun Feb 10, 2013 3:38 pm

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