Page 13 of 16

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

Posted: Sun Feb 10, 2013 1:10 am
by Rathinagiri
Thanks Roberto.

You want to specify some columns only for exporting?

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

Posted: Sun Feb 10, 2013 1:35 am
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.

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

Posted: Sun Feb 10, 2013 9:42 am
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.

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

Posted: Sun Feb 10, 2013 12:06 pm
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.

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

Posted: Sun Feb 10, 2013 12:27 pm
by Roberto Lopez
Hi All,

I've made another little modification, added a command to print directly (from a post on this thread).

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

Posted: Sun Feb 10, 2013 12:32 pm
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.

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

Posted: Sun Feb 10, 2013 1:02 pm
by esgici
Hi Roberto

It's here.

Best regards

PS: I guess that our diamond is in weekend holiday ;)

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

Posted: Sun Feb 10, 2013 2:38 pm
by Roberto Lopez
esgici wrote:Hi Roberto

It's here.
Thanks!

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

Posted: Sun Feb 10, 2013 3:29 pm
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.

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

Posted: Sun Feb 10, 2013 3:38 pm
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.