Skip to content
jsf2xlsx

ToXlsxOptions

type ToXlsxOptions = {
application?: string;
appVersion?: string;
calculated?: boolean;
resolveMdw?: MdwResolver;
warn?: (message: string) => void;
};

Options accepted by toXlsx.

PropertyTypeDescription
application?stringValue emitted as the Application property in docProps/app.xml. Defaults to GRID. A surrounding application that uses Apiary as a library can pass its own product name here.
appVersion?stringValue emitted as the AppVersion property in docProps/app.xml. Excel writes this as <major>.<minor><patch> (e.g. 16.0300); callers using this from Apiary should pass the Apiary version. Defaults to 16.0.300 when not supplied.
calculated?booleanWhether the caller has fully recalculated the workbook’s formula values before exporting. When false, the workbook is written with fullCalcOnLoad="1" so Excel will recalculate everything on open instead of trusting the saved values. When true or omitted, Excel trusts the values present in the workbook (the OOXML default).
resolveMdw?MdwResolverResolve the Max Digit Width (in pixels) for the workbook’s Normal font, used to convert column widths between pixels and OOXML character units. Returning null/undefined defers to the built-in table (Aptos Narrow, Calibri, Arial); unknown fonts then fall back to MDW 6 (and warn). Supply this to size columns correctly for fonts outside the table.
warn?(message: string) => voidWarning callback. If provided, non-fatal issues (e.g. an unknown Normal font for column-width conversion) are passed here; otherwise they are silently discarded.