When in xbrowse two columns belong at same Group headers
the position of get in getbar is not ok.
When in cHeader of the column is present CRLF sequence because
the header is composed of two rows, than the header of the report
is not. ok
try this sample :
- Code: Select all Expand view RUN
#include "FiveWin.ch"
#include "XBrowse.ch"
*-----------------------------------------------------------------------------------------------------------------------
Function Main()
*-----------------------------------------------------------------------------------------------------------------------
local oWnd
local oBrw
local oCol
local CUSTOMER := cGetNewAlias( "CUSTOMER" )
*--------------------------------------------------------------------------------------------------------------------
*- Apertura files
*--------------------------------------------------------------------------------------------------------------------
USE Customer NEW ALIAS CUSTOMER SHARED
DEFINE WINDOW oWnd
@ 0, 0 XBROWSE oBrw OF oWnd ALIAS CUSTOMER CELL LINES NOBORDER
oBrw:lFastEdit := .T.
oBrw:lAutoAppend := .T.
oBrw:lGetBar := .T.
oBrw:bPastEof := { || AppendRow( oBrw ) }
oCol := oBrw:AddCol()
oCol:bStrData := FIELDWBLOCK("FIRST", select(CUSTOMER))
oCol:bEditValue := FIELDWBLOCK("FIRST", select(CUSTOMER))
oCol:cHeader := "Cognome"
oCol:nEditType := EDIT_GET
oCol:uBarGetVal := uValBlank( fieldGet( fieldpos("FIRST") ) )
oCol:cBarGetPic := "@!"
oCol:cEditPicture := oCol:cBarGetPic
oCol:nDataStyle := oCol:DefStyle( AL_LEFT, .T.)
oCol:bOnPostEdit := { | oCol, xVal, nKey | If( RecCount() == 0, ( DbAppend(), oBrw:Refresh() ),), If( nKey == VK_RETURN, Customer->First := xVal,) }
oCol := oBrw:AddCol()
oCol:bStrData := FIELDWBLOCK("LAST", select(CUSTOMER))
oCol:bEditValue := FIELDWBLOCK("LAST", select(CUSTOMER))
oCol:cHeader := "Nome"
oCol:nEditType := EDIT_GET_BUTTON
oCol:uBarGetVal := uValBlank( fieldGet( fieldpos("LAST") ) )
oCol:cBarGetPic := "@!"
oCol:cEditPicture := oCol:cBarGetPic
oCol:nDataStyle := oCol:DefStyle( AL_LEFT, .T.)
oCol:bOnPostEdit := { | oCol, xVal, nKey | If( RecCount() == 0, DbAppend(),), If( nKey == VK_RETURN, ( Customer->Last := xVal, DbAppend(), oBrw:Refresh() ),) }
oCol := oBrw:AddCol()
oCol:bStrData := {|| if(CUSTOMER->MARRIED, "Sposato", "Nubile")}
oCol:bEditValue := FIELDWBLOCK("MARRIED", select(CUSTOMER))
oCol:cHeader := "Sposato/a" + CRLF + "Nubile"
oCol:nEditType := EDIT_LISTBOX
oCol:aEditListTxt := { "Sposato/a", "Nubile"}
oCol:aEditListBound := { .T., .F. }
oCol:nDataStyle := oCol:DefStyle( AL_LEFT, .T.)
oCol:bOnPostEdit := { | oCol, xVal, nKey | If( RecCount() == 0, ( DbAppend(), oBrw:Refresh() ),), If( nKey == VK_RETURN, Customer->Married := xVal,) }
oCol := oBrw:AddCol()
oCol:bStrData := FIELDWBLOCK("AGE", select(CUSTOMER))
oCol:bEditValue := FIELDWBLOCK("AGE", select(CUSTOMER))
oCol:cHeader := "Età"
oCol:nEditType := EDIT_GET
oCol:uBarGetVal := uValBlank( fieldGet( fieldpos("AGE") ) )
oCol:cBarGetPic := NumPict( FieldLen( fieldpos("AGE") ) + 1, FieldDec( fieldpos("AGE") ) )
oCol:cEditPicture := oCol:cBarGetPic
oCol:nDataStyle := oCol:DefStyle( AL_RIGHT, .T.)
oCol:bOnPostEdit := { | oCol, xVal, nKey | If( RecCount() == 0, ( DbAppend(), oBrw:Refresh() ),), If( nKey == VK_RETURN, Customer->Age := xVal,) }
oCol:cGrpHdr := "Test"
oCol := oBrw:AddCol()
oCol:bStrData := FIELDWBLOCK("SALARY", select(CUSTOMER))
oCol:bEditValue := FIELDWBLOCK("SALARY", select(CUSTOMER))
oCol:cHeader := "Salario" + CRLF + "mensile"
oCol:nEditType := EDIT_GET
oCol:uBarGetVal := uValBlank( fieldGet( fieldpos("SALARY") ) )
oCol:cBarGetPic := NumPict( FieldLen( fieldpos("SALARY") ) + 1, FieldDec( fieldpos("SALARY") ) )
oCol:cEditPicture := oCol:cBarGetPic
oCol:nDataStyle := oCol:DefStyle( AL_RIGHT, .T.)
oCol:bOnPostEdit := { | oCol, xVal, nKey | If( RecCount() == 0, ( DbAppend(), oBrw:Refresh() ),), If( nKey == VK_RETURN, Customer->Salary := xVal,) }
oCol:cGrpHdr := "Test"
oBrw:CreateFromCode()
oWnd:oClient := oBrw
ACTIVATE WINDOW oWnd VALID ( CUSTOMER->(dbCloseArea()) , .T. )
return nil
*-------------------------------------------------------------------------------------------------
Static function AppendRow( oBrw )
*-------------------------------------------------------------------------------------------------
* CUSTOMER->(dbappend())
* oBrw:GoBottom()
* oBrw:refresh()
oBrw:report()
return nil
thanks