StiJsonDatabase creates all columns as String type (No automatic type inference)

Stimulsoft Reports.JAVA discussion
Post Reply
Shevek
Posts: 2
Joined: Thu Aug 07, 2025 7:34 am

StiJsonDatabase creates all columns as String type (No automatic type inference)

Post by Shevek »

Hello,

I am using Stimulsoft Reports.Java (version 2025.4.1) and I have encountered an issue regarding JSON data sources.

When I add a StiJsonDatabase programmatically and generate the data sources, the engine creates all columns with StiSystemType.String, regardless of the actual data type in the JSON (Integer, Boolean, etc.).

Here is a simplified version of my code:

Code: Select all

StiJsonDatabase jsonDatabase = new StiJsonDatabase();
jsonDatabase.setName("MyDatabase");
jsonDatabase.setJsonData(jsonString); // e.g. [{"id": 100, "isActive": true, "amount": 50.5}]

dictionary.getDatabases().add(jsonDatabase);

// This generates the datasources and columns
jsonDatabase.createDataSources(dictionary);
The Issue:
After calling createDataSources(), if I inspect the generated columns in the dictionary:

id is created as System.String (Expected: Int32 or Int64)
isActive is created as System.String (Expected: Boolean)
amount is created as System.String (Expected: Decimal or Double)
I have checked StiBaseOptions.getDefaultJsonConverterVersion() and it is using ConverterV2. I also tested with ConverterV1, but the result is the same.

My Current Workaround:
Currently, I have to manually parse the JSON using an external library (Jackson), infer the types myself by analyzing the data, and then loop through the Stimulsoft DataSource columns to manually set column.setSystemType(...).

Question:
Is there a native way, a specific option, or a method in the Java engine to enable automatic type inference for JSON datasources? It seems the .NET version handles this, but the Java version defaults everything to String.

Any suggestions would be appreciated.

Thanks.
Vadim
Posts: 436
Joined: Tue Apr 23, 2013 11:23 am

Re: StiJsonDatabase creates all columns as String type (No automatic type inference)

Post by Vadim »

Hello

We will add automatic type inference for JSON datasources (as far as possible) from next version
Shevek
Posts: 2
Joined: Thu Aug 07, 2025 7:34 am

Re: StiJsonDatabase creates all columns as String type (No automatic type inference)

Post by Shevek »

Thank you for confirming that automatic type inference will be added in the next version. That's great news!
In the meantime, is there a native approach or workaround within the current version (2025.4.1) to handle this issue more efficiently? For example, a configuration option or a method I might have overlooked?
I appreciate any suggestions you might have.
Thanks again for your help!
Vadim
Posts: 436
Joined: Tue Apr 23, 2013 11:23 am

Re: StiJsonDatabase creates all columns as String type (No automatic type inference)

Post by Vadim »

Hello

There is no way, this feature will available only in the next version.
borax1974
Posts: 13
Joined: Mon Dec 08, 2025 3:26 pm

Re: StiJsonDatabase creates all columns as String type (No automatic type inference)

Post by borax1974 »

I upgraded my version to 2026.1.1 as I also need this functionaly. But I have a problem with date fields. What should be the format of the date and datetime fields? The datatypes are detected correctly but there is no data displayed on the report? I used the below formats

"dateSample": "1984-02-19",
"dateTimeSample": "2024-12-17 11:35:00"
Vadim
Posts: 436
Joined: Tue Apr 23, 2013 11:23 am

Re: StiJsonDatabase creates all columns as String type (No automatic type inference)

Post by Vadim »

borax1974 wrote: Thu Jan 08, 2026 2:15 pm I upgraded my version to 2026.1.1 as I also need this functionaly. But I have a problem with date fields. What should be the format of the date and datetime fields? The datatypes are detected correctly but there is no data displayed on the report? I used the below formats

"dateSample": "1984-02-19",
"dateTimeSample": "2024-12-17 11:35:00"
Hello

Your data parsed correctly, please send us JSON sample to reproduce problem
Screenshot 2026-01-09 152220.png
Screenshot 2026-01-09 152220.png (56.39 KiB) Viewed 35 times
Post Reply