replaceTableVariable
- 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
replaceTableVariable
BASIC / ADVANCED / PREMIUM
Replaces a group of variables within a set of table rows.
Description
public void replaceTableVariable(ArrayList<HashMap<String, ?>> variables)
public void replaceTableVariable(ArrayList<HashMap<String, ?>> variables, OptionsReplaceTableVariable options)
This method is designed to generate a Word table with an, a priori, indetermined number of rows.
Parameters
vars
This has to be an ArraList of HashMap. The keys of the associative array should match the names of the variables that you want to replace by their corresponding values (text strings or WordFragments).
options
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 ocurrence 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. |