TPrinter: Recommended way to print zebra line effect
Posted: Tue Apr 30, 2019 5:08 am
What's the recommended way to print with zebra line effect for reports that have many columns?
TIA
TIA
www.FiveTechSoft.com
https://fivetechsoft.com/forums/
Code: Select all
function PrintZebra
local oPrn, oFont, oBrushColor, oBrush
local nRow
USE STATES
PRINT oPrn PREVIEW
DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-12 OF oPrn
DEFINE BRUSH oBrushColor COLOR CLR_HGRAY
PAGE
nRow := 1.0
do while STATES->( RECNO() ) < 15 .and. !STATES->( Eof() )
@ nRow, 1.0 PRINT TO oPrn TEXT STATES->CODE SIZE 1.0, 0.3 INCHES ALIGN "L" FONT oFont COLOR CLR_BLACK, oBrush
@ nRow, 2.0 PRINT TO oPrn TEXT STATES->NAME SIZE 3.0, 0.3 INCHES ALIGN "L" FONT oFont COLOR CLR_BLACK, oBrush
nRow += 0.3
oBrush := If( oBrush == nil, oBrushColor, nil )
STATES->( DbSkip( 1 ) )
enddo
ENDPAGE
ENDPRINT
RELEASE FONT oFont
RELEASE BRUSH oBrushColor
return nil