java.lang.Objectcom.aspose.words.FieldFormat
public class FieldFormat
Example:
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
Field field = builder.insertField("MERGEFIELD Date");
FieldFormat format = field.getFormat();
format.setDateTimeFormat("dddd, MMMM dd, yyyy");
format.setNumericFormat("0.#");
format.getGeneralFormats().add(GeneralFormat.CHAR_FORMAT);
Property Getters/Setters Summary | ||
---|---|---|
java.lang.String | getDateTimeFormat() | |
void | setDateTimeFormat(java.lang.String value) | |
Gets or sets a formatting that is applied to a date and time field result. Corresponds to the \@ switch. | ||
GeneralFormatCollection | getGeneralFormats() | |
Gets a collection of general formats that are applied to a numeric, text or any field result. Corresponds to the \* switches. | ||
java.lang.String | getNumericFormat() | |
void | setNumericFormat(java.lang.String value) | |
Gets or sets a formatting that is applied to a numeric field result. Corresponds to the \# switch. |
Property Getters/Setters Detail |
---|
getDateTimeFormat/setDateTimeFormat | |
public java.lang.String getDateTimeFormat() / public void setDateTimeFormat(java.lang.String value) |
Example:
Shows how to formatting fieldsDocument doc = new Document(); DocumentBuilder builder = new DocumentBuilder(doc); Field field = builder.insertField("MERGEFIELD Date"); FieldFormat format = field.getFormat(); format.setDateTimeFormat("dddd, MMMM dd, yyyy"); format.setNumericFormat("0.#"); format.getGeneralFormats().add(GeneralFormat.CHAR_FORMAT);
getGeneralFormats | |
public GeneralFormatCollection getGeneralFormats() |
Example:
Shows how to formatting fieldsDocument doc = new Document(); DocumentBuilder builder = new DocumentBuilder(doc); Field field = builder.insertField("MERGEFIELD Date"); FieldFormat format = field.getFormat(); format.setDateTimeFormat("dddd, MMMM dd, yyyy"); format.setNumericFormat("0.#"); format.getGeneralFormats().add(GeneralFormat.CHAR_FORMAT);
getNumericFormat/setNumericFormat | |
public java.lang.String getNumericFormat() / public void setNumericFormat(java.lang.String value) |
Example:
Shows how to formatting fieldsDocument doc = new Document(); DocumentBuilder builder = new DocumentBuilder(doc); Field field = builder.insertField("MERGEFIELD Date"); FieldFormat format = field.getFormat(); format.setDateTimeFormat("dddd, MMMM dd, yyyy"); format.setNumericFormat("0.#"); format.getGeneralFormats().add(GeneralFormat.CHAR_FORMAT);