DynamicReports automatically looks for a file named dynamicreports-defaults.xml on startup.
In this file you can change the default settings (default font, pattern and horizontal alignment for all data types).
<?xml version="1.0" encoding="UTF-8"?> <DynamicReports> <!-- DEFAULT FONT --> <font fontName="SansSerif" fontSize="10" pdfFontName="Helvetica" pdfEncoding="Cp1252" pdfEmbedded="false"/> <!-- DEFAULT DATA TYPES --> <bigDecimalType pattern="#,##0.00#" horizontalAlignment="RIGHT"/> <dateType pattern="MM/dd/yyyy" horizontalAlignment="RIGHT"/> ... </DynamicReports>Copy this file in the root of the classpath.
DynamicReports is synchronized with Maven Central Repository.
Add the dependencies listed below to your pom.xml configuration file.
<dependency> <groupId>net.sourceforge.dynamicreports</groupId> <artifactId>dynamicreports-core</artifactId> <version>5.1.0</version> </dependency> <dependency> <groupId>net.sourceforge.dynamicreports</groupId> <artifactId>dynamicreports-adhoc</artifactId> <version>5.1.0</version> </dependency> <dependency> <groupId>net.sourceforge.dynamicreports</groupId> <artifactId>dynamicreports-googlecharts</artifactId> <version>5.1.0</version> </dependency>
In some situations, maven may have a problem with downloading the itext-2.1.7.js6 dependency to your local maven repository. The problem may happen because the library itext-2.1.7.js6 is not available in maven central repository, it is only available through JasperReports maven repository. If you are behind a firewall check if the firewall is not blocking that repository link or download the dependency and add it to your repository manually.
To use the development snapshots of DynamicReports, change your pom.xml configuration:
just update the dynamicreports-core version
<dependency> <groupId>net.sourceforge.dynamicreports</groupId> <artifactId>dynamicreports-core</artifactId> <version>5.1.1-SNAPSHOT</version> </dependency> <dependency> <groupId>net.sourceforge.dynamicreports</groupId> <artifactId>dynamicreports-adhoc</artifactId> <version>5.1.1-SNAPSHOT</version> </dependency> <dependency> <groupId>net.sourceforge.dynamicreports</groupId> <artifactId>dynamicreports-googlecharts</artifactId> <version>5.1.1-SNAPSHOT</version> </dependency>
and add the Sonatype Nexus snapshot repository
<repositories> <repository> <id>sonatype-nexus-snapshots</id> <name>Sonatype Nexus Snapshots</name> <url>https://oss.sonatype.org/content/repositories/snapshots</url> <releases> <enabled>false</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </repository> </repositories>