Usina BRAdvPL Guide
Sign in
← All topics
PRACTICAL GUIDEUnder review

SetWriteinDB

oExcel:SetWriteinDB(lWriteinDb,[nLimit]) -> lEnabled

Configures auxiliary storage for XLSX generation.

SetWriteinDBAdvPL
01 · OVERVIEW

Overview

SetWriteinDB is an FWMsExcelXlsx method, not a global business-table writer. Requires LIB 20230227+, DBAccess 22.1.1.0+ and a prepared environment. Call it before AddRow. The default 200000 limit concerns auxiliary bulk records/cells, not spreadsheet rows. Lower memory use adds database/performance cost; SQLite inserts individually. Check its Boolean return: .F. can leave processing in memory. (Sources: refs. 1–1.)

02 · SYNTAX

Syntax

oExcel:SetWriteinDB(lWriteinDb,[nLimit]) -> lEnabled

Parameters

lWriteinDb
LogicalRequired

.T. enables the feature.

nLimit
NumericOptional

Auxiliary-cell bulk limit; default 200000.

Return value

Logical: whether the feature was enabled.

03 · PRACTICAL EXAMPLE

Commented example

#Include "Protheus.ch"

User Function Ed663(oExcel)
// Fragment: oExcel is FWMsExcelXlsx; environment already prepared.
Local lEnabled
// Configure before any AddRow; check fallback.
lEnabled := oExcel:SetWriteinDB(.T.,200000)
If !lEnabled
    ConOut("Auxiliary data will remain in memory")
EndIf
Return Nil
Expected result

Requests auxiliary database mode and reports failure; this subset neither generates XLSX nor changes master data. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

BEST PRACTICES
  • Size memory/database capacity using real volumes. Do not assume database mode without checking .T.
  • Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Related content

REFERENCES
  1. TOTVS. FWMsExcelXlsx — SetWriteinDB. Requisitos e fallback. Accessed on 2026-10-28.
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