I have dbf:
I would like to browse receive the following:
I tried to use oBrw:invoice:lMergeVert := .t. ... but how to group the column total as a rule column invoice?
Regards,
Miloš
#include "FiveWin.Ch"
#include "xbrowse.ch"
//----------------------------------------------------------------------------//
REQUEST DBFCDX
//----------------------------------------------------------------------------//
function Main()
local oDlg, oFont, oBrw
CreateTestDBF()
USE TEST
SET ORDER TO TAG INVOICE
GO TOP
DEFINE FONT oFont NAME "Segoe UI" SIZE 0,-14
DEFINE DIALOG oDlg SIZE 500,250 PIXEL FONT oFont
@ 10,10 XBROWSE oBrw SIZE -10,-10 PIXEL OF oDlg DATASOURCE "TEST" ;
COLUMNS "INVOICE", "INVOICE", "DATEPAY", "PAYMENT" ;
HEADERS "INVOICE", "TOTAL", "DATEPAY", "PAYMENT" ;
CELL LINES NOBORDER
WITH OBJECT oBrw
:nStretchCol := 1
:Invoice:lMergeVert := .t.
WITH OBJECT :Total
:lMergeVert := .t.
:bStrData := { || TRANSFORM( TEST->TOTAL, NumPict( 10, 2 ) ) }
:nDataStrAlign := AL_RIGHT
:nHeadStrAlign := AL_RIGHT
:cSortOrder := ""
END
//
:CreateFromCode()
END
ACTIVATE DIALOG oDlg CENTERED
RELEASE FONT oFont
return (0)
//----------------------------------------------------------------------------//
static function CreateTestDBF()
field INVOICE
if ! File( "TEST.DBF" )
DbCreate( "TEST", { ;
{ "INVOICE", 'C', 3, 0 }, ;
{ "TOTAL", 'N', 10, 2 }, ;
{ "DATEPAY", 'D', 8, 0 }, ;
{ "PAYMENT", 'N', 10, 2 } }, "DBFCDX", .t., "TEST" )
FW_ArrayToDBF( { ;
{ "101", 1000, {^ 2014/05/01 }, 500 }, ;
{ "101", 1000, {^ 2014/05/05 }, 500 }, ;
{ "101", 1000, {^ 2014/05/05 }, 100 }, ;
{ "102", 1000, {^ 2014/05/10 }, 300 }, ;
{ "102", 1000, {^ 2014/05/15 }, 600 }, ;
{ "103", 2000, {^ 2014/05/15 }, 1000 } } )
INDEX ON INVOICE TAG INVOICE
CLOSE DATA
endif
return nil
//----------------------------------------------------------------------------//
init procedure PrgInit
SET DATE GERMAN
SET CENTURY ON
SET DELETED ON
SET EXCLUSIVE OFF
RDDSETDEFAULT( "DBFCDX" )
XbrNumFormat( 'E', .t. )
return
//----------------------------------------------------------------------------//
Please make sure "customer.dbf" is in the same folder.
cd\fwh\samples
buildh xbrwtree
or
buildx xbrwtree
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 59 guests