NullReferenceException when Single-Column table template

My LINQ Reporting Engine Template contains single-column table with multiple-rows items. In this case BuildReport throws NullReferenceException. I have attached SingleColumnTemplateWithError.docx.

Hi Vladimir,

Thanks for your inquiry. We have tested the scenario and have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-13863. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

Hi Vladimir,

Thanks for your patience. Please note that single-column tables in templates are not supported by LINQ Reporting Engine. This is initially by design. However, you can fix this issue by using following workaround.

Please add extra row in the table and insert /foreach tag with hidden formatting. Note that a space must be added after closing /foreach tag. Please check the attached template document. Hope this helps you.

Thanks for your reply. Yes, this really helps me.

Hi Vladimir,

Thanks for your feedback. Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.

@vladimir.garkusha,
The issues you have found earlier (filed as WORDSNET-13863) have been fixed in this Aspose.Words for .NET 18.1 update and this Aspose.Words for Java 18.1 update.
Please also check the following articles:

Hi there,

I found this thread as I was having the same problem. Unfortunately, I have not found the issue to be resolved since the 18.1 update. I’m currently on version 18.5. The workaround by @tahir.manzoor has worked succesfully for me, but I thought I’d let you know anyway.

I have included a test project, which includes a test input document, my expected output (without the workaround), an input document with the workaround, and the succesful output with the workaround.AsposeTest.zip (352.2 KB)

@TPTWouter,

Thanks for your inquiry. We have tested the scenario and have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-16839. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

@TPTWouter,

We have closed WORDSNET-16839 as “Not a bug”. We introduced the greedy switch in Aspose.Words 18.1 to avoid this exception. Please use <</foreach -greedy>> in your template document to avoid this exception. For more detail, please refer to the following article.
Working with Table-Row Data Bands

Thank you @tahir.manzoor ! This worked wonderfully.

@TPTWouter,

Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.