A report can include a number of style templates. Templates provide a mechanism that
allows to reuse styles defined in external files. This enables multiple
reports to share the same visual aspects such as fonts, colors, spacing, etc.
JasperAssistant groups templates under a single Templates
node
in the Outline View
. New templates can be added by using the context
menu associated to this node.
Please see Section 6.4, “Styles” for more details on how to use styles.
Template Properties
Source Expression
Expression that determines the source of the template. Type of the template source is determined by the expression's value class:
java.lang.String
- Template location. First,
the report engine tries to determine whether the String
represents an URL. If not, it tries to interpret the String as a
disk file path. Finally, if the String does not represent a file
path, the template is searched in the CLASSPATH using the String as
a resource path.
java.io.File
- Template is loaded from the
java.io.File
object that represent a file
on disk.
java.net.URL
- Template is loaded from the
location represented by the java.net.URL
object.
java.io.InputStream
- Template is loaded
from a java.io.InputStream
object.
net.sf.jasperreports.engine.JRTemplate
-
Template is supplied directly by the expression as a
net.sf.jasperreports.engine.JRTemplate
object.