Some Useful Settings in JasperReports Server

Published on
4,064 Points
2 Endorsements
Last Modified:
Doug Walton
DBA for the site that connects you with people and information to solve problems, inspire learning and influence the future of technology.
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
If you're setting up a Jasper Server instance these settings and file locations should come in handy.  It's not super obvious where you can find how to change all this in the handbook, so I've compiled a list of the ones I ended up changing for my instance here.

The file locations depend on where your Jasper Server is running tomcat (For example, /usr/share/tomcat7/).  Below, I'll specify all the file locations starting with $TOMCAT_HOME.  Also, all the below file locations are assuming you're using Jasper Server Pro, if you're using the normal Jasper Server replace "jasperserver-pro" with "jasperserver."

Also it's worth mentioning after changing these files tomcat should be restarted to make the changes take effect.  If anyone is currently logged into the server when you restart tomcat they'll have to login again, which will probably stop any reports they were running.

Password Settings

This file contains some password/security settings for allowing users to change their password, setting a password expiration, and allowing autocomplete on the login form.  Open this file then look for the following lines.

<property name="allowUserPasswordChange" value="true"/>
<property name="passwordExpirationInDays" value="90"/>
<property name="autoCompleteLoginForm" value="true"/>

Open in new window


Default Date and Time Formats

If your system/company uses a different format than what is showing up in your Jasper Server instance, this is the place to change it.

# Used for parsing and formatting dates by server
datetime.format=yyyy-MM-dd HH:mm:ss

# Used for parsing and formatting dates by calendar component (UI).
# Pattern for date should match appropriated pattern from server properties.
# The format for calendar component can be combinations of the following:
# d  - day of month (no leading zero)
# dd - day of month (two digit)
# o  - day of year (no leading zeros)
# oo - day of year (three digit)
# D  - day name short
# DD - day name long
# m  - month of year (no leading zero)
# mm - month of year (two digit)
# M  - month name short
# MM - month name long
# y  - year (two digit)
# yy - year (four digit)
calendar.datetime.format=yy-mm-dd HH:mm:ss

Open in new window

Enabling Datatypes

By default several datatypes aren't supported (CLOB, BLOB).  This is where you can enable them and define the default java class to assign to them.

<property name="jdbc2JavaTypeMapping">
                <!--entry key="ARRAY" value=""/-->
                <entry key="BIGINT" value="java.lang.Long"/>
                <!--entry key="BINARY" value=""/-->
                <entry key="BIT" value="java.lang.Boolean"/>
                <entry key="BOOLEAN" value="java.lang.Boolean"/>
                <entry key="BLOB" value="java.lang.String"/>
                <entry key="CHAR" value="java.lang.String"/>
                <entry key="CLOB" value="java.lang.String"/>
                <entry key="DATE" value="java.util.Date"/>
                <entry key="DECIMAL" value="java.math.BigDecimal"/>
                <!--entry key="DISTINCT" value=""/-->
                <entry key="DOUBLE" value="java.lang.Double"/>
                <entry key="FLOAT" value="java.lang.Float"/>
                <entry key="INTEGER" value="java.lang.Integer"/>
                <!--entry key="JAVA_OBJECT" value=""/-->
                <!--entry key="LONGVARBINARY" value=""/-->
                <entry key="LONGVARCHAR" value="java.lang.String"/>
                <!--entry key="NULL" value=""/-->
                <entry key="NUMERIC" value="java.math.BigDecimal"/>
                <entry key="OTHER">
                        <entry key="NVARCHAR2" value="java.lang.String"/>
                        <entry key="uuid" value="java.lang.String"/>
                <entry key="REAL" value="java.lang.Double"/>
                <!--entry key="REF" value=""/-->
                <entry key="SMALLINT" value="java.lang.Short"/>
                <!--entry key="STRUCT" value=""/-->
                <entry key="TIME" value="java.sql.Time"/>
                <entry key="TIMESTAMP" value="java.sql.Timestamp"/>
                <entry key="TINYINT" value="java.lang.Byte"/>
                <!--entry key="VARBINARY" value=""/-->
                <entry key="VARCHAR" value="java.lang.String"/>
                <entry key="NVARCHAR" value="java.lang.String"/>
                <entry key="ARRAY" value="java.lang.String"/>

