Grid2Print - Suggestions

Source code related resources

Moderator: Rathinagiri

User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Re: Grid2Print - Suggestions

Post by Roberto Lopez »

Roberto Lopez wrote:
IMHO a 'Print' method for a grid, must print grid data 'as is', in the same way that the data is being shown in the screen, with (perhaps) the exception, of some 'off grid' optional things like headers, footers, etc.
And... IMHO... maybe parameters 3 y 4 (headers and Types) could be optional too, using grid headers as column print headers could be right.

Regards,

Roberto.
Regards/Saludos,

Roberto


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

Re: Grid2Print - Suggestions

Post by Roberto Lopez »

Roberto Lopez wrote: And... IMHO... maybe parameters 3 y 4 (headers and Types) could be optional too, using grid headers as column print headers could be right.
Anyway... Why do you need the 'Types' array?

Yes... this could be a silly question, but I've not reviewed your code deeply enough... I'm sorry in advance :)

Regards,

Roberto.
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: Grid2Print - Suggestions

Post by Rathinagiri »

Roberto Lopez wrote:
rathinagiri wrote:Hi Friends,

Here comes the latest version of GridPrint with some bug fixes and changes:
A little bug.

When you select a big font size, causes preview problems:

Regards,

Roberto.
It is NOT a bug. It shows, that, it cannot print the whole data in a paper with this fontsize selected. That is the width of the grid data exceeds the paper size! So, what you have to do? One of the following:

1. Change the orientation of the paper from Portrait to Landscape
2. Reduce some left and right margin
3. If possible have a larger paper
4. Truncate the character/text type columns by reducing the width (mm) && (I am now working on wordwrap)
5. Disable some column(s) which is not required for this report.
6. If none of the above is not possible there is no other way, you have to reduce the fontsize :(

However, if the report width is exceeding paper width, Print button is DISABLED. :)

Please tell your suggestions in this regard.

Thanks.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
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: Grid2Print - Suggestions

Post by Rathinagiri »

Roberto Lopez wrote:
Roberto Lopez wrote:
IMHO a 'Print' method for a grid, must print grid data 'as is', in the same way that the data is being shown in the screen, with (perhaps) the exception, of some 'off grid' optional things like headers, footers, etc.
And... IMHO... maybe parameters 3 y 4 (headers and Types) could be optional too, using grid headers as column print headers could be right.

Regards,

Roberto.
Yes. You are right. But, unfortunately, headers property is not available inside programs. I am afraid it is available at the time of control definition only.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
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: Grid2Print - Suggestions

Post by Rathinagiri »

Roberto Lopez wrote:
Roberto Lopez wrote: And... IMHO... maybe parameters 3 y 4 (headers and Types) could be optional too, using grid headers as column print headers could be right.
Anyway... Why do you need the 'Types' array?

Yes... this could be a silly question, but I've not reviewed your code deeply enough... I'm sorry in advance :)

Regards,

Roberto.
Yes. Types array is to know about the justifications only. If we can get the justification from the grid control itself as a read only property that is also not required.
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: Grid2Print - Suggestions

Post by Roberto Lopez »

rathinagiri wrote:
Roberto Lopez wrote:
rathinagiri wrote:Hi Friends,

Here comes the latest version of GridPrint with some bug fixes and changes:
A little bug.

When you select a big font size, causes preview problems:

Regards,

Roberto.
It is NOT a bug. It shows, that, it cannot print the whole data in a paper with this fontsize selected. That is the width of the grid data exceeds the paper size! So, what you have to do? One of the following:

1. Change the orientation of the paper from Portrait to Landscape
2. Reduce some left and right margin
3. If possible have a larger paper
4. Truncate the character/text type columns by reducing the width (mm) && (I am now working on wordwrap)
5. Disable some column(s) which is not required for this report.
6. If none of the above is not possible there is no other way, you have to reduce the fontsize :(

However, if the report width is exceeding paper width, Print button is DISABLED. :)

Please tell your suggestions in this regard.

Thanks.
I'm sorry. It's ok :)

Regards,

Roberto.
Regards/Saludos,

Roberto


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

Re: Grid2Print - Suggestions

Post by Roberto Lopez »

rathinagiri wrote:
Roberto Lopez wrote:
Roberto Lopez wrote:
IMHO a 'Print' method for a grid, must print grid data 'as is', in the same way that the data is being shown in the screen, with (perhaps) the exception, of some 'off grid' optional things like headers, footers, etc.
And... IMHO... maybe parameters 3 y 4 (headers and Types) could be optional too, using grid headers as column print headers could be right.

Regards,

Roberto.
Yes. You are right. But, unfortunately, headers property is not available inside programs. I am afraid it is available at the time of control definition only.

Yes, they are here....

Try something like this in any Grid sample:

MsgInfo ( Form_1.Grid_1.Header(1) )

Regards,

Roberto.
Regards/Saludos,

Roberto


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

Re: Grid2Print - Suggestions

Post by Roberto Lopez »

rathinagiri wrote:
Roberto Lopez wrote:
Roberto Lopez wrote: And... IMHO... maybe parameters 3 y 4 (headers and Types) could be optional too, using grid headers as column print headers could be right.
Anyway... Why do you need the 'Types' array?

Yes... this could be a silly question, but I've not reviewed your code deeply enough... I'm sorry in advance :)

Regards,

Roberto.
Yes. Types array is to know about the justifications only. If we can get the justification from the grid control itself as a read only property that is also not required.
I'll work on that!

Regards,

Roberto.
Regards/Saludos,

Roberto


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

Re: Grid2Print - Suggestions

Post by Roberto Lopez »

Roberto Lopez wrote:
Yes. Types array is to know about the justifications only. If we can get the justification from the grid control itself as a read only property that is also not required.
You can retrieve alignment array for a grid as follows:

i := GetControlIndex ( cControlName , cWindowName )

aJustify := _HMG_SYSDATA [ 37 ]

Regards,

Roberto.
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: Grid2Print - Suggestions

Post by esgici »

Very interesting :?

in c:\hmg\source\h_init.prg :
_HMG_SYSDATA [ 37 ] -> _HMG_aControlBrushHandle
Regards

--
esgici
Viva INTERNATIONAL HMG :D
Post Reply