Hi , We have following JSON structure ( Please check the attachment Attachment ). LINQ report engine is facing issue with getting Value of “Actual” key (Please check template and output in the attachment). Could you please check what could be the issue ?
<<foreach [ item in node.ppFoodDefaultFoodBOM.CurrentRevision.Items]>>
Actual : <<[item?.Actual]>> <<[item.Actual?.C$Type]>>
Name :<<[item?.C$Name]>>
BOMLine: <<[item?.BOMLineBOMRevision]>>
<</foreach>>
Aspose Words: 24.6
@Test
void wordDocument() throws Exception {
License license = new License();
license.setLicense("Aspose.Words.Java.lic");
String data = "src/test/resources/input/word/data/bomData.json";
String fileName = "src/test/resources/input/word/templates/BOM1.docx";
Document document = new Document(fileName);
JsonDataLoadOptions options =new JsonDataLoadOptions();
options.setAlwaysGenerateRootObject(true);
JsonDataSource dataSource = new JsonDataSource(data,options);
ReportingEngine engine = new ReportingEngine();
engine.setOptions(ReportBuildOptions.ALLOW_MISSING_MEMBERS);
engine.buildReport(document, dataSource);
document.save("src/test/resources/input/word/out.docx");
}
nestedJsonWords.zip (11.8 KB)
@pgcentric We will check the issue and get back to you soon.
@pgcentric
The issue occurs because of JSON elements named the same nested to each other. If Actual
that is a child of jm_MainFM
is renamed to Actual2
, for example, the issue disappears. So, you can rename the element to avoid the issue.
Internally, LINQ Reporting Engine maps JSON to com.aspose.words.net.System.Data objects, so the engine cannot process JSON of any possible form, there are some restrictions like this one.
Thank you for the reply. We do not have control over the input JSON structure and are unable to modify it before processing. Since LINQ Reporting Engine maps JSON to com.aspose.words.net.System.Data
objects, which imposes certain restrictions, could you provide a fix or workaround on your end to handle such cases without requiring modifications to the JSON input?"
@pgcentric
For the sake of further analysis, we have opened the following new ticket in our internal issue tracking system and will process it according to the terms mentioned in Free Support Policies.
Issue ID: WORDSNET-27907
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
Hi, This is a high-priority issue for us. Could you please provide an estimated timeline for WORDSNET-27907 ? Just checking in to see if there are any updates.
Thanks for your help!
@pgcentric The issue is currently n the final stage of development. If everything will go smoothly the fix will be included into the next 25.4 version of Aspose.Words. We will keep you updated and let you know once the fix is available.
Thank you for the quick response. Could you please share the tentative release date of 25.4 if available? ?
@pgcentric Usually new version of Aspose.Words for .NET is published at the very beginning of each month. Java version is published approximately in the middle of each month.