Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
What is this page about?
This page explains how to configure known external types for the LINQ Reporting Engine.
LINQ Reporting Engine must be aware of custom external types that you reference in your template before the engine processes the template. You can set up external types known by the engine through the ReportingEngine.KnownTypes property. The property represents an unordered set (that is, a collection of unique items) of Type objects. Every type in the set must meet requirements declared at “Working with Types”.
Note – Aliases of simple types like int, string, and others are known by the engine by default.
Consider the following example. Given an ImageUtil class declared at your application and a template accessing a static member of this class, you can use the following code to make the engine be aware of the class before processing the template.
ReportingEngine engine = new ReportingEngine();
engine.KnownTypes.Add(typeof(ImageUtil));
engine.BuildReport(...);
Q: How do I register a custom type with the LINQ Reporting Engine?
A: Create an instance of ReportingEngine, then call engine.KnownTypes.Add(typeof(MyCustomClass)); before invoking engine.BuildReport. This makes the engine aware of the type used in the template.
Q: Which types are already known by the engine without registration?
A: Primitive and simple .NET types such as int, string, bool, DateTime, double, and their nullable counterparts are automatically recognized by the engine.
Q: What requirements must a type meet to be added to KnownTypes?
A: The type must be public, and any instance members accessed from the template must be public. If the template creates an instance, the type needs a public parameter‑less constructor. Static members can be accessed directly without a constructor.
Q: Can I add several external types at once?
A: Yes. Call engine.KnownTypes.Add for each type, or iterate over a collection of Type objects and add them in a loop before building the report.
Q: What happens if a required external type is not added to KnownTypes?
A: The Reporting Engine throws a TemplateProcessingException indicating that the type is unknown, which stops the report generation. Adding the missing type to KnownTypes resolves the error.
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.