The Say() is only required for generating Xlsx files.
At last, I’ve achieved the capability to transform all Harbour variables into Xlsx format. However, I’ve gone beyond the limitations of specific variable types and developed a robust feature that allows the creation of Xlsx files using just the say() method.
METHOD Say( nRow, nCol, uVal, nAlign, cFormat ) automatically handles all the methods listed below:
- METHOD WriteString( nRow, nCol, cString, nAlign )
- METHOD WriteNumber( nRow, nCol, nNumber, nAlign, cFormat )
- METHOD WriteDate( nRow, nCol, dDate, nAlign, cFormat )
- METHOD WriteDatetime( nRow, nCol, dDate, nAlign, cFormat )
- METHOD WriteLogical( nRow, nCol, lLogical, nAlign )
Say test
FUNCTION Saytest()
LOCAL oXlsx := TDrXlsx():New()
LOCAL dtTest := hb_DateTime( 2023, 8, 23, 20, 04, 30 )
oXlsx:CreateFile("say.xlsx")
oXlsx:SetColumnSize(0, 0, 30)
oXlsx:SetColumnSize(0, 1, 30)
oXlsx:Say(0,0,"Valtype")
oXlsx:Say(0,1,"Value")
oXlsx:Say(1,0,"Character")
oXlsx:Say(2,0,"Numeric")
oXlsx:Say(3,0,"Date" )
oXlsx:Say(4,0,"Logic" )
oXlsx:Say(5,0,"Datetime format" )
oXlsx:Say(6,0,"Datetime" )
oXlsx:Say(1,1,"Hello")
oXlsx:Say(2,1,1234)
oXlsx:Say(3,1, DATE() )
oXlsx:Say(4,1, .T. )
oXlsx:Say(5,1, dtTest,, "yyyy-mm-dd hh:mm:ss")
oXlsx:Say(6,1, dtTest )
oXlsx:Close()
RETURN NIL
by Charles KWON