To All
Is it possible to select ONLY the fields you wish xBrowse report to Print and also get a total number of records ?
Thanks
Rick Lipkin
#include "fivewin.ch"
#include "report.ch"
function Main()
local oDlg, oBrw, oCn, oRs
oCn := FW_OpenAdoConnection( "xbrtest.mdb" )
oRs := FW_OpenRecordSet( oCn, "customer" )
DEFINE DIALOG oDlg SIZE 500,300 PIXEL TRUEPIXEL
@ 60,20 XBROWSE oBrw SIZE -20,-20 PIXEL OF oDlg ;
DATASOURCE oRs COLUMNS "First", "City", "Age" ;
CELL LINES NOBORDER
oBrw:CreateFromCode()
@ 20,20 BUTTON "REPORT" SIZE 80,30 PIXEL OF oDlg ;
ACTION oBrw:Report( nil, nil, nil, { |oRep,brw| MyReportSetup( oRep, brw ) } )
ACTIVATE DIALOG oDlg CENTERED
oRs:Close()
oCn:Close()
return nil
//----------------------------------------------------------------------------//
function MyReportSetup( oRep, oBrw )
local oRs := oBrw:oRs
local cLines := cValToChar( oBrw:nLen ) + " lines"
COLUMN TITLE "First Name" DATA oRs:Fields( "First" ):Value SIZE 25
COLUMN TITLE "Street" DATA oRs:Fields( "Street" ):Value SIZE 25
COLUMN TITLE "City" DATA oBrw:City:Value SIZE 25
COLUMN TITLE "Salary" DATA oRs:Fields( "salary" ):Value PICTURE "999,999.99" TOTAL
oRep:bPostEnd := { || oRep:Say( 1, cLines ) }
return .t.
// return .t. means xbrowse should not add columns
//----------------------------------------------------------------------------//
COLUMN TITLE "First Name" DATA oRs:Fields( "First" ):Value SIZE 25
METHOD Report( cTitle, lPreview, lModal, bSetUp, aGroupBy, cPDF )
oBrw:nLen
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 94 guests