FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour XBrowse Muliple Rows per record
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
XBrowse Muliple Rows per record
Posted: Sat Feb 02, 2008 01:22 AM
I understand that XBrowse can display mutliple lines per record, but I can't figure out how to do it.

oBrw:nDataLines := 2

Has no effect, and I don't know why you would need that. It seems that the browse should figure that out itself by the data specification.

And I can't figure out the syntax for displaying the data using oCol:bStrData. I have tried CRLF, CR, LF, and arrays.

Can someone explain the syntax?

[I am using FWH 8.01/xHarbour]

James
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
XBrowse Muliple Rows per record
Posted: Sat Feb 02, 2008 01:57 AM
Solved.

You have to also increase the row height. If you don't do that, the data appears with the CRLF symbols on the same row. So all three of these lines are required.

oCol:bStrData      := {|| trim( oCust:last) + ", " + oCust:first +CRLF+ oCust:street}

   oBrw:nDataLines := 2

   oBrw:nRowHeight := 30


This does not seem to be the best solution. It would be better if XBrowse figured out that if there were two lines of data in bStrData, then nDataLines should be set to 2, and nRowHeight should be adjusted. Actually, it should figure out the minum row height needed and use that unless nRowHeight has been specified and is greater than the minimum row height. That way we could still make the row height larger.

James
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 95
Joined: Fri Nov 23, 2007 04:43 AM
XBrowse Muliple Rows per record
Posted: Sat Feb 02, 2008 08:08 AM

James
You can also use xBrowse to show multiple lines without using CR+LF in each line. xBrowse will do it automaticaly.

...
oBRWR:nRowHeight :=50
...
oCol:= oBRWR:AddCol()
oCol:bStrData := {|| BRWR_SPIS_BADAN() }
oCol:cHeader := "Zlecone badania"
oCol:nWidth:=200
...

Function BRWR_SPIS_BADAN()
Local xRESZTA:=''
Local XXX:=0
Local xRECNO:=RR->RECNO
Local warea:=Select()
Select(2)
If DbSeek(xRECNO)
Do While xRECNO=FF->RECNO .AND. .NOT. Eof()
XXX+=1
xRESZTA+=AllTrim(OemToAnsi(5->NAZWA_S))+' '
If XXX=5
// NOT NESSESARY to divide lines for xBROWSE
//xRESZTA+=sCRLF
XXX:=0
EndIf
DbSkip(1)
EndDo
Else
Select(warea)
xRESZTA:="nothing to show"
EndIf
Return xRESZTA

Robert Frank
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
XBrowse Muliple Rows per record
Posted: Sat Feb 02, 2008 08:48 AM

Robert,

From your code it looks like you are just building one long string. Does XBrowse just word-wrap at spaces?

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 95
Joined: Fri Nov 23, 2007 04:43 AM
XBrowse Muliple Rows per record
Posted: Sat Feb 02, 2008 10:16 AM
James Bott wrote:Robert,

From your code it looks like you are just building one long string. Does XBrowse just word-wrap at spaces?

James


Exactly.
Remaind to keep oBrw:nRowHeight :=XXX up to your needs.
Robert Frank

Continue the discussion