Open in new window

Enabling Oracle Synonyms

You might not need this, but if you're wondering why some objects aren't showing up in your domain designer you might need to make sure this is set to true.

      <property name="includeSynonymsForOracle">
            <!-- set 'true' if you use Oracle synonyms in Domains  -->

Open in new window


Max Execution Time and Max Result Set Rows

Sometimes reports take a long time to run or return a lot of data.  If you're getting errors about timing out or too many result set rows, you can change those limits here.

        <property name="maxAvailableValues" value="10000"/>
        <property name="tempFolderUri" value="/temp"/>
        <property name="defaultFolderUri" value="/adhoc/topics"/>
        <property name="maxExecutionTimeSec" value="360"/>
        <property name="maxResultSetRows" value="200000"/>

Open in new window


Turning Off Domain Validation

I don't recommend doing this permanently unless your jasper server instance is painfully slow when trying to save changes to the domain.  This will make it so it skips turning off the initial domain checker, but it should still run when you click the final submit button (skips the check on the first submit button).

            2014-12-05  thorick
            Note:  skipping Domain Database Validation will also turn off domain schema Advanced Joins Complex Joins validation
        <property name="skipDomainDatabaseValidation" value="true"/>

Open in new window


File Type Export Options

This is where you can specify export options for each file type.  I found this when I was trying to figure out why my borders and images weren't showing up in excel reports.

<!--export parameters-->
<bean id="xlsExportParameters" class="com.jaspersoft.jasperserver.api.engine.jasperreports.common.XlsExportParametersBean">
    <property name="detectCellType" value="true"/>
    <property name="onePagePerSheet" value="true"/>
    <property name="removeEmptySpaceBetweenRows" value="true"/>
    <property name="removeEmptySpaceBetweenColumns" value="true"/>
    <property name="whitePageBackground" value="false"/>
    <property name="ignoreGraphics" value="false"/>
    <property name="collapseRowSpan" value="false"/>
    <property name="ignoreCellBorder" value="false"/>
    <property name="fontSizeFixEnabled" value="true"/>
    <property name="maximumRowsPerSheet" value="0"/>
    <property name="xlsFormatPatternsMap" ref="formatPatternsMap"/>
  <bean id="odsExportParameters" class="com.jaspersoft.jasperserver.api.engine.jasperreports.common.OdsExportParametersBean" parent="xlsExportParameters"></bean>
  <bean id="csvExportParameters" class="com.jaspersoft.jasperserver.api.engine.jasperreports.common.CsvExportParametersBean">
    <property name="fieldDelimiter" value=","/>
  <bean id="pdfExportParameters" class="com.jaspersoft.jasperserver.api.engine.jasperreports.common.PdfExportParametersBean"></bean>
  <bean id="txtExportParameters" class="com.jaspersoft.jasperserver.api.engine.jasperreports.common.TxtExportParametersBean">
    <property name="characterWidth" value="10"/>
    <property name="characterHeight" value="10"/>
    <property name="pageHeight" value="100"/>
    <property name="pageWidth" value="80"/>
  <bean id="pptxExportParameters" class="com.jaspersoft.jasperserver.api.engine.jasperreports.common.PptxExportParametersBean">
    <property name="ignoreHyperlink" value="false"/>
  <bean id="jsonMetadataExportParameters" class="com.jaspersoft.jasperserver.api.engine.jasperreports.common.JsonMetadataExportParametersBean"></bean>
  <util:map id="formatPatternsMap">
    <!--entry key="$ #,##0.00" value="$ #,##0.00"/-->
  <!--end export parameters-->

Open in new window

Hope this helps!
Author:Doug Walton

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Join & Write a Comment

This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Suggested Courses

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month