Usina BRAdvPL Guide
Sign in
← All topics
CLASSUnder review

FWMsExcelXlsx

FWMsExcelXlsx():New()

Prepares tabular export data.

FWMsExcelXlsxAdvPL
01 · OVERVIEW

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.)

02 · SYNTAX

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()
03 · PRACTICAL EXAMPLE

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 Nil
Expected result

Fictional 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.

BEST PRACTICES
  • 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.

Related content

REFERENCES
  1. TOTVS. FWMsExcelXlsx. TDN. Accessed on 2026-10-27.
  2. TOTVS/engpro-advpl-tlpp-skills. Referência de API FwMsExcelXlsx, commit 41504805e419b72232885f7575d54dfd573fea1b. Referência analisada. Accessed on 2026-10-27.
Status
Under review
Page created on
Last reviewed on
Original language
Portuguese
Reviewed by
Usina.BR
0 approved comment(s)

Comments

There are no approved comments yet.

Sign in with Google or Microsoft to comment.

Powered by Usina Docs · Alpha