JSON datasource error with StiJsonToDataSetConverter command
-
- Posts: 7
- Joined: Tue Jan 08, 2019 1:57 pm
JSON datasource error with StiJsonToDataSetConverter command
Hello,
I use Reports.Net products to develop reports and Reports.web to publish them on the internet (version 2019.1.1).
When I import the attached json into the designer everything works and the data is rendered correctly (screenshot_designer.png).
However, when I use the StiJsonToDataSetConverter command to synchronize the dataset via code, the report
does not recognize the json and displays nothing, the report is empty, even if the json file is the same, the “test.json” file.
I use these commands:
Report.Dictionary.Databases.Clear();
var Dset = StiJsonToDataSetConverter.GetDataSetFromFile(@ "E:\_SPRINT\LTSE-722\test.json");
Report.RegData ("ds", Dset);
Report.Dictionary.Synchronize();
The very strange thing is that if I remove the "Report" element in the json then the dataset is managed
successfully and the report synchronizes. I wonder why the designer is able to manage this structure
while the code not.
Thanks and best regards,
Ivan.
I use Reports.Net products to develop reports and Reports.web to publish them on the internet (version 2019.1.1).
When I import the attached json into the designer everything works and the data is rendered correctly (screenshot_designer.png).
However, when I use the StiJsonToDataSetConverter command to synchronize the dataset via code, the report
does not recognize the json and displays nothing, the report is empty, even if the json file is the same, the “test.json” file.
I use these commands:
Report.Dictionary.Databases.Clear();
var Dset = StiJsonToDataSetConverter.GetDataSetFromFile(@ "E:\_SPRINT\LTSE-722\test.json");
Report.RegData ("ds", Dset);
Report.Dictionary.Synchronize();
The very strange thing is that if I remove the "Report" element in the json then the dataset is managed
successfully and the report synchronizes. I wonder why the designer is able to manage this structure
while the code not.
Thanks and best regards,
Ivan.
- Attachments
-
- test.json
- (222 Bytes) Downloaded 134 times
-
- screenshot_designer.PNG (17.45 KiB) Viewed 3101 times
-
- ReportTest.mrt
- (6.28 KiB) Downloaded 131 times
-
- Posts: 7
- Joined: Tue Jan 08, 2019 1:57 pm
Re: JSON datasource error with StiJsonToDataSetConverter command
Hello,
I also tried with the latest version 2021.2.3 but the problem persists, please let me know what I'm doing wrong.
Thanks a lot and best regards,
Ivan.
I also tried with the latest version 2021.2.3 but the problem persists, please let me know what I'm doing wrong.
Thanks a lot and best regards,
Ivan.
-
- Posts: 6266
- Joined: Tue Mar 20, 2018 5:34 am
Re: JSON datasource error with StiJsonToDataSetConverter command
Hello,
Please try to use the StiJsonToDataSetConverterV2.
Thank you.
Please try to use the StiJsonToDataSetConverterV2.
Thank you.
-
- Posts: 7
- Joined: Tue Jan 08, 2019 1:57 pm
Re: JSON datasource error with StiJsonToDataSetConverter command
Hello Lech,
yes now it works, I see the data in the report.
But with parent-child relationships it doesn't work!
Please look at the file I sent you with an example of complex json!
in the designer everything is fine, as soon as I use the StiJsonToDataSetConverterV2 the elements of the relations are not shown.
Many thanks,
Ivan.
yes now it works, I see the data in the report.
But with parent-child relationships it doesn't work!
Please look at the file I sent you with an example of complex json!
in the designer everything is fine, as soon as I use the StiJsonToDataSetConverterV2 the elements of the relations are not shown.
Many thanks,
Ivan.
- Attachments
-
- ReportTest.mrt
- (10.83 KiB) Downloaded 137 times
-
- test.json
- (470 Bytes) Downloaded 133 times
-
- Posts: 6266
- Joined: Tue Mar 20, 2018 5:34 am
Re: JSON datasource error with StiJsonToDataSetConverter command
Hello,
The issue with relations names. In your original report, its were added manually and has different names if use the Synchronize method.
Please correct that.
Also, should be:
report.RegData("test", Dset);
Thank you.
The issue with relations names. In your original report, its were added manually and has different names if use the Synchronize method.
Please correct that.
Also, should be:
report.RegData("test", Dset);
Thank you.
- Attachments
-
- Screenshot 2021-04-19 163021.png (114.2 KiB) Viewed 3039 times
-
- ReportTest.mrt
- (11.7 KiB) Downloaded 135 times
-
- Posts: 7
- Joined: Tue Jan 08, 2019 1:57 pm
Re: JSON datasource error with StiJsonToDataSetConverter command
Hi Lech,
many thanks, it worked perfectly !!!
But I still have two questions:
1) in my json example I have the seller element which does not have a parent-child relationship to the cart element, but, let's say, is his brother. How do I need to name the relationship to see the CompanyName attribute?
2) I develop the report in the designer, I have not seen the syncronize command, so I have to create all the relations and their names manually. is there a funyionality in the web.designer that I have not seen?
Many thanks and best regards,
Ivan.
many thanks, it worked perfectly !!!
But I still have two questions:
1) in my json example I have the seller element which does not have a parent-child relationship to the cart element, but, let's say, is his brother. How do I need to name the relationship to see the CompanyName attribute?
2) I develop the report in the designer, I have not seen the syncronize command, so I have to create all the relations and their names manually. is there a funyionality in the web.designer that I have not seen?
Many thanks and best regards,
Ivan.
-
- Posts: 6266
- Joined: Tue Mar 20, 2018 5:34 am
Re: JSON datasource error with StiJsonToDataSetConverter command
Hello,
1) if in Seller only one record, you can use {Seller.CompanyName}. If several, you should add a relation.
2) In the Action menu.
Thank you.
1) if in Seller only one record, you can use {Seller.CompanyName}. If several, you should add a relation.
2) In the Action menu.
Thank you.
- Attachments
-
- Screenshot 2021-04-19 235310.png (53.32 KiB) Viewed 3035 times
-
- Posts: 7
- Joined: Tue Jan 08, 2019 1:57 pm
Re: JSON datasource error with StiJsonToDataSetConverter command
Hello,
perfect, everything works!
thank you very much
Best Regards,
Ivan.
perfect, everything works!
thank you very much
Best Regards,
Ivan.
-
- Posts: 6266
- Joined: Tue Mar 20, 2018 5:34 am
Re: JSON datasource error with StiJsonToDataSetConverter command
Hello Ivan,
You are welcome!
You are welcome!