LINQ Reporting Engine - Document insertions do not inline the content

Hi, we have a set of templates using LINQ to compose a document out of different sub-templates. The problem is that when we use <<doc [key]>> it always adds a new line/break after that statement and this breaks the desired format of the text.

Maven example project:
test.zip (29.9 KB)

Template:

The current result is:

Expected:

In this example, I have used a regular String converted to the byte array, but I would expect the same behavior also for another Docx document inserted w/o a new line afterward.

Thanks in advance!

@artyomsv2

MS Word document model implies storing of text nodes (runs) within paragraphs. It is impossible to create an MS Word document containing text and no paragraph break - at least one paragraph break appears. You can check it by yourself using MS Word.

In your case, although you use text without a line break in your example, a doc tag makes the engine to treat it as a document. So, when a document to be inserted is loaded, a paragraph is created. The paragraph has a break, which then appears in a result document.

All in all, this is an expected behavior rather than a bug. However, we can log a feature request to add a switch like <<doc [...] -trimLastBreak>> to fulfill your requirement. Please let us know if you want to proceed in this way.

Thanks for the reply,

Definitely, if it is possible we would prefer this feature because we have many such document inserts and line breaks that we would prefer to avoid.

@artyomsv2

The feature request is logged as WORDSNET-24350. You will be notified through the forum thread once it is implemented.

@artyomsv2

It is to inform you that we have completed working on the feature (WORDSNET-24350) and it will be available in Aspose.Words 22.11. Once it is released, you will be able to use the following template syntax to trim the last paragraph break when inserting a document using LINQ Reporting Engine:

<<doc [document_expression] -inline>>

The issues you have found earlier (filed as WORDSNET-24350) have been fixed in this Aspose.Words for .NET 22.11 update also available on NuGet.