I would like to know :-
1) Whether Column totals can be implemented and how?. As per the following example code, Column total of Salary
2)Can column total be implemented for Salary as Page total on every page's bottom line and also at the end of the report.
3) Is it possible to have an additional column "Sr.No" (which is not from the DBF ) ie at each line first column contains count of report line as 1, 2, 3 etc
For Example:
- Code: Select all Expand view
-----------------------------------
Sr.No Name Salary
-----------------------------------
1 Mr.xxxxx 10,000
2 Mr.yyyyy 8,000
3 Mr.zzzzzz 10,000
4 Mr.aaaaa 5,000
----------------------------------
Total 33,000
- Code: Select all Expand view
#include 'fivewin.ch'
#include 'xbrowse.ch'
#include 'report.ch'
REQUEST DBFCDX
function Main()
local oWnd, oBrw, oBar, oPrnFont
USE CUSTOMER NEW ALIAS CUST SHARED VIA 'DBFCDX'
DEFINE WINDOW oWnd
@ 0,0 XBROWSE oBrw OF oWnd
oBrw:CreateFromCode()
oWnd:oClient := oBrw
DEFINE BUTTONBAR oBar OF oWnd SIZE 80,32 2007
DEFINE BUTTON OF oBar PROMPT 'Print' ;
ACTION oBrw:Report( 'TestReport', , , ;
{ |oRep, oBrw, oFont| MySetUp( oRep, oBrw, @oPrnFont ) } )
ACTIVATE WINDOW oWnd
RELEASE FONT oPrnFont
return nil
static function MySetUp( oRep, oBrw, oFont )
DEFINE FONT oFont NAME 'ARIAL NARROW' SIZE 0,-9 OF oRep:oDevice
oRep:aFont[ 1 ] := oFont
COLUMN DATA CUST->First,CUST->Last,'' ;
TITLE 'Name','','' SIZE 20
COLUMN DATA CUST->STREET,CUST->ZIP ;
TITLE 'Address','' SIZE 30
COLUMN DATA CUST->City,CUST->State,'' ;
TITLE 'City','State','' SIZE 20
COLUMN DATA CUST->HIREDATE, ;
If( CUST->Married, 'Married','Single' ) ;
TITLE 'HireDate','Status' ;
SIZE 10
COLUMN DATA CUST->Salary, CUST->Age ;
PICTURE '999,999,999' ;
TOTAL ;
TITLE 'Salary','Age'
return .t.
Thanks & Regards
Anser