Json Datasource not rendering children correctly

Stimulsoft Reports.WEB discussion
Post Reply
shadowkras
Posts: 27
Joined: Wed Jan 30, 2013 10:53 am
Location: Cuiabá/Mato Grosso - Brazil

Json Datasource not rendering children correctly

Post by shadowkras »

I have a strongly typed object that has four children Lists of their own respective types aswell.

Example:

Parent Environment
Children List<Trees>
Children List<Rivers>
Children List<Animals>

When serializing that object to json and checking on it on a json reader online, that structure is serialized correctly, a parent object with three children. But when i load that json file into stimul (using the web version), the single object instead changes, becomes multiple objects and it creates a relation that didn't exist before:

Environment
Environment_Trees
Environment_Rivers
Environment_Animals

Each children is assigned a key that connects them to their parent.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Json Datasource not rendering children correctly

Post by Alex K. »

Hello,

Yes, at the current moment, JSON is converted to the DataSet as relational database.
It is not possible use it as business object dou to specific working of the engine.

Thank you.
shadowkras
Posts: 27
Joined: Wed Jan 30, 2013 10:53 am
Location: Cuiabá/Mato Grosso - Brazil

Re: Json Datasource not rendering children correctly

Post by shadowkras »

Then, how could I convert that parent object into a dictionary using Stimulsoft.Reports.NetCore (version 2017.2.1)?
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Re: Json Datasource not rendering children correctly

Post by Edward »

Hi Shadowkras,

Please check the following post explaining basics and some sample project to demonstrate the common approach of working with the report data in both Asp.Net and Asp.Net Core:
viewtopic.php?t=55724
And if you still in doubt, please send us the test project that uses the objects you need to work with to support[at]stimulsoft.com
We could help you, in that case, to register that specific data to the report Dictionary.

Thank you,
Edward
shadowkras
Posts: 27
Joined: Wed Jan 30, 2013 10:53 am
Location: Cuiabá/Mato Grosso - Brazil

Re: Json Datasource not rendering children correctly

Post by shadowkras »

Hi, Edward. Thanks for the reply.

Sorry if I may be sounding blunt, but you should expect that, if I managed to get the designer to show up with data loaded from my server, I have been through those steps already. The data is being loaded into stimulsoft already. My problem is how stimulsoft is rendering objects that have children objects instead of properties. In any case, I checked the Managing Data project again (with your link) to see if anything related to the loading of data has changed (it hasn't). The example JSON files are all simple objects as well, so they don't help with my situation.

Alex said I cannot do that, and I asked how to, instead of creating a complex object, I could instead create a dictionary (a new group of datasets, on the designer's dictionary tab), because the StiReport class, which normally allows that on both c# and javascript versions, is not available on mvc core version of stimulreports. Since it's not available, I have no access to the RegData method.

So, instead of loading a single JSON object, I would like to know if I could load a single JSON file with multiple JSON objects that will create multiple dictionaries. Because otherwise, I would have to load multiple JSON files, creating a new dictionary from each file, which is not what I want to do. Is that possible in any form?
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Re: Json Datasource not rendering children correctly

Post by Edward »

Hi Shadowkras,

Sorry, I did not explain clearly. Please attach the sample JSON and we will suggest on how to register that specific JSON in the Dictionary in ASP.Net core. The simple example will eliminate any further misunderstanding.

Thank you,
Edward

test data
________________
NoCodigo.json
(9.84 KiB) Downloaded 213 times
JsonData.json
(28.94 KiB) Downloaded 210 times
[/color]
shadowkras
Posts: 27
Joined: Wed Jan 30, 2013 10:53 am
Location: Cuiabá/Mato Grosso - Brazil

Re: Json Datasource not rendering children correctly

Post by shadowkras »

I attached the json file. If you check the file structure on a json editor you will notice that Cadastro is a single dimension array, while Ambiente is a multi-dimension array.
Attachments
JsonData.json
(28.94 KiB) Downloaded 307 times
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Json Datasource not rendering children correctly

Post by Alex K. »

Hello,

You can use relations to get child's objects.

Thank you.
Attachments
Capture.PNG
Capture.PNG (73.03 KiB) Viewed 4251 times
Post Reply