Reporting Guide

04a. Import a Crystal report

If you already have Crystal Reports (.rpt) files, you do not have to start from a blank screen. The Import a Crystal report wizard reads a report's design and builds a starting point for you:

  • a recipe (the groups, totals, formulas, selection and charts)
  • a Word template (the layout, rebuilt in Word)
  • a data file (the rows saved in the report, your own CSV, or made-up sample rows)
  • a conversion report that lists what carried over and what did not

Nothing is dropped silently. Anything the wizard cannot convert is listed in the conversion report so you can rebuild it by hand.

Before you start: the wizard reads the report's design. It does not connect to the report's database, and your file is not kept. If you have not met recipes and templates yet, read 01 How it works first.


1. Open the wizard

In Word, go to Data > Builder and choose Import a Crystal report > Open. The wizard has five steps:

Step What you do
1. Choose a report Drag a .rpt file onto the box, or choose it with the button. To convert several reports at once, choose or drop more than one (see section 7)
2. What we found Check the summary of the report's tables, groups, selection and objects. No passwords or logins are shown
3. Your data Choose where the rows come from (see below)
4. Match columns Only appears if you bring your own CSV
5. Review and download Read the conversion report, look at the preview, and download the zip

2. Where the rows come from

A report is a design. To make documents, the template needs rows. Choose one:

