Page 1 of 1

2 issues oBrw:report() and MsgInfo() etc

PostPosted: Thu Aug 28, 2008 6:55 pm
by hag
oBrw:report()

1. Trying to print a browse using oBrw:report() get an error message:
2. msgAlert(), msgInfo() etc not centered. How can I get them centered.

Thanks in advance.


Code: Select all  Expand view
Error description: Error BASE/1111  Argument error: LEN
   Args:
     [   1] = U   

Stack Calls
===========
   Called from:  => LEN(0)
   Called from:  => TRCOLUMN:STABILIZE(0)
   Called from:  => (b)STABILIZE(0)
   Called from:  => AEVAL(0)
   Called from:  => TREPORT:STABILIZE(0)
   Called from:  => TREPORT:ACTIVATE(0)
   Called from:  => TXBROWSE:REPORT(4282)
   Called from: .\JBROWSE.PRG => TOEXITPRINT(6112)
   Called from: .\JBROWSE.PRG => (b)PLBROW(1342)
   Called from:  => TBUTTON:CLICK(0)
   Called from:  => TBUTTON:HANDLEEVENT(0)
   Called from: .\source\classes\WINDOW.PRG => _FWH(0)
   Called from:  => SENDMESSAGE(0)
   Called from:  => TDIALOG:COMMAND(0)
   Called from:  => TWINDOW:HANDLEEVENT(0)
   Called from:  => TDIALOG:HANDLEEVENT(0)
   Called from:  => DIALOGBOX(0)
   Called from:  => TDIALOG:ACTIVATE(0)
   Called from: .\JBROWSE.PRG => PLBROW(1567)

PostPosted: Sat Aug 30, 2008 2:00 pm
by nageswaragunupudi
1. The browse should be active while report is being run.
2. bStrData, if not nil, should evaluate to a valid character expression. If bStrData is nil bEditValue should evaluate to a non-nil expression. ( Such problem should not arise if we do not directly code bStrData and use xbrowse command syntax only.)

PostPosted: Sat Aug 30, 2008 5:29 pm
by hag
NageswaraRao:

Since i'm new to xbrowse. How would you convert this code:

Code: Select all  Expand view
ADD COLUMN to xBrowse oBrw ;
   DATA {|| if(gl->title == repli('-', 30), repli(' ' , 30), ;
   if(gl->title == repli('=', 30), repli(' ', 30), ;
   if(gl->account == "2053" .or. gl->account == "2514".or. gl->account == "2632", repli(' ', 30), ;
   if(gl->account == "2733", repli(' ', 30), ;
   if(gl->account == "2833" .or. gl->account == "2933", repli(' ', 30), ;
   if(gl->account == "2998" .or. gl->account == "3355", repli(' ', 30), ;
   if(gl->account == "3485" , repli(' ', 30), ;
   trans(eval(bty13), '999,999,999') ))))))) };
   SIZE 71  RIGHT  HEADER cOne  COLOR CLR_BLACK,CLR_WHITE       

PostPosted: Sun Aug 31, 2008 4:36 am
by nageswaragunupudi
This code is equivalent to your code
Code: Select all  Expand view
ADD TO oBrw DATA ;
   If( gl->title = '-' .or. gl->title = '=' .or. ;
       gl->account $ '2053,2514,2632,2733,2833,2933,2998,3355,3485', ;
       0, Eval( bty13 ) ) ;
   PICTURE '@Z 999,999,999' ;
   SIZE 71 ;
   HEADER cone ;
   RIGHT ;       // not necessary. XBrowse automatically right justifies numerics
   COLOR CLR_BLACK,CLR_WHITE  // required only if different from browse colors

PostPosted: Sun Aug 31, 2008 8:39 pm
by hag
Thank you for the code. it certainly is more efficient then what I've been using.
My original problem has not been solved. I get the following error message when I attempt to print using oBrw:report(). Antonios suggestion.

