Problem GetBar and Report in Xbrowse

Problem GetBar and Report in Xbrowse

Postby mauri.menabue » Mon Jun 12, 2017 10:13 pm

Hi All

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

#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
User avatar
mauri.menabue
 
Posts: 155
Joined: Thu Apr 17, 2008 2:38 pm

Re: Problem GetBar and Report in Xbrowse

Postby nageswaragunupudi » Wed Jun 14, 2017 7:01 am

<quote>
When in xbrowse two columns belong at same Group headers the position of get in getbar is not ok.
</quote>

This was a problem in earliest versions, but fixed very soon later.

Image

<quote>
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
</quote>
That is the because of the behavior of Report object. Column header of report is not split at CRLF like in XBrowse.

However, in FWH version 17.06, xbrowse splits the column header at CRLF and builds the report column object with the split header.

FWH 17.06 also implemented Group Headers for reports.

Image
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10632
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 101 guests