Using the Demos
Contents
[
Hide
]
Aspose.Words for JasperReports includes a number of demo projects to help you get started exporting reports to Microsoft Word document formats from your application. The demos provided with Aspose.Words for JasperReports are standard JasperReports demos modified to demonstrate the use of new exporters.
To run Aspose.Words for JasperReports demos:
- Download JasperReports from https://sourceforge.net/projects/jasperreports/files/archive/jasperreports/. Make sure to download the entire archived project with the source code and demos, not just a single JAR.
- Unpack the archived project to some location on your hard disk, for example C:.
- Copy all demo folders from the \demo folder of aspose.words.jasperreports.zip to
\jasperreports\demo\samples, where is the location you have unpacked JasperReports to. This step is required because demo build scripts rely on JasperReports' folder structure, otherwise you need to modify build scripts. - Copy aspose.words.jasperreports.jar from the \lib folder in aspose.words.jasperreports.zip to
\jasperreports\lib. - Download the ANT tool from https://ant.apache.org/bindownload.cgi.
- Unpack the ANT tool and set up environment variables as described in the tool’s manual.
- Change the current directory to
\demo\hsqldb and run the following command line: ant runServer - Change the current directory to one of the Aspose.Words for JasperReports demos, for example
\demo\samples\charts.aw and run the following commands on the command line: ant javac – to compile the java source files of the test application. ant compile – to compile the XML report design and produce the .jasper file. ant fill – to fill the compiled report design with data and produce the .jrprint file. - Run one or more of the following commands in the command line:
- ant doc – to produce a DOC file from the demo report.
- ant docx – to produce a DOCX file from the demo report.
- ant rtf – to produce an RTF file from the demo report.
- ant odt – to produce an ODT file from the demo report.
- ant html – to produce an HTML file from the demo report.
- ant txt – to produce a TXT file from the demo report.
- Open one of the resulting documents to view, for example
\demo\samples\charts.aw\AreaChartReport.doc in Microsoft Word or another application.