Free Support Forum -

Set JSON Simple Value Parse Mode to Strict | Avoid Formatting String of JsonDatasource as Number | LINQ Reporting Java


When using a JsonDatasource, which has some string properties, Aspose.Words is interpreting them as numbers and adding a redundant .0 at the end of some strings. This is strange and unwanted behavior. A string is a string and should be treated as such.

From left to right: JsonDatasource - Expected output - Current output

jsondatasource.png (40.7 KB)

Here is an example application: (43.5 KB)


We have logged this problem in our issue tracking system. Your ticket number is WORDSNET-22194. We will further look into the details of this problem and will keep you updated here on the status of the linked issue. We apologize for your inconvenience.


During further investigation, it turns out to be an expected behavior rather than a bug. Please use the following code to fix the issue on your end.

JsonDataLoadOptions options = new JsonDataLoadOptions();
JsonDataSource dataSource = new JsonDataSource(..., options);

Complete code is as follows:

Document doc = new Document("C:\\Temp\\example-jsondatasource\\itemJson.docx");
ReportingEngine engine = getReportingEngine();
JsonDataSource order = createOrderWithThreeOrderLines();
Object[] sources = new Object[]{order};
String[] names = new String[]{"o"};
engine.buildReport(doc, sources, names);"c:\\temp\\example-jsondatasource\\awjava-21.4.docx");

private static JsonDataSource createOrderWithThreeOrderLines() throws Exception {
    JsonDataLoadOptions options = new JsonDataLoadOptions();

    return new JsonDataSource("C:\\Temp\\example-jsondatasource\\JsonDatasource.json", options);

private static ReportingEngine getReportingEngine() {
    ReportingEngine engine = new ReportingEngine();
    return engine;

More details can be found at the end of the article here: Accessing JSON Data.

Perfect. Thanks for the quick help @awais.hafeez