RPT File Documentation
Summary
A .rpt file is usually a Crystal Reports File, the proprietary binary report definition created by SAP Crystal Reports. It stores a report’s layout, its data-source connection, formulas and grouping, and optionally a cached snapshot of the queried rows. It is a template that re-renders, not a flat data table. Open it with the free SAP Crystal Reports Viewer (Windows) to view, print or export to PDF or Excel; its MIME type is application/octet-stream.
Technical details
| Feature | Value |
|---|---|
| Full name | SAP Crystal Reports File |
| File extension | .rpt |
| MIME type | application/octet-stream |
| Format type | Proprietary binary report definition (layout, data source, formulas; optional saved data) |
| Developer | SAP (originally Crystal Services, then Seagate Software / Business Objects) |
| Introduced | Crystal Services, 1991; extension in continuous use since the early 1990s |
| Container | OLE / compound-document style binary container |
| Byte order | Little-endian (Windows binary) |
| Magic number | No single published signature; detected by embedded Crystal Reports strings |
| Open standard | No (closed, vendor-controlled) |
| Holds report data | Only if “saved data” was stored; otherwise layout + connection only |
| Primary application | SAP Crystal Reports (Designer); SAP Crystal Reports Viewer (free, read-only) |
| Export targets | .pdf, .xls/.xlsx, .doc/.rtf, .csv, text |
| Related extensions | .rptr, .rpttheme, .pdf, .xls |
| Also seen as | Plain-text report/log; OrCAD/EDA report (unrelated, readable text) |
| Platform | Windows (no native macOS or Linux build) |
| Specification | SAP Crystal Reports (closed) |
What is an RPT file?
A .rpt file is, in its dominant meaning, a Crystal Reports File: the binary report definition written by SAP Crystal Reports. Crystal Reports began at Crystal Services in 1991, passed through Seagate Software and Business Objects, and is now owned by SAP. The .rpt extension has stayed constant across all of those owners. The word “rpt” is just an abbreviation of “report”, which is why several unrelated programs also emit .rpt files as plain-text logs (Cadence OrCAD netlist and DRC reports, various diagnostic tools). Those are readable text; a Crystal .rpt is binary. This article is about the Crystal Reports file.
The single most important fact about a Crystal .rpt is that it is a report definition, not a database and not a flat data export. It describes how to lay out a report and where to get the data, and it can optionally carry a cached snapshot of that data. When you open it, a viewer re-renders the report from the layout plus whatever saved data is inside; the full Designer can throw the cached data away and re-query the live source. That distinction — template that renders versus file that simply is the data — drives everything else about how the file behaves.
The compound binary container
A Crystal .rpt is a proprietary binary file laid out in an OLE structured-storage (compound document) style, the same broad family of container Microsoft used for legacy .doc and .xls. That means the file is not a single linear stream but a set of named internal streams and sub-storages, each holding one part of the report. SAP has never published the byte-level layout, so third-party code cannot reliably parse a .rpt without Crystal’s own engine or SDK.
There is no single, official leading magic number the way PNG has 89 50 4E 47. File-type detectors identify a Crystal report by the literal ASCII string Crystal Reports embedded near the start of the container and by the recognisable internal stream names, rather than by a fixed four-byte signature at offset 0. If you run a .rpt through a hex viewer you will see compound-document markers and scattered readable strings (field names, formula text, the connection string) surrounded by binary. If instead the whole file reads as clean text, it is one of the non-Crystal “report” files and only needs a text editor.
Report layout: sections, groups and formatting
The layout is the visual skeleton of the report and the largest conceptual part of the file. Crystal organises a report into horizontal sections that print in a fixed order: report header, page header, group header(s), details, group footer(s), report footer, and page footer. The details section repeats once per row returned by the data source; the group headers and footers wrap runs of rows that share a grouping key. The .rpt stores each section’s height, its suppression and page-break rules, and every field, text object, line, box and image placed inside it, with coordinates in twips (1/1440 inch) rather than pixels.
Formatting is stored per object and can be static or driven by a formula. A field’s font, colour, border, number/date format mask and conditional visibility are all part of the layout, so two reports over the same query can look completely different. Because coordinates are resolution-independent twips, the same .rpt renders consistently to screen, to a printer, and to a PDF export.
The data-source connection
A Crystal report does not contain a database; it contains a description of how to reach one. The .rpt stores the connection metadata: the driver or provider (ODBC, OLE DB, JDBC, a native client, or a direct file source), the server and database names, and the exact SQL query or stored-procedure call the report runs, plus the field list the layout binds to. This is why moving a report to a new environment often means “Set Datasource Location” rather than editing the layout.
Two consequences follow. First, a saved connection can embed credentials, so a .rpt handed around casually may leak how to connect to a production database. Treat report files as confidential. Second, a report can be built against one source and pointed at another with the same schema, which is how the same layout serves development, test and production databases.
Formulas, parameters and grouping
Beyond fields pulled straight from the query, a report holds computed objects. Formula fields are written in Crystal’s own formula language (Crystal syntax, or a Basic-style syntax) and can compute derived values, format strings, or evaluate conditions used elsewhere for suppression and colour. The formula text is stored in the file and compiled by the engine at run time. Parameter fields declare prompts the user answers before the report runs (a date range, a region), and the answers feed the query’s record-selection formula so the database returns only matching rows.
Grouping and sorting are also part of the definition: the report records which field or formula groups the details, the sort direction, and any group-level summaries (sum, count, average, running total). Subreports — whole reports embedded inside a section of the main one, each with its own query — are stored inside the same container and run against their own data source when the parent renders.
Saved data versus refresh
A report can be saved with or without a cached copy of its last result set. When “save data with report” is on, the queried rows are frozen into the .rpt as saved data. The practical effect is large: a report saved with data opens and displays instantly in a viewer with no database connection at all, showing exactly the numbers captured when it was saved. A report saved without data is just the definition, and it will try to connect and query the moment it is opened.
The free SAP Crystal Reports Viewer is a read-only, no-refresh tool: it renders classic-designer reports from disk, using the saved data if present, but it will not re-query a live source. The full Crystal Reports Designer can refresh, which discards the cached rows, re-runs the query, and repopulates the report with current data. So “the numbers in this report are out of date” and “this viewer can’t refresh” are two faces of the same saved-data mechanism.
Rendering and export to PDF, Excel and CSV
Because a .rpt is a definition rather than a finished document, sharing it with someone who lacks Crystal is done by exporting a rendered copy, not by converting the file. Inside the viewer or Designer, Export produces a PDF that preserves the exact page layout, a Microsoft Excel workbook (formatted, or data-only for a clean grid), a Word/RTF document, or a CSV/text dump of the row data. The layout-preserving exports (PDF) map cleanly; the tabular exports (CSV, Excel data-only) keep the detail rows but drop the page design, since a grid has no concept of a group footer band.
There is no reliable offline, file-to-file converter that reads a binary Crystal .rpt without Crystal’s engine, because the format is undocumented and the “report” only exists once the engine has combined layout, formulas and data. Web tools advertising a standalone “RPT to PDF converter” are a common source of adware; the dependable path is SAP’s own free viewer plus its Export dialog.
Why some .rpt files open as readable text
If you double-click a .rpt and a text editor shows tidy, human-readable content — a netlist, a design-rule-check listing, a build log — you do not have a Crystal report. Several EDA and engineering tools, most notably Cadence OrCAD PCB Designer, write their output as plain-text .rpt files, and many diagnostic utilities save summaries the same way. These share only the extension with Crystal Reports; they have no compound-document container, no embedded Crystal Reports string, and no report definition. The quick test is exactly this: a binary Crystal .rpt is gibberish in Notepad, while a text-report .rpt is perfectly readable and needs nothing but an editor.
FAQ
Is a Crystal .rpt the same as a database file?
No. A .rpt stores the report layout plus a description of where to get data, not the data store itself. Even a report saved with data holds only a frozen snapshot of one result set, not a queryable database. The database lives elsewhere — in a server, or in a file such as .db/.sqlite or a server’s .mdf.
Why does a Crystal .rpt have no fixed magic number?
It is built as an OLE compound document rather than a format with a published single-purpose header, and SAP has never released the byte layout. Detectors therefore key off the compound-document markers and the embedded Crystal Reports string instead of a fixed signature at offset 0.
References
- SAP — Crystal Reports product page
- Crystal Reports history (Crystal Services / Seagate / Business Objects / SAP)
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.