Hi,
I am trying to create a report to validate Aspose.Words for our usecase.
The datasource is JSON and looks something like this
"Membership": {
"MembershipNumber": "101005"
},
"Product": [{
"Name": "Legal Cost Insurance",
"InceptionDate": "2024-11-01",
"CancellationDate": "1900-01-01",
"Premium": 0.0
}],
"Beneficiary": []
}
I had a simple table like in the attached document BeneficiaryTable.docx, and running this obviously gives an error An error has been encountered at the end of expression 'Name]>'. Can not get the value of member 'Name' on type 'System.Data.DataRow'.
That’s fine and understandable, and I thought I could fix it by placing the table in a condition like <<if [Beneficiary.Any()]>>
, as you can see in the attachment BeneficiaryTableInIfCondition.docx.
I expected this to resolve the issue, but even though the condition evaluates to false, it seems like the engine still tries to build the table, as I still get the same error as above.
Is this the correct way to show a table only if there is data for it? Or is there some other way to do this that I am missing?
Any help would be greatly appreciated.
Thanks and kind regards
BeneficiaryTable.docx (2.4 KB)
BeneficiaryTableInIfCondition.docx (2.5 KB)