Check If Array is Empty | Error in JSON to XML or XML to DataSet Routines | ActivityLocations System.Data.DataRow C#

Json part:

{
“StartDate”: null,
“ExpiryDate”: null,
“ActivityLocations”: []
}

Tried in Word
<<if [ActivityLocations.Any()]>>

Error:
Can not get the value of member ‘ActivityLocations’ on type ‘System.Data.DataRow’

Actually it always fails on ‘ActivityLocations’ empty.

@zhenyu.wang,

To ensure a timely and accurate response, please ZIP and attach the following resources here for testing:

  • Your simplified input Word document
  • The JSON file/string you are getting this problem with
  • Aspose.Words for .NET 20.2 generated output DOCX file showing the undesired behavior (if any)
  • Please also create a standalone simple Console application (source code without compilation errors) that helps us to reproduce your current problem on our end and attach it here for testing. Please do not include Aspose.Words DLL files in it to reduce the file size.

As soon as you get these pieces of information ready, we will start investigation into your scenario and provide you more information. Thanks for your cooperation.

@awais.hafeez

Hi Awais,
ConsoleApp3.zip (4.9 MB)

I have upload a zip file, with

  • input word document ‘test.docx’ in \bin\Debug folder
  • output word, nothing because throw error ‘’ Can not get the value of member ‘ActivityLocations’ on type 'System.Data.DataRow.’’
  • expected output word, if no error, then the output is what I want
  • standalone console application, included in the .zip

@zhenyu.wang,

We tested the scenario and have managed to reproduce the same problem on our end. For the sake of correction, we have logged this problem in our issue tracking system. The ID of this issue is WORDSNET-19974. We will further look into the details of this problem and will keep you updated on the status of correction. We apologize for your inconvenience.

Hi, @awais.hafeez
Just follow up, it there any update on this issue?

@zhenyu.wang,

Unfortunately, WORDSNET-19974 is not resolved yet. We are currently doing analysis of this issue to determine the root cause. We will inform you via this thread as soon as this issue will be resolved in future. We apologize for your inconvenience.

The issues you have found earlier (filed as WORDSNET-19974) have been fixed in this Aspose.Words for .NET 20.4 update and this Aspose.Words for Java 20.4 update.