Hello World Example

Contents
[ ]

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.Name]>> says: "<<[s.Message]>>."

To build a report from the template, you can use the following source code.

After the source code is executed, 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.


FAQ

  1. Q: Do I need a license to run this Hello World example?
    A: The example works with the free evaluation version of Aspose.Words for .NET, but the generated documents will contain a watermark. To remove the watermark and unlock full functionality, apply a valid Aspose.Words license using License license = new License(); license.SetLicense("Aspose.Words.lic");.

  2. Q: How do I install Aspose.Words for .NET in my project?
    A: Add the NuGet package Aspose.Words to your project via the Package Manager Console: Install-Package Aspose.Words. This installs the library and its dependencies, making the API available for use.

  3. Q: How can I save the report generated by the LINQ Reporting Engine to a file?
    A: After building the report, call report.Save("Report.docx");. You can also choose other formats such as PDF (report.Save("Report.pdf");).

  4. Q: What is the purpose of the <<[s.Name]>> and <<[s.Message]>> placeholders in the template?
    A: These are LINQ Reporting Engine field expressions. At runtime the engine evaluates them against the data source (Sender objects) and replaces them with the corresponding property values (Name and Message).