StiJsonToDataSetConverterV2 adding erroneous empty rows to DataSet after upgrade.

Stimulsoft Reports.NET discussion
Post Reply
Ryan Robar
Posts: 30
Joined: Fri Sep 20, 2019 3:46 pm
Location: Canada

StiJsonToDataSetConverterV2 adding erroneous empty rows to DataSet after upgrade.

Post by Ryan Robar »

Hello,

I'm currently working on upgrading from Stimulsoft version 2020.5.1 to 2024.3.4. We use JSON data for our reports, but there seems to have been a change made to the StiJsonToDataSetConverterV2 static class that is causing it to add rows to tables in the data set that should not be there. The values in the rows are all null, but the result is that our reports now render incorrectly. There are blank rows where there should be none. I've made a simple report and JSON file to illustrate this which I have attached to this post. Here's a quick breakdown of the issue:

This is the layout of the simple report:
ReportInDesigner.png
ReportInDesigner.png (63.35 KiB) Viewed 2581 times
You can see that there is a parent and child relationship between the two data bands as defined in the data source on the right. I have the "Print if Detail Empty" option enabled on the master row component. This is how it looks when previewed in 2020.5.1:
ReportPreview202051.png
ReportPreview202051.png (18.21 KiB) Viewed 2581 times
This looks correct, with the proper amount of space between the bands. Lastly, if I use the "View Data" function in the designer for the child table, I see this:
ViewData202051.png
ViewData202051.png (7.59 KiB) Viewed 2581 times
There are only rows for the 1st and 3rd parent rows (relation_id 0 and 2) as expected since parents 2 and 4 have no children in the JSON.

Now, lets take a look at the preview in 2024.3.4:
ReportPreview202434.png
ReportPreview202434.png (21.78 KiB) Viewed 2581 times
I've added some arrows to make the issue clear. There is empty space where there should be none. If we use the "View Data" function we can see the issue:
ViewData202434.png
ViewData202434.png (9.97 KiB) Viewed 2581 times
Again, I've added arrows for clarity. There are now child rows for all parent values, not just the ones that actually have a value. There should only be rows with relation_id 0 and 2 and none for 1 or 3. The report engine is of course seeing these fake rows and rendering them.

Is there a way to stop the converter from adding these fake rows? If there is a property I can set somewhere to stop these from being added that would be ideal.

Thanks,

Ryan Robar
Attachments
JSONConverterTest.mrt
Simple Example Report
(10.61 KiB) Downloaded 218 times
JSONConverterTest.json
Simple Example JSON
(716 Bytes) Downloaded 194 times
Lech Kulikowski
Posts: 7291
Joined: Tue Mar 20, 2018 5:34 am

Re: StiJsonToDataSetConverterV2 adding erroneous empty rows to DataSet after upgrade.

Post by Lech Kulikowski »

Hello,

We need time to investigate the issue. We will let you know about the result.

At the current moment, you can remove empty collections from JSON string for the old behavior.

Thank you.
#15348
Attachments
1.png
1.png (167.83 KiB) Viewed 2569 times
Ryan Robar
Posts: 30
Joined: Fri Sep 20, 2019 3:46 pm
Location: Canada

Re: StiJsonToDataSetConverterV2 adding erroneous empty rows to DataSet after upgrade.

Post by Ryan Robar »

Hello,

I was able to use your proposed workaround, but it required writing code to prevent the empty collections from being serialized when making any JSON that will be used by Stimulsoft. This will work for now, but I would prefer if the converter could handle this the way it used to, or at least if it could be told to conditionally.

Thanks
Lech Kulikowski
Posts: 7291
Joined: Tue Mar 20, 2018 5:34 am

Re: StiJsonToDataSetConverterV2 adding erroneous empty rows to DataSet after upgrade.

Post by Lech Kulikowski »

Hello,

Yes, we are working on this issue, and this suggestion was provided as a temporary workaround.

Thank you.
Lech Kulikowski
Posts: 7291
Joined: Tue Mar 20, 2018 5:34 am

Re: StiJsonToDataSetConverterV2 adding erroneous empty rows to DataSet after upgrade.

Post by Lech Kulikowski »

Hello,

The issue is fixed. The fix will be available in one of the next release builds.

Thank you.
Post Reply