JRPRINT File Documentation
Summary
A JRPRINT (JasperReports Print File) is the finished output of a JasperReports report: the template already filled with data, laid out into concrete pages, and saved as a serialized Java object (a net.sf.jasperreports.engine.JasperPrint instance). It normally begins with the Java serialization header bytes AC ED 00 05. It is not a document you read directly; open a .jrprint in the free Jaspersoft Studio or a Java program using the JasperReports library, then export it to PDF, Excel, HTML or CSV.
Technical details
| Feature | Value |
|---|---|
| Full name | JasperReports Print File |
| File extension | .jrprint |
| MIME type | application/octet-stream |
| Format type | Serialized Java object (JasperPrint instance) |
| Java class | net.sf.jasperreports.engine.JasperPrint |
| Developer | Jaspersoft (Cloud Software Group; formerly TIBCO) |
| Introduced | 2001, with the JasperReports library |
| Magic number | AC ED 00 05 (Java serialization stream) |
| Byte order | Big-endian (Java stream convention) |
| Alternate form | Compressed, or XML (.jrpxml) depending on export |
| Runtime required | Java (JasperReports engine) |
| Opened with | Jaspersoft Studio; JasperReports library (JRLoader) |
| Exports to | PDF, XLS/XLSX, HTML, CSV, RTF, DOCX, ODT, TXT, XML |
| Stage in pipeline | Rendered output (after fill), not the design |
| Open standard | No (proprietary object; library is open-source LGPL) |
| Related extensions | .jrxml, .jasper, .jrpxml |
| Specification | community.jaspersoft.com/documentation/ |
What is a JRPRINT file?
JasperReports is a long-running open-source Java reporting library, first released in 2001 and now maintained by Jaspersoft (part of Cloud Software Group, after the TIBCO ownership era). A JRPRINT file is one specific artefact from its pipeline: the finished, data-filled report, saved to disk. It is not a template and not a document format in the usual sense. It is a serialized Java object, an instance of the class net.sf.jasperreports.engine.JasperPrint, written out with Java’s object serialization so it can be reloaded later and exported without re-running the report.
That is why a .jrprint cannot be double-clicked and read: it is a snapshot of live Java objects, meaningful only to the JasperReports runtime that created it. The sections below place it in the three-stage JasperReports pipeline, explain what the serialized JasperPrint object actually contains, describe the Java serialization stream it is stored in, cover how it is loaded and exported, and address the real security caveat that comes with any serialized Java object.
jrxml, jasper and jrprint: the three-stage pipeline
JasperReports separates report design from report output, and each stage has its own file. Confusing the three is the single most common source of trouble.
design compile fill (with data)
.jrxml --> .jasper --> JasperPrint --> .jrprint
XML compiled in-memory serialized
template template filled report filled report
The designer writes a report template as a .jrxml file, human-readable XML describing bands, fields, expressions and styling. The library compiles that template into a .jasper file, a compiled form (also a serialized object) that loads faster and validates the expressions. At run time the engine fills the compiled template: it runs the report’s queries against a database or other data source, evaluates every expression, and lays the results out into concrete pages. The in-memory result of that fill is a JasperPrint object, and serialising it to disk gives the .jrprint. So a JRPRINT is static and final: the data is already merged and the layout already computed, unlike the .jrxml/.jasper template which still needs data to produce anything.
Inside the JasperPrint object: pages and print elements
The serialized object is a tree rooted at the JasperPrint instance. Rather than storing report logic, it stores the fully resolved result: absolute positions, concrete text, and rendered graphics.
JasperPrint
├─ report properties page width/height, orientation, margins, name
├─ styles named JRPrintStyle definitions (fonts, colours)
├─ fonts font settings referenced when rendering
└─ pages[] one JRPrintPage per output page
└─ elements[] positioned print elements:
JRPrintText a text field at (x, y, w, h) with its value
JRPrintLine a line
JRPrintRectangle a box / border
JRPrintImage an embedded image
JRPrintFrame a container grouping other elements
Each page is a list of print elements, and every element carries its own absolute coordinates and size, because pagination has already happened. A JRPrintText holds the actual string to draw plus its box; a JRPrintImage holds the rendered picture; a JRPrintFrame groups children. The object also references the styles and font settings needed to draw them. Because everything is resolved to positioned elements, an exporter can walk the pages and paint them into any target format without touching the original data source again. This is exactly the appeal of saving a .jrprint: an application can fill a slow report once, cache the print object, and export it to different formats later without re-querying the database.
The Java serialization stream
A .jrprint is stored using Java’s built-in object serialization, so its bytes follow the Java Object Serialization Stream Protocol rather than any JasperReports-specific layout.
stream header
AC ED STREAM_MAGIC
00 05 STREAM_VERSION (version 5)
then content elements, each tagged by a type byte (0x70-0x7E):
TC_OBJECT, TC_CLASSDESC (class name + serialVersionUID + fields),
TC_STRING, TC_ARRAY, TC_REFERENCE (back-reference to an earlier object) ...
The first four bytes are AC ED 00 05: STREAM_MAGIC then STREAM_VERSION. After the header the stream is a sequence of typed records that describe classes (a TC_CLASSDESC names the class, its serialVersionUID and its fields) and the objects themselves, with back-references (TC_REFERENCE) used so a repeated object is written once. This is a general Java mechanism, which has two consequences for JRPRINT. First, the file is version-sensitive: a class whose serialVersionUID changed between JasperReports releases can fail to deserialize cleanly, so a .jrprint is best read with a compatible library version. Second, JasperReports may write the print object compressed, or as XML (a .jrpxml), so the AC ED signature is typical but not guaranteed for every exported print file.
Loading and exporting a print file
Because the format is tied to the runtime, opening a .jrprint means handing it back to JasperReports. Jaspersoft Studio, the free Eclipse-based designer that replaced the discontinued iReport Designer (end of life 2015), opens the file in its report viewer and exports it from a menu. Programmatically, a Java application reloads and exports it directly.
// reload the serialized JasperPrint
JasperPrint print = (JasperPrint) JRLoader.loadObject(new File("report.jrprint"));
// export to PDF
JasperExportManager.exportReportToPdfFile(print, "report.pdf");
JRLoader.loadObject deserializes the object; JasperExportManager and the various exporter classes then render it. Each output format has its own exporter: JRPdfExporter for PDF (the most common target), JRXlsxExporter for Excel, HtmlExporter for a web page, JRCsvExporter for plain tabular text, and JRDocxExporter/JRRtfExporter for Word-compatible output. CSV and plain-text exports discard the layout and keep only field values, while PDF and DOCX preserve the positioned pages. There is no third-party viewer outside this ecosystem, which is the practical reason people convert a .jrprint to PDF as soon as they receive one.
Frequently asked questions
What is the difference between .jrxml, .jasper and .jrprint?
.jrxml is the report design, an XML template. .jasper is that template compiled. .jrprint is the report after it has been filled with data: a serialized JasperPrint object holding the concrete, laid-out pages ready to print or export. The first two still need a data source to produce output; a .jrprint already contains the finished result.
Can I open a .jrprint without Java?
Not really. The file is a serialized Java object that only the JasperReports engine can reconstruct, and that engine is Java. Without it there is no generic viewer. The practical solution is to ask whoever produced the file to export it to PDF or Excel, which are readable anywhere.
References
- JasperReports Library — source and documentation (GitHub)
- Jaspersoft Studio — the free report designer and viewer
- Oracle — Java Object Serialization Stream Protocol
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.