Grid2Print - Suggestions
Moderator: Rathinagiri
- luisvasquezcl
- Posts: 1258
- Joined: Thu Jul 31, 2008 3:23 am
- Location: Chile
- Contact:
Re: Grid2Print - Suggestions
Hi,
very good job.
the memo field will be supported.
regards,
Luis Vasquez
very good job.
the memo field will be supported.
regards,
Luis Vasquez
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: Grid2Print - Suggestions
Hi Rathi
TRANSFORM(123456, "$999,999") // Result: $123,456
or
nValue := 123456.789
TRANSFORM( nValue , "999,999.999") // Result: 123,456.789
Certainly, you can use any formatting method into gird. My suggestion is about formatting while building print/report.
BTW some random sights:
- Converting numeric value to "verbal" is a big task. But it is not related directly with printing, it made larger the program and get hard to understanding.
- Using very little ( even single letter ) variable names also get difficult to understanding.
- Since return always "True" , "iif(.t.,"True","False")" expression ( Sample.prg, line 27) is (sorry) meaningless.
Regards
--
esgici
Sorry, according to column headers I think that "digit only" cell are numeric in type.You wrote:I take everything as entered in Grid and that too only string item grids.
I mean by "formatting", converting a numeric value to a character string into more readable format. As you know, most easy way is using TRANSFORM() function. f.e:By formatting you mean, formatting the numbers as given by the user as parameter for the function? Please give me syntax, so that I can proceed.
TRANSFORM(123456, "$999,999") // Result: $123,456
or
nValue := 123456.789
TRANSFORM( nValue , "999,999.999") // Result: 123,456.789
Certainly, you can use any formatting method into gird. My suggestion is about formatting while building print/report.
BTW some random sights:
- Converting numeric value to "verbal" is a big task. But it is not related directly with printing, it made larger the program and get hard to understanding.
- Using very little ( even single letter ) variable names also get difficult to understanding.
- Since return always "True" , "iif(.t.,"True","False")" expression ( Sample.prg, line 27) is (sorry) meaningless.
Regards
--
esgici
Viva INTERNATIONAL HMG
- Roberto Lopez
- HMG Founder
- Posts: 4004
- Joined: Wed Jul 30, 2008 6:43 pm
Re: Grid2Print - Suggestions
Oh yes... nothing is ever finishedrathinagiri wrote:Thank you Roberto. It is just a beginning. Long way to go.
Regards,
Roberto.
Regards/Saludos,
Roberto
(Veritas Filia Temporis)
Roberto
(Veritas Filia Temporis)
- 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
Hi Esgici,
Thanks for your nice and exhaustive review.
Thanks for your nice and exhaustive review.
Yes. I am just working on that.esgici wrote:
I mean by "formatting", converting a numeric value to a character string into more readable format. As you know, most easy way is using TRANSFORM() function. f.e:
TRANSFORM(123456, "$999,999") // Result: $123,456
or
nValue := 123456.789
TRANSFORM( nValue , "999,999.999") // Result: 123,456.789
Certainly, you can use any formatting method into gird. My suggestion is about formatting while building print/report.
Next version solves this.esgici wrote: BTW some random sights:
- Converting numeric value to "verbal" is a big task. But it is not related directly with printing, it made larger the program and get hard to understanding.
- Using very little ( even single letter ) variable names also get difficult to understanding.
Yes. I will change.esgici wrote: - Since return always "True" , "iif(.t.,"True","False")" expression ( Sample.prg, line 27) is (sorry) meaningless.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
- Roberto Lopez
- HMG Founder
- Posts: 4004
- Joined: Wed Jul 30, 2008 6:43 pm
Re: Grid2Print - Suggestions
Here is a modified grid2print for User Components Interface (UCI) demostration.rathinagiri wrote:
Thanks for your nice and exhaustive review.
The sample assume that the method has only two user parametrs (Currently, Domethod function supports until four user parameters but grid2print requires seven).
The file 'i_UsrSOOP.ch' must be copied to c:\hmg\include.
So, you'll have a new method for grid control called 'Print'.
Regards,
Roberto.
- Attachments
-
- usr_comp_grid2print.zip
- (10.26 KiB) Downloaded 326 times
Regards/Saludos,
Roberto
(Veritas Filia Temporis)
Roberto
(Veritas Filia Temporis)
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: Grid2Print - Suggestions
Wonderful !..Roberto Lopez wrote: So, you'll have a new method for grid control called 'Print'.
Our new method work fine on official HMG Sample\Grid_1. Here sligthly modified version:
Code: Select all
/*
Grid Test with GridPrint (UCI) Method
( Based Upon official HMG Sample\Grid_1 )
*/
#include "minigui.ch"
Set Procedure To GridPrint.Prg
Function Main
Local aRows [20] [3]
DEFINE WINDOW Form_1 ;
AT 0,0 ;
WIDTH 450 ;
HEIGHT 420 ;
TITLE 'Grid Test with GridPrint (UCI) Method ' ;
MAIN
aRows [1] := {'Simpson','Homer','555-5555'}
aRows [2] := {'Mulder','Fox','324-6432'}
aRows [3] := {'Smart','Max','432-5892'}
aRows [4] := {'Grillo','Pepe','894-2332'}
aRows [5] := {'Kirk','James','346-9873'}
aRows [6] := {'Barriga','Carlos','394-9654'}
aRows [7] := {'Flanders','Ned','435-3211'}
aRows [8] := {'Smith','John','123-1234'}
aRows [9] := {'Pedemonti','Flavio','000-0000'}
aRows [10] := {'Gomez','Juan','583-4832'}
aRows [11] := {'Fernandez','Raul','321-4332'}
aRows [12] := {'Borges','Javier','326-9430'}
aRows [13] := {'Alvarez','Alberto','543-7898'}
aRows [14] := {'Gonzalez','Ambo','437-8473'}
aRows [15] := {'Batistuta','Gol','485-2843'}
aRows [16] := {'Vinazzi','Amigo','394-5983'}
aRows [17] := {'Pedemonti','Flavio','534-7984'}
aRows [18] := {'Samarbide','Armando','854-7873'}
aRows [19] := {'Pradon','Alejandra','???-????'}
aRows [20] := {'Reyes','Monica','432-5836'}
aHeadArry := {'Last Name','First Name','Phone'}
@ 10,10 GRID Grid_1 ;
WIDTH 430 ;
HEIGHT 330 ;
HEADERS aHeadArry;
WIDTHS {140,140,140};
ITEMS aRows ;
VALUE 1
define button print
row 345
col 200
caption "Print"
action printsamplegrid()
end button
END WINDOW
CENTER WINDOW Form_1
ACTIVATE WINDOW Form_1
Return
function printsamplegrid
Form_1.Grid_1.Print ( aHeadArry,{"C","C","C"} )
return nil
--
esgici
Viva INTERNATIONAL HMG
- Roberto Lopez
- HMG Founder
- Posts: 4004
- Joined: Wed Jul 30, 2008 6:43 pm
Re: Grid2Print - Suggestions
I'm afraid that I'm disagree with you....esgici wrote: I mean by "formatting", converting a numeric value to a character string into more readable format. As you know, most easy way is using TRANSFORM() function. f.e:
TRANSFORM(123456, "$999,999") // Result: $123,456
or
nValue := 123456.789
TRANSFORM( nValue , "999,999.999") // Result: 123,456.789
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.
So, adding formating to 'Print' method could be redundant and/or unnecessary.
Again... "IMHO"
Regards,
Roberto.
Regards/Saludos,
Roberto
(Veritas Filia Temporis)
Roberto
(Veritas Filia Temporis)
- Roberto Lopez
- HMG Founder
- Posts: 4004
- Joined: Wed Jul 30, 2008 6:43 pm
Re: Grid2Print - Suggestions
A little bug.rathinagiri wrote:Hi Friends,
Here comes the latest version of GridPrint with some bug fixes and changes:
When you select a big font size, causes preview problems:
Regards,
Roberto.
- Attachments
-
- Image1.jpg (105.43 KiB) Viewed 7639 times
Regards/Saludos,
Roberto
(Veritas Filia Temporis)
Roberto
(Veritas Filia Temporis)
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: Grid2Print - Suggestions
ABSOLUTELY you are right ...Roberto Lopez wrote:...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,
Moreover, everyone ( in our case every 'rutin' ) must know and realize its OWN duty. Formatting the data isn't one of printing "duty".
Regards
--
esgici
Viva INTERNATIONAL HMG
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: Grid2Print - Suggestions
Roberto Lopez wrote:
When you select a big font size, causes preview problems:
Regardsesgici wrote: ( At 13 Aug 2008 )
We ( Rathinagiri ) need a function such as
LenStrInPixel( <cString>, <aFont> ) --> <nLengthInPixel> (*)
(*) <aFont> : Font properties array: name, size, bold, italic ...
--
esgici
Viva INTERNATIONAL HMG