Table of Contents

Method ReplacePlaceholders

Namespace
DocWright.Formats.Xlsx
Assembly
DocWright.Formats.Xlsx.dll

ReplacePlaceholders(IReadOnlyDictionary<string, object?>, XlsxPlaceholderOptions?)

Fills the placeholders in the workbook's text cells from a dictionary. See ReplacePlaceholders(IReadOnlyDictionary<string, object?>, XlsxPlaceholderOptions?).

public XlsxPlaceholderResult ReplacePlaceholders(IReadOnlyDictionary<string, object?> values, XlsxPlaceholderOptions? options = null)

Parameters

values IReadOnlyDictionary<string, object>

The value for each name.

options XlsxPlaceholderOptions

How placeholders are written and filled, or null for the defaults.

Returns

XlsxPlaceholderResult

How many were replaced, which names were and were not resolved, and the cells that could not be changed.

Exceptions

ArgumentNullException

values is null.

ArgumentException

The prefix or the suffix is empty.

InvalidDocumentException

A name has no key and the options say to throw (DXP1004); or a sheet's part is malformed.