Page 1 of 1

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

Posted: Mon Nov 24, 2025 8:30 am
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.

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

Posted: Tue Nov 25, 2025 11:56 am
by Vadim
Hello

We will add automatic type inference for JSON datasources (as far as possible) from next version

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

Posted: Mon Dec 01, 2025 12:05 pm
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!

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

Posted: Tue Dec 02, 2025 10:33 am
by Vadim
Hello

There is no way, this feature will available only in the next version.

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

Posted: Thu Jan 08, 2026 2:15 pm
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"

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

Posted: Fri Jan 09, 2026 12:25 pm
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 44 times