java.lang.Object
com.aspose.words.JsonDataLoadOptions
public class JsonDataLoadOptions
To learn more, visit the LINQ Reporting Engine documentation article. Example:
Document doc = new Document(getMyDir() + "Reporting engine template - JSON data destination (Java).docx");
JsonDataLoadOptions options = new JsonDataLoadOptions();
{
options.setExactDateTimeParseFormats(Arrays.asList(new String[]{"MM/dd/yyyy", "MM.d.yy", "MM d yy"}));
}
JsonDataSource dataSource = new JsonDataSource(getMyDir() + "List of people.json", options);
buildReport(doc, dataSource, "persons");
doc.save(getArtifactsDir() + "ReportingEngine.JsonDataString.docx");
| Constructor Summary |
|---|
JsonDataLoadOptions()
Initializes a new instance of this class with default options. |
| Property Getters/Setters Summary | ||
|---|---|---|
boolean | getAlwaysGenerateRootObject() | |
void | setAlwaysGenerateRootObject(boolean value) | |
| Gets or sets a flag indicating whether a generated data source will always contain an object for a JSON root element. If a JSON root element contains a single complex property, such an object is not created by default. | ||
java.lang.Iterable<java.lang.String> | getExactDateTimeParseFormats() | |
void | setExactDateTimeParseFormats(java.lang.Iterable<java.lang.String> value) | |
Gets or sets exact formats for parsing JSON date-time values while loading JSON. The default is null.
|
||
boolean | getPreserveSpaces() | |
void | setPreserveSpaces(boolean value) | |
| Gets or sets a flag indicating whether leading and trailing spaces should be preserved when loading string values of JSON data. | ||
int | getSimpleValueParseMode() | |
void | setSimpleValueParseMode(int value) | |
|
Gets or sets a mode for parsing JSON simple values (null, boolean, number, integer, and string)
while loading JSON. Such a mode does not affect parsing of date-time values. The default is
|
||
| Constructor Detail |
|---|
public JsonDataLoadOptions()
Example:
Shows how to use JSON as a data source (string).
Document doc = new Document(getMyDir() + "Reporting engine template - JSON data destination (Java).docx");
JsonDataLoadOptions options = new JsonDataLoadOptions();
{
options.setExactDateTimeParseFormats(Arrays.asList(new String[]{"MM/dd/yyyy", "MM.d.yy", "MM d yy"}));
}
JsonDataSource dataSource = new JsonDataSource(getMyDir() + "List of people.json", options);
buildReport(doc, dataSource, "persons");
doc.save(getArtifactsDir() + "ReportingEngine.JsonDataString.docx");| Property Getters/Setters Detail |
|---|
getAlwaysGenerateRootObject/setAlwaysGenerateRootObject | |
public boolean getAlwaysGenerateRootObject() / public void setAlwaysGenerateRootObject(boolean value) | |
false.
Example:
Shows how to use JSON as a data source (string).
Document doc = new Document(getMyDir() + "Reporting engine template - JSON data destination (Java).docx");
JsonDataLoadOptions options = new JsonDataLoadOptions();
{
options.setExactDateTimeParseFormats(Arrays.asList(new String[]{"MM/dd/yyyy", "MM.d.yy", "MM d yy"}));
}
JsonDataSource dataSource = new JsonDataSource(getMyDir() + "List of people.json", options);
buildReport(doc, dataSource, "persons");
doc.save(getArtifactsDir() + "ReportingEngine.JsonDataString.docx");getExactDateTimeParseFormats/setExactDateTimeParseFormats | |
public java.lang.Iterable<java.lang.String> getExactDateTimeParseFormats() / public void setExactDateTimeParseFormats(java.lang.Iterable<java.lang.String> value) | |
null.
Strings encoded using Microsoft® JSON date-time format (for example, "/Date(1224043200000)/") are always recognized as date-time values regardless of a value of this property. The property defines additional formats to be used while parsing date-time values from strings in the following way:
null, the ISO-8601 format and all date-time formats
supported for the current, English USA, and English New Zealand cultures are used additionally in
the mentioned order.
Example:
Shows how to use JSON as a data source (string).
Document doc = new Document(getMyDir() + "Reporting engine template - JSON data destination (Java).docx");
JsonDataLoadOptions options = new JsonDataLoadOptions();
{
options.setExactDateTimeParseFormats(Arrays.asList(new String[]{"MM/dd/yyyy", "MM.d.yy", "MM d yy"}));
}
JsonDataSource dataSource = new JsonDataSource(getMyDir() + "List of people.json", options);
buildReport(doc, dataSource, "persons");
doc.save(getArtifactsDir() + "ReportingEngine.JsonDataString.docx");getPreserveSpaces/setPreserveSpaces | |
public boolean getPreserveSpaces() / public void setPreserveSpaces(boolean value) | |
false.
Example:
Shows how to use JSON as a data source (string).
Document doc = new Document(getMyDir() + "Reporting engine template - JSON data destination (Java).docx");
JsonDataLoadOptions options = new JsonDataLoadOptions();
{
options.setExactDateTimeParseFormats(Arrays.asList(new String[]{"MM/dd/yyyy", "MM.d.yy", "MM d yy"}));
}
JsonDataSource dataSource = new JsonDataSource(getMyDir() + "List of people.json", options);
buildReport(doc, dataSource, "persons");
doc.save(getArtifactsDir() + "ReportingEngine.JsonDataString.docx");getSimpleValueParseMode/setSimpleValueParseMode | |
public int getSimpleValueParseMode() / public void setSimpleValueParseMode(int value) | |
Example:
Shows how to use JSON as a data source (string).
Document doc = new Document(getMyDir() + "Reporting engine template - JSON data destination (Java).docx");
JsonDataLoadOptions options = new JsonDataLoadOptions();
{
options.setExactDateTimeParseFormats(Arrays.asList(new String[]{"MM/dd/yyyy", "MM.d.yy", "MM d yy"}));
}
JsonDataSource dataSource = new JsonDataSource(getMyDir() + "List of people.json", options);
buildReport(doc, dataSource, "persons");
doc.save(getArtifactsDir() + "ReportingEngine.JsonDataString.docx");