Documentation

    Table of Content
    • 3D File Formats
      • 3D File Formats
      • 3D2
      • 3DS
      • 3MF
      • AMF
      • ASE
      • DAE
      • DRC
      • FBX
      • GLB
      • GLTF
      • IPT
      • JRXML
      • JT
      • OBJ
      • PLY
      • PRC
      • RVM
      • STEP
      • U3D
      • USD
      • USDZ
      • VRML
      • X
      • X3D
    • Audio File Formats
      • Audio File Formats
      • AAC
      • AC3
      • FLAC
      • M3U
      • MID
      • MKA
      • MP3
      • OGG
      • OPUS
      • RA
      • SDT
      • STAP
      • WAV
      • WMA
    • CAD File Formats
      • CAD File Formats
      • CF2
      • DC3
      • DGN
      • DWF
      • DWFX
      • DWG
      • DWT
      • DXF
      • HPGL
      • IFC
      • IGES
      • IGS
      • JVSG
      • NWC
      • NWD
      • NWF
      • PAT
      • PHJ
      • PLT
      • PSM
      • PSS
      • RVT
      • STL
    • Compression File Formats
      • Compression File Formats
      • 7Z
      • ARC
      • ARJ
      • BZ2
      • DAA
      • GZ
      • RAR
      • TAR
      • ZIM
      • ZIP
    • Database
      • Database File Formats
      • ACCDB
      • ACCDE
      • ACCDT
      • ACCFT
      • BAK
      • BCP
      • DDL
      • DTSX
      • LDF
      • MDB
      • MDF
      • MYI
      • NDF
      • NSF
      • SQL
      • SQLITE
    • EBook File Formats
      • EBook File Formats
      • AZW
      • AZW3
      • CBC
      • CBZ
      • EPUB
      • FB2
      • KFX
      • LRF
      • LRS
      • LRX
      • MOBI
      • TR
    • Email File Formats
      • Email File Formats
      • EDB
      • EML
      • EMLX
      • ICS
      • MBOX
      • MSG
      • OFT
      • OLM
      • OST
      • PST
      • TNEF
      • VCF - Virtual Contact File
    • Font
      • Font File Formats
      • CFF
      • CFF2
      • EOT
      • FNT
      • FON
      • JFPROJ
      • OTF
      • PFA
      • PFB
      • PFM
      • SFD
      • TTC
      • TTF
      • Type1
      • WOFF
    • GIS File Formats
      • GIS File Formats
      • E00
      • FileGDB
      • GeoJSON
      • GML
      • GPX
      • KML
      • KMZ
      • OSM
      • SHP
    • Image File Formats
      • Image File Formats
      • AI
      • APNG
      • AVIF
      • BMP
      • BPG
      • CDR
      • CMX
      • CPC
      • DCM
      • DIB
      • DICOM
      • DJVU
      • DNG
      • EMF
      • EMZ
      • EXIF
      • FLIF
      • FODG
      • GIF
      • ICO
      • J2C
      • J2K
      • JFIF
      • JP2
      • JPEG
      • JPF
      • JPM
      • JPX
      • JXR
      • ODG
      • OTG
      • PNG
      • PSB
      • PSD
      • SVGZ
      • TGA
      • TIFF
      • VDX
      • VSD
      • VSDM
      • VSDX
      • VSS
      • VSSM
      • VSSX
      • VST
      • VSTM
      • VSTX
      • VSX
      • VTX
      • WEBP
      • WMF
      • WMZ
    • Note Taking File Formats
      • Note Taking File Formats
      • ONE
      • ONETOC2
    • Page Description Language
      • Page Description Language
      • CGM
      • EPS
      • PCL
      • PS
      • SVG
      • SWF
      • TEX
      • XPS
      • XSLFO
    • PDF
      • PDF
      • PDF/A
      • PDF/E
      • PDF/UA
      • PDF/VT
      • PDF/X
    • Presentation File Formats
      • Presentation File Formats
      • ODP
      • OTP
      • POT
      • POTM
      • POTX
      • PPS
      • PPSM
      • PPSX
      • PPT
      • PPTM
      • PPTX
    • Programming
      • Programming
      • C
      • Class
      • CPP
      • CS
      • CSPROJ
      • Dart
      • H
      • JAR
      • Java
      • KT
      • MF
      • PDB
      • PHP
      • PY
      • SH
      • SLN
      • SWIFT
      • TOML
      • VB
      • VBPROJ
      • VCXPROJ
      • YAML
    • Project Management File Formats
      • Project Management File Formats
      • MPP
      • MPT
      • MPX
      • XER
    • Spreadsheet File Formats
      • Spreadsheet File Formats
      • CSV
      • DIF
      • FODS
      • NUMBERS
      • NUMBERS-TEF
      • ODS
      • OTS
      • SXC
      • TSV
      • XLA
      • XLAM
      • XLM
      • XLS
      • XLSB
      • XLSM
      • XLSX
      • XLT
      • XLTM
      • XLTX
    • Video File Formats
      • Video File Formats
      • 3G2
      • 3GP
      • ASF
      • AVI
      • F4V
      • FLV
      • M4V
      • MJPEG
      • MK3D
      • MKS
      • MKV
      • MOV
      • MP4
      • MXF
      • QT
      • RM
      • RMVB
      • RV
      • SRT
      • VOB
      • VP6
      • WEBM
      • WMV
      • Xvid
    • Web File Formats
      • Web File Formats
      • ASP
      • ASPX
      • CHM
      • CSS
      • HTM
      • HTML
      • IXBRL
      • JS
      • JSON
      • MHT
      • MHTML
      • Sass
      • SCSS
      • VDW
      • XAML
      • XBRL
      • XHTML
      • XML
      • XOML
      • XSLT
    • Word Processing File Formats
      • Word Processing File Formats
      • DOC
      • DOCM
      • DOCX
      • DOT
      • DOTM
      • DOTX
      • MD
      • ODT
      • OTT
      • RTF
      • TXT
    • Reporting
      • RDL
      • RDLC
      • RPL
    1. Home
    2. 3D File Formats
    3. JRXML

    What's on this Page

      • What is a JRXML file?
      • JRXML File Format
        • JRXML Example
      • References

    What is a JRXML file?

    A JRXML file is created by JasperReports and contains design definition in popular XML file format. It stores all the design elements such as report layout, text fields, images, charts, parameters, and variables. JasperReports is a Java library used for creating reports programmatically by retrieving data from backend databases and storage media.

    JRXML File Format

    JRXML files are plain text files that are created based on the XML file format. JasperReport framework can handle different kinds of data sources. When a .jrxml file is compiled, it results in .jasper file as output. A jrxml file consists of a set of sections. Some sections contain information related to the physical characteristics of the page such as dimension of page, positioning of the fields, and the height of the bands, while some concern the logical characteristics such as declaration of the parameters and variables and the definition of a query for data selection.

    JRXML Example

    A simple JRXML file example is shown below.

    <a name="kanchor14"></a><?xml version="1.0" encoding="UTF-8"?>
    <jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports
            http://jasperreports.sourceforge.net/xsd/jasperreport.xsd"
          name="My first report" pageWidth="595" pageHeight="842" columnWidth="535"
          leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20">
      <queryString language="SQL">
        <![CDATA[select * from address order by city]]>
      </queryString>
      <field name="ID" class="java.lang.Integer">
        <fieldDescription><![CDATA[]]></fieldDescription>
      </field>
      <field name="FIRSTNAME" class="java.lang.String">
        <fieldDescription><![CDATA[]]></fieldDescription>
      </field>
      <field name="LASTNAME" class="java.lang.String">
        <fieldDescription><![CDATA[]]></fieldDescription>
      </field>
      <field name="STREET" class="java.lang.String">
        <fieldDescription><![CDATA[]]></fieldDescription>
      </field>
      <field name="CITY" class="java.lang.String">
        <fieldDescription><![CDATA[]]></fieldDescription>
      </field>
    
    <group name="CITY">
        <groupExpression><![CDATA[$F{CITY}]]></groupExpression>
        <groupHeader>
          <band height="27">
            <staticText>
              <reportElement mode="Opaque" x="0" y="0" width="139" height="27"
              forecolor="#FFFFFF" backcolor="#000000"/>
              <textElement>
                <font size="18"/>
              </textElement>
            <text><![CDATA[CITY]]></text>
          </staticText>
          <textField hyperlinkType="None">
            <reportElement mode="Opaque" x="139" y="0" width="416" height="27"
            forecolor="#FFFFFF" backcolor="#000000"/>
            <textElement>
              <font size="18" isBold="true"/>
            </textElement>
            <textFieldExpression class="java.lang.String"><![CDATA[$F{CITY}]]>
            </textFieldExpression>
          </textField>
        </band>
      </groupHeader>
      <groupFooter>
        <band height="8">
          <line direction="BottomUp">
            <reportElement key="line" x="1" y="4" width="554" height="1"/>
          </line>
        </band>
      </groupFooter>
    </group>
    
    <background>
      <band/>
    </background>
      <title>
        <band height="58">
          <line>
            <reportElement x="0" y="8" width="555" height="1"/>
          </line>
          <line>
            <reportElement positionType="FixRelativeToBottom" x="0" y="51" width="555"
                 height="1"/>
          </line>
    
          <staticText>
            <reportElement x=”65” y=”13” width ”424” height=”35”/>
            <textElement textAlignment=”Center”>
              <font size=”26” isBold=”true”/>
            </textElement>
          <text><![CDATE[Classic template]]> </text>
        </staticText>
    </band>
    </title>
      <pageHeader>
        <band/>
      </pageHeader>
      <columnHeader>
        <band height="18">
          <staticText>
            <reportElement mode="Opaque" x="0" y="0" width="138" height="18"
            forecolor="#FFFFFF" backcolor="#999999"/>
            <textElement>
              <font size="12"/>
            </textElement>
            <text><![CDATA[ID]]></text>
          </staticText>
          <staticText>
            <reportElement mode="Opaque" x="138" y="0" width="138" height="18"
            forecolor="#FFFFFF" backcolor="#999999"/>
            <textElement>
              <font size="12"/>
            </textElement>
            <text><![CDATA[FIRSTNAME]]></text>
          </staticText>
          <staticText>
            <reportElement mode="Opaque" x="276" y="0" width="138" height="18"
            forecolor="#FFFFFF" backcolor="#999999"/>
            <textElement>
              <font size="12"/>
            </textElement>
            <text><![CDATA[LASTNAME]]></text>
          </staticText>
          <staticText>
            <reportElement mode="Opaque" x="414" y="0" width="138" height="18"
            forecolor="#FFFFFF" backcolor="#999999"/>
            <textElement>
              <font size="12"/>
            </textElement>
            <text><![CDATA[STREET]]></text>
          </staticText>
        </band>
      </columnHeader>
    

    Following are the details of the example.

    <queryString> − This is empty (as we are passing data through Java Beans). Usually contains the SQL statement, which retrieves the report result.

    <field name> − This element is used to map data from data sources or queries, into report templates. name is re-used in the report body and is case-sensitive.

    <fieldDescription> − This element maps the field name with the appropriate element in the XML file.

    <staticText> − This defines the static text that does not depend on any datasources, variables, parameters, or report expressions.

    <band> − Bands contain the data, which is displayed in the report.

    References

    • JRXML - Wikipedia
    • JRXML Sources and Jasper Files