Page 1 of 1

syntax of window print

Posted: Fri Dec 10, 2010 3:40 am
by huangchenmin
Dear all
I need to print a window, so I follow the syntax to print and fail,followinf are info I got from HMG reference

Print Method
Print The Content Of a Window
Syntax:
<WindowName>.Print [ ( lPreview , ldialog , nRow , nCol , nWidth , nHeight ) ]

Syntax error occured no matter which following were used.
1. CardInfo.print cardInfo.Row,CardInfo.Col,CardInfo.Width,CardInfo.Height
hbmk2: Processing configuration: c:\hmg.3.0.34\harbour\bin\hbmk.cfg
Harbour 2.0.0 (Rev. 13372)
Copyright (c) 1999-2010, http://www.harbour-project.org/
icreader.prg(307) Error E0030 Syntax error "syntax error at 'GETPROPERTY'"
1 error
No code generated.
hbmk2: Error: Running Harbour compiler (embedded). 1
(c:\hmg.3.0.34\harbour\bin\harbour.
2. CardInfo.print(cardInfo.Row,CardInfo.Col,CardInfo.Width,CardInfo.Height)
hbmk2: Processing configuration: c:\hmg.3.0.34\harbour\bin\hbmk.cfg
Harbour 2.0.0 (Rev. 13372)
Copyright (c) 1999-2010, http://www.harbour-project.org/
icreader.prg(307) Error E0030 Syntax error "syntax error at '('"
1 error
No code generated.
hbmk2: Error: Running Harbour compiler (embedded). 1
(c:\hmg.3.0.34\harbour\bin\harbour.exe) -n2 icreader.prg /q -ic:/hmg.3.0.34/harbour/include -ic:/hmg.3.0.34//include -iJ:/ReadIC

attachment is icreader.prg
Please help!
Best Regards

Re: syntax of window print

Posted: Fri Dec 10, 2010 5:38 am
by Rathinagiri
I had seen your print function. Some of my recommendations:

1. We don't require select printer...start printpage ... end printpage sequence for window printing.
2. The method syntax should be <WindowName>.Print [ ( lPreview , ldialog , nRow , nCol , nWidth , nHeight ) ] as mentioned in the reference. So, we have to change the line calling the print method as follows:

CardInfo.print(.f., .f., 0,0,CardInfo.Width,CardInfo.Height)

Accordingly the following shall be the print function:

Code: Select all

function PTW()
   CardInfo.print(.f.,.f.0,0,CardInfo.Width,CardInfo.Height)
   return

Re: syntax of window print

Posted: Fri Dec 10, 2010 7:57 am
by huangchenmin
rathinagiri wrote:I had seen your print function. Some of my recommendations:

1. We don't require select printer...start printpage ... end printpage sequence for window ...
.....CardInfo.print(.f., .f., 0,0,CardInfo.Width,CardInfo.Height)
Accordingly the following shall be the print function:

Code: Select all

function PTW()
   CardInfo.print(.f.,.f.0,0,CardInfo.Width,CardInfo.Height)
   return
I did in your way and fail.
Following are error message after compiled

hbmk2: Processing configuration: c:\hmg.3.0.34\harbour\bin\hbmk.cfg
Harbour 2.0.0 (Rev. 13372)
Copyright (c) 1999-2010, http://www.harbour-project.org/
icreader.prg(312) Error E0030 Syntax error "syntax error at '('"
1 error
No code generated.
hbmk2: Error: Running Harbour compiler (embedded). 1
(c:\hmg.3.0.34\harbour\bin\harbour.exe) -n2 icreader.prg /q -ic:/hmg.3.0.34/harbour/include -ic:/hmg.3.0.34//include -iJ:/ReadIC

Re: syntax of window print

Posted: Fri Dec 10, 2010 8:22 am
by nguyenchiduc
huangchenmin wrote:Dear all
CardInfo.print
I use Window.Print => It's OK

But <WindowName>.Print [ ( lPreview , ldialog , nRow , nCol , nWidth , nHeight ) ] => It does not work

===========

My computer at home, no printer. I have not tried window.print with a printer

I will test it on Monday next week

Re: syntax of window print

Posted: Fri Dec 10, 2010 9:28 am
by huangchenmin
nguyenchiduc wrote:
huangchenmin wrote:Dear all
CardInfo.print
I use Window.Print => It's OK
But <WindowName>.Print [ ( lPreview , ldialog , nRow , nCol , nWidth , nHeight ) ] => It does not work
.......
I will test it on Monday next week
me 2
I use to codeing like you, and print window to pdf printer for testing..
The reason i would like to know more details about parameters is the big margins around image.
I think those parameter such as nRow、nCol、nWidth、nHeight might improve that.
or HMG print system have propertied to mangine margins.
Best Regards