Object nested and databand problem

Stimulsoft Reports.NET discussion
Post Reply
User avatar
custodian
Posts: 7
Joined: Wed Nov 23, 2022 11:34 am

Object nested and databand problem

Post by custodian »

I have created a template in designer and all is working there. Problem is generating PDF, only show no-nested keys from JSON and dont show databand arrays. I have checked MRT file and relations are created. I dont know what to do. I have attached MRT file.
Attachments
SingleWOSimplified_PM (19).mrt
(2.3 MiB) Downloaded 5 times
Lech Kulikowski
Posts: 4969
Joined: Tue Mar 20, 2018 5:34 am

Re: Object nested and databand problem

Post by Lech Kulikowski »

Hello,

Sorry, maybe we did not exactly understand your question. Could you explain your issue in more detail?

Thank you.
User avatar
custodian
Posts: 7
Joined: Wed Nov 23, 2022 11:34 am

Re: Object nested and databand problem

Post by custodian »

I attach two PDF files. One create from template with designer and other generated from code. It has data to fill all fields but it doesnt show them if JSON keys are nested.
Attachments
fromReportLoad.pdf
(126.8 KiB) Downloaded 5 times
fromDesigner.pdf
(429.22 KiB) Downloaded 6 times
Lech Kulikowski
Posts: 4969
Joined: Tue Mar 20, 2018 5:34 am

Re: Object nested and databand problem

Post by Lech Kulikowski »

Hello,

Please clarify which product and version are you use?

Could you send a sample project that reproduces the issue for analysis?

Thank you.
User avatar
custodian
Posts: 7
Joined: Wed Nov 23, 2022 11:34 am

Re: Object nested and databand problem

Post by custodian »

Hi

When I generate the report using the designer desktop (v 2022.4.5) the pdf is ok (see fromDesigner.pdf). But when I generate the report using .NET Engine (v 2022.4.5) the pdf is not ok, some tables are empty.
See table Remarks, Assets, Spares in the pdf generated by designer is ok but not in the file generated by NET library.
Attachments
SingleWOSimplified_PM.mrt
template
(291.69 KiB) Downloaded 6 times
SWO.IN.PRES.DEMO.PM.AB5143R.json
json used to load into NET library
(46.7 KiB) Downloaded 6 times
fromNET.pdf
(126.83 KiB) Downloaded 4 times
fromDesigner.pdf
(119.57 KiB) Downloaded 5 times
Lech Kulikowski
Posts: 4969
Joined: Tue Mar 20, 2018 5:34 am

Re: Object nested and databand problem

Post by Lech Kulikowski »

Hello,

> But when I generate the report using .NET Engine (v 2022.4.5) the pdf is not ok, some tables are empty.

Could you show your code or send us a sample project that reproduces the issue?

Thank you.
User avatar
custodian
Posts: 7
Joined: Wed Nov 23, 2022 11:34 am

Re: Object nested and databand problem

Post by custodian »

Hi,

What else do you need? I sent you all the information.
First create object "JObject data" according with the format, then:

// Load the template:
report.Load("SingleWOSimplified_PM.mrt");
// create the dataset
var dataSet = StiJsonToDataSetConverter.GetDataSet(data);
// Assign the dataset
report.RegData("dataSet", dataSet);

The problems raised in the arrays.

If you need further information, I recommend to have a screen sharing session.

Best regards
Lech Kulikowski
Posts: 4969
Joined: Tue Mar 20, 2018 5:34 am

Re: Object nested and databand problem

Post by Lech Kulikowski »

Hello,

We couldn't reproduce the issue.

Please send us a sample project that reproduces the issue for analysis.

Thank you.
Attachments
Screenshot 2022-11-28 235450.png
Screenshot 2022-11-28 235450.png (276.33 KiB) Viewed 47 times
User avatar
custodian
Posts: 7
Joined: Wed Nov 23, 2022 11:34 am

Re: Object nested and databand problem

Post by custodian »

Hello,

Thanks of the response. First, let me comment that the pdf you show does not have the desired information. If you see the number of the dataset is "PM.AB5143R" and in the pdf it's shown "PM.AC0427I" (see the attachment). I think this is the test dataset.
I solved the issue by adding the clear statement (bold).

var report = new StiReport();
report.Load("e:\\SingleWOSimplified_PM.mrt")
var dataSet = StiJsonToDataSetConverterV2.GetDataSetFromFile("C:\\SWO.IN.PRES.DEMO.PM.AB5143R.json")
report.RegData("dataSet", dataSet);
report.Dictionary.DataSources.Clear(); //This comand solved the issue
report.Dictionary.Synchronize();
report.Dictionary.Connect();
report.Render(false);
report.ExportDocument(StiExportFormat.Pdf, "C:\\report.pdf")

Is it correct?

The other issue was the library, I was using StiJsonToDataSetConverter not StiJsonToDataSetConverterV2, what is the difference?

Best regards
Attachments
Screenshot 2022-11-29 141519.png
Screenshot 2022-11-29 141519.png (40.22 KiB) Viewed 31 times
Lech Kulikowski
Posts: 4969
Joined: Tue Mar 20, 2018 5:34 am

Re: Object nested and databand problem

Post by Lech Kulikowski »

Hello,

StiJsonToDataSetConverter is the old version. You should use StiJsonToDataSetConverterV2 version.

Thank you.
Post Reply