public class WordTemplateGenerator extends AbstractTemplateGenerator
| Modifier and Type | Field and Description |
|---|---|
static boolean |
deleteBookmarks
Variable to use when you want to keep the boorkmarks in the document
after write the data in the template.
|
static boolean |
highlightBookmarksInTemplate
Variable used to highlight the bookmarks when a new template is created.
|
protected boolean |
showTemplate |
createLabelsInTemplate, dateFormat, numberFormat| Constructor and Description |
|---|
WordTemplateGenerator() |
| Modifier and Type | Method and Description |
|---|---|
protected static void |
addFieldGroupToDataString(Hashtable group,
StringBuffer buffer,
DateFormat df,
String delimiter) |
protected static String |
createFieldDataString(Hashtable data,
String delimiter,
DateFormat df) |
protected static String |
createFieldsInGroups(Hashtable data,
String delimiter,
String groupDelimiter,
DateFormat df)
Create an String with the information of the fields to put in the
template.
|
File |
createTemplate(Hashtable fieldValues,
Hashtable valuesTable,
Hashtable valuesImages)
The
WordTemplateGenerator adds the possibility to put the fields
in the template in a specified order. |
File |
fillDocument(InputStream input,
String nameFile,
Hashtable fieldValues,
Hashtable valuesTable,
Hashtable valuesImages,
Hashtable valuesPivotTable) |
List |
queryTemplateFields(File template)
Creates a list with all data fields included in the template
|
List |
queryTemplateFields(String template)
Creates a list with all data fields included in the template
|
void |
setScriptFillDocPath(String path)
Sets the file path for the fill document script.
|
void |
setShowTemplate(boolean show)
Sets the value of the variable show.
|
calculateRecordCount, containsHashtableValue, createFileFieldData, createImageDataFile, createTableDataDefinition, createTableDataDefinition, createTableDataFile, createTableDataFile, exportFieldData, exportFieldData, exportTableData, fillDocument, fillDocument, fillDocument, getKeysOrder, getScreenPoints, parseNumber, savePngImageFile, setCreateLabelsInTemplate, setDateFormat, setNumberFormat, transformFieldData, transformFieldDatapublic static boolean highlightBookmarksInTemplate
public static boolean deleteBookmarks
protected boolean showTemplate
public File fillDocument(InputStream input, String nameFile, Hashtable fieldValues, Hashtable valuesTable, Hashtable valuesImages, Hashtable valuesPivotTable) throws Exception
Exceptionpublic List queryTemplateFields(File template) throws Exception
TemplateGeneratortemplate - Template to queryExceptionpublic List queryTemplateFields(String template) throws Exception
TemplateGeneratortemplate - Template to queryExceptionpublic void setScriptFillDocPath(String path)
path - public void setShowTemplate(boolean show)
TemplateGeneratorpublic File createTemplate(Hashtable fieldValues, Hashtable valuesTable, Hashtable valuesImages)
WordTemplateGenerator adds the possibility to put the fields
in the template in a specified order.fieldValues can be a EntityResult
object, and use the EntityResult.setColumnOrder(List) method to
specified the order of the fields in the template.fieldValues parameter is a Hashtable
(or EntityResult) then the fields in this hashtable will be in a group in
the template and the title will be the key of this hashtable in the
parameter fieldValuesfieldValues - : This object contains the data fields attributes and labels
to show in the templatevaluesTable - : The object contains the table information to insert in the
template. This map must have the table entity name as key and
the value must be other Hashtable with the columns attributes
and names to show (column name - column label)valuesImages - : The object contains information about the image fields which
owns the form. This map contains the name of the image field
(value) and its attribute (key)protected static String createFieldDataString(Hashtable data, String delimiter, DateFormat df)
protected static String createFieldsInGroups(Hashtable data, String delimiter, String groupDelimiter, DateFormat df)
data - delimiter - groupDelimiter - df - protected static void addFieldGroupToDataString(Hashtable group, StringBuffer buffer, DateFormat df, String delimiter)
Copyright © 2016 Imatia Innovation S.L.. All rights reserved.