Page 1 of 1

Object nested and databand problem

Posted: Thu Nov 24, 2022 12:26 pm
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.

Re: Object nested and databand problem

Posted: Thu Nov 24, 2022 1:10 pm
by Lech Kulikowski
Hello,

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

Thank you.

Re: Object nested and databand problem

Posted: Thu Nov 24, 2022 2:13 pm
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.

Re: Object nested and databand problem

Posted: Thu Nov 24, 2022 6:18 pm
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.

Re: Object nested and databand problem

Posted: Fri Nov 25, 2022 1:13 pm
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.

Re: Object nested and databand problem

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

Re: Object nested and databand problem

Posted: Mon Nov 28, 2022 9:48 am
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

Re: Object nested and databand problem

Posted: Mon Nov 28, 2022 10:55 pm
by Lech Kulikowski
Hello,

We couldn't reproduce the issue.

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

Thank you.

Re: Object nested and databand problem

Posted: Tue Nov 29, 2022 5:36 pm
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

Re: Object nested and databand problem

Posted: Wed Nov 30, 2022 8:00 am
by Lech Kulikowski
Hello,

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

Thank you.