Inserting document into template using LINQ Reporting engine

How to insert document into template upon budling report using LINQ Reporting Engine?

To insert another document while the LINQ Reporting Engine builds a report, place a dynamic insertion tag in the template where the extra content should appear.

Syntax

<<doc [document_expression]>>

document_expression must evaluate at runtime to one of the supported types:

  • byte[]
  • Stream
  • string — a file path, URI, or a Base‑64‑encoded document

Useful switches

Switch Effect
-sourceStyles Copies the source document’s styles into the report
-sourceNumbering Copies the source document’s numbering definitions
-inline Inserts the document inline without creating a separate section
-build Treats the inserted document as a template and builds it with the current data scope

Example tags (from the documentation)

<<doc [booking.TermsDocumentPath]>>
<<doc [booking.AppendixBase64] -sourceStyles>>
<<doc [booking.PartialTemplatePath] -build>>
  • The first line inserts the file whose path is stored in booking.TermsDocumentPath.
  • The second line inserts a Base‑64 document and also brings its styles into the report.
  • The third line inserts a partial template and builds it using the same data context (-build).

How it fits into the build step

Create your template with the <<doc …>> tags, then call one of the ReportBuilder.BuildReport overloads (or use a ReportBuilder processor) to generate the final document. The engine will evaluate the expression, load the referenced document, apply any switches, and merge the content into the output.

References

All information applies to the 26.5.0 version of Wordize for .NET.