Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
LINQ Reporting Engine enables you to use the following built-in extension methods in template expressions:
IEnumerable<T> (see “Appendix A. Enumeration Extension Methods” for more information)Q: How do I call an extension method inside a LINQ Reporting Engine template?
A: Call it on a sequence inside an expression in square brackets, using the Java (camelCase) name, e.g., <<[persons.where(p => p.getAge() > 30).count()]>>, or in a data band: <<foreach [p in persons.where(p => p.getAge() > 30)]>>. The engine resolves the method at runtime.
Q: Which enumeration‑style extension methods are available by default?
A: The methods that mimic the IEnumerable<T> extension methods, written in camelCase in Java templates: where, select, orderBy, take, skip, count, any, and the others listed in “Appendix A. Enumeration Extension Methods”.
Q: Can I use extension methods on the iteration variable itself (e.g., the index of a foreach loop)?
A: Yes. Iteration variables have the indexOf() and numberOf() methods (see “Using Extension Methods of Iteration Variables”), e.g., <<[item.indexOf()]>>. There are no IsFirst, IsLast, or IsEven helpers; use expressions such as <<[item.indexOf() == 0 ? "First" : ""]>> instead.
Q: Is it possible to add my own custom extension methods for use in Java templates?
A: Not as extension methods: only the built‑in extension methods can be called on a sequence. To use your own code, make the class and the method public and static, add the class to engine.getKnownTypes(), and call the method with the class name, e.g., <<[MyUtilities.formatDate(order.getOrderDate())]>>.
Q: Are the same extension methods available when using Aspose.Words for .NET or other platforms?
A: Yes. .NET and Java have the same set of built‑in extension methods and the same << >> tag syntax. Only the method names follow the platform’s naming: Where, Count in .NET templates and where, count in Java templates. Refer to the platform‑specific documentation for details.
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.