FAQ
This page collects short answers to the questions that usually come up after the first few report templates are in use.
Use it as a quick reference when you need a practical reminder rather than a step-by-step walkthrough.
Here you will find answers to frequently asked questions and recommendations for using Reporting.
Reference Example
Template:
Seat: <<[traveler.Seat ?? "pending"]>>Data object:
public sealed class Traveler
{
public string? Seat { get; set; }
}Expected output:
Seat: pendingCan I combine several data sources in one report?
Yes. Use a BuildReport overload that accepts object[] and string[], then reference each source by name inside the template.
When should I choose LINQ Reporting instead of Mail Merge?
Choose LINQ Reporting when you need loops, grouping, nested content, conditions, or calculated expressions. For straightforward field replacement with a simpler authoring model, Mail Merge is often enough.
How do I handle optional properties that are not always present?
If a missing member should behave like null, enable ReportBuilderOptions.AllowMissingMembers. If the field is present but nullable, use a null-aware expression such as <<[traveler.Seat ?? "pending"]>>.
Can I use JSON or XML without converting everything to custom classes first?
Yes. JsonDataSource and XmlDataSource are designed for that scenario. Use their load options when you need stable root-object handling or custom parsing behavior.
Why do I get extra blank lines after generation?
The tag was removed, but the paragraph that contained it remained. Use selective cleanup with ! on the tag or enable ReportBuilderOptions.RemoveEmptyParagraphs.
How do I troubleshoot a broken template faster?
Start with a reduced template, confirm the data-source name, and enable InlineErrorMessages during development. That usually identifies the failing tag faster than debugging a large final template.
Can I format dates and numbers directly in a tag?
Yes. For example:
<<[booking.DepartureDate]:"dd MMM yyyy">>
<<[booking.TotalAmount]:"0.00">>Do I have to use DOCX templates?
No. The reporting workflow is about the template syntax and the build step, not one specific storage format. Choose the template form that fits your document pipeline and output requirements.