We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Linq + xml

I have another problem with Linq reporting engine using dataSet.readXml.
When i reference an attribute (in my case named value) in the template (
if [value == “true”] ok /if )
which is not present in the xml i’m passing, comes this error:

java.lang.IllegalStateException: An error has been encountered at the end of expression 'value == '. Can not get the value of member ‘value’ on type ‘class com.aspose.words.net.System.Data.DataRow’.

The xml is not always the same, sometimes has this attribute and sometimes not. If there isn’t linq reporting shouldn’t return an error but silently proceed with null value (or simply bypass it). So did mail merging with XmlDataSource.

I attach source code

Thanks
Simone

Hi Simone,
This issue has been logged into our issue tracking system as WORDSNET-12380. We will keep you updated on this issue in this thread.
Best Regards,

When will this issue be resolved ? thanks

Simone

Hi Simone,

Thanks for your inquiry. This issue has been resolved in next Aspose.Words 15.9.0 version which will be released by the end of current week.

We have added ReportingEngine.Options property in Aspose.Words 15.9.0. Please set ReportingEngine.Options to ReportBuildOptions.AllowMissingDataFields to meet this requirement with Aspose.Words 15.9.0.

Best regards,

The issues you have found earlier (filed as WORDSNET-12380) have been fixed in this .NET update and this Java update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.

Sorry, nothing has changed with new versione 15.9.0…

Hi Simone,
We are in communication with our product team on this issue and will update you soon.
Best Regards,

Hi Simone,
You need to set ReportBuildOptions.ALLOW_MISSING_DATA_FIELDS option before calling engine.buildReport to get it working e.g.
ReportingEngine engine = new ReportingEngine();
engine.setOptions(ReportBuildOptions.ALLOW_MISSING_DATA_FIELDS);
Please note that this option will work with DataTable rows only. In your case, you are building a DataSet from XML so it will work in your case but you need to set above mentioned option.
Best Regards,

Hi Muhammad, thanks it works.

…but an error occours when i use first() on a missing field.
example:

istanza.first().descrizione

Can you fix it too ?

Thanks

Simone

and of course it should bypass foreach tags if missing This lines

<<foreach [in malattie]>><<[descrizioneIt]>><</foreach>><</if>>

should not fire an exception if “malattie” field is missing…

Thanks

Hi Simone,

*…but an error occours when i use first() on a missing field.
example:

istanza.first().descrizione

Can you fix it too ?*

Can you please share more details about the issue? It would be better if you please share your updated template, a screenshot and a simple console application to reproduce the issue.
Best Regards,

Hi Muhammad,

i attach a simple application. Please look at method PdfAgentTest.testMerge(); As you can see in the template (estate-ragazzi.rtf) i try to reference a missing object in two ways:

  1. <<[missingObject.first().id]>>
  2. <<foreach [in missingObject]>><<[id]>><</foreach>>

and even if a set ALLOW_MISSING_DATA_FIELDS, an error occours.

Thanks

Hi Simone,
Thanks for the details. We are investigating both issues and will update you soon.
Best Regards,

This issue is a show stopper for us from using Aspose for our next solution. Can we get an update on when this might be addressed?

Hi Simone,
First and second issues reported in your last post have been logged into our issue tracking system as WORDSNET-12561 and WORDSNET-12562 respectively. We will keep you updated on these issues in this thread.
Best Regards,

Hi Mark,
The issues have recently been logged and we will be able to share more details after the issues have been analyzed by our product team. We will keep you updated.
Best Regards,

Has it been solved in 15.10.0 ?? thanks

Hi Simone,
These issues have been fixed however fixes are not the part of 15.10.0 release. These fixes will be included in 15.11.0.
Best Regards,

The issues you have found earlier (filed as WORDSNET-12561;WORDSNET-12562) have been fixed in this .NET update and this Java update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.