Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
Assume, that you have the Sender class defined in your application as follows:
To produce a report containing a message of a concrete sender on its behalf, you can use a template document with the following content.
<<[s.getName()]>> says: "<<[s.getMessage()]>>."
To build a report from the template, you can use the following source code.
After the source code is ran, the template document is populated with the data about the sender, and the document becomes a ready report with the following content.
LINQ Reporting Engine says: "Hello, World."
After the report document is built, you can save it or perform any other tasks on it using Aspose.Words API in your code.
Q: How do I add the LINQ Reporting Engine to my Java project?
A: Include the Aspose.Words for Java Maven/Gradle dependency (e.g., com.aspose:aspose-words:23.12) and ensure the aspose-words.jar is on the classpath. The LINQ Reporting Engine is part of this library, so no additional packages are required.
Q: What is the correct syntax for template tags when using Java objects?
A: Use double‑angle brackets with the object variable name and its Java getter method, e.g., <<[s.getName()]>> and <<[s.getMessage()]>>. The engine evaluates the expression at runtime and inserts the returned string.
Q: How can I pass my custom Sender object to the report?
A: Create an instance of Sender, then add it to a HashMap<String, Object> (or any Map) with a key that matches the tag name, and call ReportingEngine.buildReport(templatePath, dataMap, outputPath). The key "s" in the map corresponds to the s used in the template tags.
Q: In which formats can I save the generated report?
A: After building the report, use Document.save(String filePath, SaveFormat format) where SaveFormat can be DOCX, PDF, HTML, etc. Example: document.save("Report.pdf", SaveFormat.PDF);.
Q: Do I need a license to run this example, and how do I apply it?
A: A temporary evaluation license works for testing, but a purchased license removes evaluation limitations. Load the license with License license = new License(); license.setLicense("Aspose.Words.Java.lic"); before creating any Document or ReportingEngine objects.
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.