Code: Select all  Expand view
Error description: Error BASE/1111  Argument error: LEN
   Args:
     [   1] = U   

Stack Calls
===========
   Called from:  => LEN(0)
   Called from:  => TRCOLUMN:STABILIZE(0)
   Called from:  => (b)STABILIZE(0)
   Called from:  => AEVAL(0)
   Called from:  => TREPORT:STABILIZE(0)
   Called from:  => TREPORT:ACTIVATE(0)
   Called from:  => TXBROWSE:REPORT(4282)
   Called from: .\JBROWSE.PRG => TOEXITPRINT(6112)
   Called from: .\JBROWSE.PRG => (b)PLBROW(1342)
   Called from:  => TBUTTON:CLICK(0)
   Called from:  => TBUTTON:HANDLEEVENT(0)
   Called from: .\source\classes\WINDOW.PRG => _FWH(0)
   Called from:  => SENDMESSAGE(0)
   Called from:  => TDIALOG:COMMAND(0)
   Called from:  => TWINDOW:HANDLEEVENT(0)
   Called from:  => TDIALOG:HANDLEEVENT(0)
   Called from:  => DIALOGBOX(0)
   Called from:  => TDIALOG:ACTIVATE(0)
   Called from: .\JBROWSE.PRG => PLBROW(1567)


In your post you said:
1. The browse should be active while report is being run.
2. bStrData, if not nil, should evaluate to a valid character expression. If bStrData is nil bEditValue should evaluate to a non-nil expression. ( Such problem should not arise if we do not directly code bStrData and use xbrowse command syntax only.)


Frankly I'm lost. All code has been change and still get error message.
Also could yo explain what you mean

1. The browse should be active while report is being run.



I the oBrw is active. Not closed until after the print which doesn't occur because of the error message.

Thanks for you help. It is greatly appreciated.

PostPosted: Sun Aug 31, 2008 8:44 pm
by nageswaragunupudi
Some columns of browse must be creating problems. Hope you know that you can hide any column at runtime by right clicking on header.

First hide all columns except the first column and run the report. If it works, unhide second column and run report. Like that unhide each column and run the report. You know which column definition is creating the problem. We shall then examine how that column is coded

PostPosted: Sun Aug 31, 2008 8:51 pm
by hag
Removed all but one. Same error message. All columns coded using the code you sent.

PostPosted: Mon Sep 01, 2008 4:27 am
by nageswaragunupudi
Mr Hag

>
My original problem has not been solved. I get the following error message when I attempt to print using oBrw:report(). Antonios suggestion.
>

We get this error if cHeader of any column is NIL. Please assign some character value to all headers and then try again.

Mr Antonio is requested provide a suitable fix to avoid runtime error when any header is nil

PostPosted: Mon Sep 01, 2008 2:32 pm
by hag
NageswaraRao:

Yes that was the problem. Had a cHeader nil.

Presently I'm checkin on how to control font size and number of pages to print. I'm printing in landscape with a 15 column browse which gives me a page to print to wide for page error.
And it seems to print 6 extra pages which are not needed. Haven't been able to find info yet.

TYHanks for the help. Its a real help.

Harvey

PostPosted: Mon Sep 01, 2008 5:51 pm
by Antonio Linares
Rao,

Fixed, thanks! :-)

PostPosted: Mon Sep 01, 2008 11:45 pm
by hag
Using oBrw:report() which prints fine. But I can't find out how to set a font size and limit number of pages to print.

I'm printing in landscape with a 15 column browse which gives me a page "print to wide for page" error.

And it seems to print 6 extra pages which are not needed. Haven't been able to find info yet.

Need some help.

PostPosted: Tue Sep 02, 2008 3:35 pm
by RAMESHBABU
Mr.Antonio,

Can you please post here the fix, so that I can update my fwh 8.08 ?

Thanks,

- Ramesh Babu P