Hi,
We(Existing customer of Groupdocs.Conversion) are planning to evaluate Aspose.Words ReportingEngine as a replacement for our existing Apache POI + Velocity template solution.
Kindly help clarify the following points,
Queries:
Calling Java methods from templates
– Can a template invoke methods from custom Java utility objects that are added to the reporting context?
Dynamic type conversion
– Does the ReportingEngine support type casting or converting objects within the template (e.g., converting an Object into a List)?
Map iteration
– When iterating through a Map, is it possible to access keys and values directly inside the template?
Complex nested logic
– Does the template engine support variable assignment, temporary variables, or comparing values across different collections within nested loops?
– Or should such logic be pre-processed on the Java side?
Using helper/utility objects inside templates
– If helper objects are added to the reporting context, what types of operations can be performed on them inside the template?
Supported expression features
– Is there an official, comprehensive list of supported expressions, object access rules, and template operations for the ReportingEngine?
Below is what can be confirmed from the current Aspose.Words LINQ ReportingEngine documentation:
Template syntax – The engine uses a limited expression language that is described in the “Template Syntax” section of the LINQ ReportingEngine docs [2]. It is not a full‑blown scripting engine.
Calling Java methods – Only members (properties/fields) of objects that are exposed as known external types can be accessed. Direct invocation of arbitrary Java methods from the template is not supported [2] (“Setting up Known External Types”).
Dynamic type conversion / casting – The engine does not provide an explicit cast operator in the template language. Objects are used as‑is; converting an Object to a List inside the template is therefore not available [2] (“Optimizing Reflection Calls” and the general limitation of the expression language).
Map iteration – The template language can iterate over collections, but there is no built‑in syntax to enumerate a Map and retrieve both key and value simultaneously. To work with map entries you need to expose them as a collection of key/value objects from Java [2] (“Accessing Missing Members of Data Objects”).
Variable assignment / temporary variables – The expression language does not include statements for creating or assigning temporary variables. Nested loops can be used, but any complex comparison or intermediate calculation should be performed on the Java side before passing the data to the engine [2] (“Technical FAQ”).
Helper/utility objects – Objects added to the reporting context can be accessed for their public properties/fields, but only the members allowed by the “Restricting Access to Type Members” policy are reachable. No method calls or custom logic can be executed from the template [2].
Supported expressions list – A comprehensive list of the supported expressions, object‑access rules and template operations is documented in the “Template Syntax”, “Technical FAQ” and “Typical Templates” sections of the LINQ ReportingEngine guide [2].
In summary, the ReportingEngine provides a read‑only, property‑access‑only template language. Anything beyond simple property navigation (method calls, casting, map key/value iteration, variable assignment, complex logic) should be prepared in Java and supplied to the engine as ready‑to‑use data structures. For the exact syntax and any future enhancements, refer to the official LINQ ReportingEngine documentation linked above.
Below is a concise summary of what the Aspose.Words LINQ ReportingEngine can and cannot do, taken directly from the official documentation [1].
Feature
Support in ReportingEngine
Calling Java methods from templates
Not supported. Only public properties/fields of objects that are registered as known external types can be accessed [1].
Dynamic type conversion / casting
No explicit cast operator; objects are used as‑is, so converting an Object to a List inside the template is unavailable [1].
Map iteration (key + value)
The template language can iterate over collections, but it cannot enumerate a Map and retrieve both key and value simultaneously. You must expose map entries as a collection of key/value objects from Java [1].
Variable assignment / temporary variables
The expression language does not include statements for creating or assigning temporary variables. Any complex comparison or intermediate calculation must be performed on the Java side before passing the data [1].
Helper/utility objects
Objects added to the reporting context are reachable only for their public properties/fields (subject to the “Restricting Access to Type Members” policy). Method calls or custom logic cannot be executed from the template [1].
Supported expression features
A full list is documented in the Template Syntax, Technical FAQ, and Typical Templates sections of the LINQ ReportingEngine guide [1].
Overall capability
The engine provides a read‑only, property‑access‑only template language. Anything beyond simple property navigation (method calls, casting, map key/value iteration, variable assignment, complex logic) must be prepared in Java and supplied as ready‑to‑use data structures [1].
Can all of the requested capabilities be achieved with any Aspose library?
According to the ReportingEngine documentation, the features you listed (method invocation, casting, map key/value iteration, variable creation, etc.) are not supported by the ReportingEngine itself. The same limitation applies to other Aspose templating mechanisms (e.g., mail‑merge) because they also rely on a read‑only property‑access language. Therefore, to obtain the desired behavior you need to perform the required processing in Java (or another pre‑processing step) and pass the resulting objects/collections to the engine.
For a complete reference, see the Template Syntax, Technical FAQ, and Typical Templates sections of the LINQ ReportingEngine documentation [1].