<</if -greedy>> breaks tables in 20.11

I upgraded to 20.11 and get:

Error Message: Object reference not set to an instance of an object.

when I run the attached example of <</if --greedy>> in a table.

This works fine in 20.08. Data source is unimportant, it just needs to iterate.

Please advise.

Brian

Aspose Error PoC.zip (10.4 KB)

@bstuba,

Please ZIP and attach the following resources here for testing:

  • 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.
  • Your expected DOCX file showing the desired output. You can create this document by using old 20.8 version of Aspose.Words.

As soon as you get these pieces of information ready, we will start further investigation into your scenario/issue and provide you more information.

Attached.GreedyIf.zip (30.9 KB)

@bstuba,

We have logged this problem in our issue tracking system. The ID of this issue is WORDSNET-21444. 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.

@bstuba,

Regarding WORDSNET-21444, as per LINQ Reporting Engine documentation (see the bottom of this Template Syntax section), a greedy switch is intended to be used in single-column Tables only, whereas you use it in a multi-column Table. The fact that it accidentally worked in previous versions of Aspose.Words does not mean that this is a regression, because this is simply an undocumented and unsupported use case for the switch, which is not guaranteed by any means.

Moreover, as per output documents generated by previous versions of Aspose.Words that you shared, using of a greedy switch in your scenario never worked correctly: Text “1==2” leaked to output documents, whereas it never should according to defined if tags. This happens because of the incorrect use of a greedy switch as well.

We suggest you to please remove greedy switches from your template document, then everything works as expected in all versions of Aspose.Words. If you try to achieve something different, then we request you to please provide more details. Thanks for your cooperation.

1 Like