FWMsExcelXlsx
FWMsExcelXlsx():New()Prepares tabular export data.
Overview
Generates XLSX through a legacy-like API but requires binary 17.3.0.0+, printer.exe 2.1.0+ and LIB 20201009+. GetXMLFile keeps its compatibility name while writing XLSX. The official TOTVS repository reference confirms construction, activation and cleanup. This example prepares data without writing. Large volumes need evaluation of SetWriteinFile/SetWriteinDB; similar APIs do not make every method/style interchangeable. (Sources: refs. 1–2.)
Syntax
FWMsExcelXlsx():New()Methods
AddWorkSheet / AddTableCreates sheet and table; one table per sheet.o:AddWorkSheet(cSheet) / o:AddTable(cSheet,cTable)
AddColumn / AddRowDefines columns and appends values in matching order.o:AddColumn(cSheet,cTable,cColumn,nAlign,nFormat,lTotal) / o:AddRow(cSheet,cTable,aRow)
Activate / GetXMLFile / DeActivateGeneration lifecycle; not executed in this example.o:Activate() / o:GetXMLFile(cFile) / o:DeActivate()
Commented example
#Include "Protheus.ch"
User Function Ed439()
Local oSheet := FWMsExcelXlsx():New()
// Prepare data only; no Activate or GetXMLFile.
oSheet:AddWorkSheet("Review")
oSheet:AddTable("Review","Example")
oSheet:AddColumn("Review","Example","Quantity",3,2,.F.)
oSheet:AddRow("Review","Example",{2})
FreeObj(oSheet)
Return NilFictional data prepared in memory and object freed; no file generated. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.
- Check LIB version, lifecycle and context before integration. These methods are a documented subset rather than the complete API.
- Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Comments
There are no approved comments yet.
Sign in with Google or Microsoft to comment.