Choice Use it when Things to know
The rows saved in the report The report was saved with data (Crystal's "Save Data with Report") The rows are the data as it was when the report was last saved. They may be private or out of date, so check before sharing
A CSV file of my own You have current data The wizard asks you to match each report column to a column in your file. It shows how sure it is: Looks right, Probably, A guess or No match. Check the guesses
Realistic made-up rows The report has no saved rows, or you only want to see the layout You choose how many rows. The results carry a yellow MADE UP badge, and the zip includes a ReportData.MOCK.txt note. Replace the made-up rows with real data before you use the documents

Real saved rows are never replaced by made-up ones.


3. Review and download

The review step shows:

  • a short verdict on the conversion
  • the conversion report, in sections, listing what carried over and what did not
  • a preview of the first rows of data
  • a Download button for a zip

The zip contains:

File What it is
recipe.json The recipe: groups, subtotals, totals, formulas, selection and charts
template.docx The Word template with the rebuilt layout
ReportData.csv The rows
conversion-report.md and conversion-report.json What carried over, what did not, and why
ReportData.MOCK.txt Only present when the rows are made up

What to do next

  1. Unzip the file.
  2. Open template.docx in Word to see the layout the report became.
  3. Add ReportData.csv as a data file in DataPublisher (Data > Files).
  4. In Summaries & Charts, open recipe.json and run it over the template (lesson 9 in 02 Your first report).
  5. Read conversion-report.md, and rebuild anything it lists as not converted (see 04 Coming from Crystal Reports).
  6. Compare the totals with your original Crystal output before you rely on it.

4. What converts

In your Crystal report In DataPublisher
Saved rows (joined tables arrive already flattened) ReportData.csv
Record selection such as {Customer.Country} = "China", including ranges, lists and OR on one field, and every prompt the report asks Recipe parameters (text, choices, ranges, optional prompts) and filters. The default is the original value
Groups (up to 4 levels), monthly date groups and hierarchical groups A grouped layout. Hierarchical groups become ordinary groups, with a note
Sort fields, and groups ordered by a total or in descending order The layout's sort and group order
Top N / Bottom N groups The layout's group order plus top
Group selection (keep only groups whose total meets a test) having on the layout or summary table. A subtotal is added if the report did not show the total
"Suppress if duplicated" Suppress repeats
Group-footer Sum, Avg, Min, Max, Count Layout subtotals
Report-footer summaries Totals, shown under the table
Report header text, field headings, number and date types Template title, table headings, right-aligned numbers, currency and date formatting
An ungrouped list A Word table with one repeating row
Formula fields, including ones the report defines but does not show Computed columns, translated from Crystal syntax
Running totals on the detail line, including a reset at a group Layout running columns
A cross-tab with one row field and one column field A cross-tab with totals
Bar, pie, doughnut, area and line charts over a category A summary table plus a chart. A "top N" group sort becomes the table's top-N
A report of groups and their sums only One summary table row per group
Subreports Converted like a report of their own into the same recipe, with their own data file and listing after the main listing. A linked subreport is grouped by its linking field
Page header and footer Word header and footer parts. Constant label formulas in the page header become the table headings
Joined tables A second recipe (recipe-dataset.json) that joins the report's tables, plus the tables as separate CSV files for a Data Set
The report's look The template takes the report's font, size, landscape or portrait, paper size, column widths, alignment, bold, colour and number formats
More summary functions Distinct count, median, mode, standard deviation and variance

Formulas that translate

Arithmetic, joining text with & or +, comparisons, And, Or, Not, If-Then-Else, IIf and Select Case, local variables used in a straight line, text, fields and other formulas, and report parameters used by the selection or a formula. These functions are supported: UpperCase, LowerCase, Trim, Length, Left, Right, Mid, Replace, ToText, CDbl, CCur, ToNumber, Val, Round, Abs, IsNull, Year, Month, Day, DateDiff, CDate and Date(y,m,d). ToText with a number format string such as "0.00" is not translated.


5. What does not convert

These are listed in the conversion report instead of being dropped. The list is shorter than it was, but it is not empty:

  • Formulas that use loops, shared variables, Mod, In, Like, StartsWith, ElseIf chains, or functions with no equivalent (such as DayOfWeek, Truncate and Switch), and formulas written in Basic syntax
  • Running totals that depend on a formula or a condition
  • Group selections that are not a total compared with numbers, and OR conditions across different fields in a selection
  • Percent-of-sum summaries
  • Chart types with no equivalent: gauge, funnel, radar, scatter, stock, Gantt, surface, bubble and histogram, plus charts built on a cross-tab
  • A "bottom N" or "top N" filter on a listing that has detail lines (the layout shows every group)
  • ToText with a number format string such as "0.00"
  • More than 4 group levels and non-monthly date groups (recipes have week, half-year and day-of-week buckets, which you can set by hand)

Boxes and lines are approximated rather than listed as needing a person. Read conversion-report.md for the exact items in your report: it is the list that counts.

6. Good to know

  • Layout is rebuilt, not copied. The template carries the report's fonts, sizes, page setup, column widths and number formats, but not its exact positions. Expect to touch up the page in Word, and compare the totals first.
  • Joins. The saved rows are already the joined result, so ReportData.csv stays flat. The importer also splits the rows back into the report's tables and writes a second recipe that joins them, so a Data Set that links those tables can run the report. The conversion report says how to link them.
  • A grouped layout always shows a Count column and a Total for <group> row.
  • Made-up rows are invented. They follow the column names and the report's selection, and nothing more. They are for checking the layout, not for sending to anyone.
  • Upload limit: 25 MB per report.
  • The zip is a download. The wizard does not yet save the template, data and recipe into your account for you.

7. Many reports at once

Choose or drop several .rpt files in step 1. One file works as before. Two or more is a batch:

  • Each report is converted one after another, with the same choices as a single import (saved rows where the report has them, otherwise made-up rows). Matching a report to your own CSV needs a person per report, so it stays in the single import.
  • You get one line per file: Done, Done, with notes or Could not be converted, with the counts of items converted, approximated and needing a person, the row count (marked MADE UP when invented), a Download for that report's zip and its details.
  • Each report's zip is exactly the zip a single import gives.
  • Download all makes one zip with every finished report's zip plus batch-summary.md and batch-summary.csv.
  • At most 50 files at a time. If the server is busy the wizard waits and tries again. A report that cannot be read never stops the rest. Stop ends the run after the current report.

Next: 04 Coming from Crystal Reports for the concept map and what to rebuild by hand.