replaceListVariable
- addBackgroundImage
- addFooter
- addHeader
- addLineNumbering
- addPageBorders
- addProperties
- addSection
- createDocx
- createCharacterStyle
- createListStyle
- createParagraphStyle
- createTableStyle
- docxSettings
- embedFont
- importHeadersAndFooters
- importStyles
- modifyPageLayout
- removeFooters
- removeHeaders
- setBackgroundColor
- setDefaultFont
- setDocumentDefaultStyles
- setEncodeUTF8
- setLanguage
- setMarkAsFinal
- setRTL
- addBibliography
- addBookmark
- addBreak
- addChart
- addCitation
- addComment
- addCrossReference
- addDateAndHour
- addEndnote
- addExternalFile
- addFootnote
- addFormElement
- addHeading
- addImage
- addLink
- addList
- addMathEquation
- addMergeField
- addOLE
- addPageNumber
- addShape
- addSimpleField
- addSource
- addStructuredDocumentTag
- addTable
- addTableContents
- addText
- addTextBox
- addWordML
- embedHTML
- clearBlocks
- deleteTemplateBlock
- getTemplateVariables
- getTemplateVariablesType
- modifyInputFields
- modifyMergeFields
- processTemplate
- removeTemplateVariable
- replaceListVariable
- replacePlaceholderImage
- replaceTableVariable
- replaceVariableByExternalFile
- replaceVariableByHtml
- replaceVariableByText
- replaceVariableByWordFragment
- replaceVariableByWordML
- setTemplateSymbol
- tickCheckbox
replaceListVariable
BASIC / ADVANCED / PREMIUM
Replaces a single variable within a list by a list of items.
Description
public void replaceListVariable(String variable, ArrayList listValues)
public void replaceListVariable(String variable, ArrayList listValues, OptionsReplaceListVariable options)
This method is designed to generate a Word list with an, a priori, indetermined number of items.
Parameters
variable
The name of the variable that you want to replace by a list of items.
listValues
An ArrayList with the values (WordFragments) you want to use to populate the list.
options
The possible keys and values of this array are:
Option | Type | Description |
---|---|---|
firstMatch | boolean | If the variable appears more than once within the Word document and firstMatch is set to true, Javadocx will only replace the first occurrence of the variable within the Word document. |
target | String | Possible values are: document (default), header, footer. This option sets the scope of the replacement procedure. |
parseLineBreaks | Boolean | If true (default is false) parses the line breaks to include them in the Word document. |
type | String | inline (default) or block; used by WordFragment values. |