SAP Crystal Reports Tutorial
This SAP Crystal Reports tutorial introduces the core skills required to create, format, filter, group, summarize, and export reports. It is intended for beginners who want to understand how Crystal Reports retrieves data and turns it into structured business reports.
Crystal Reports is a business reporting application from SAP. It can generate reports from SAP and non-SAP data sources, including relational databases, spreadsheets, and other supported connections.
What Is SAP Crystal Reports?
SAP Crystal Reports is used to design formatted, data-driven reports. A report can contain database fields, headings, formulas, groups, totals, charts, subreports, parameters, and conditional formatting.
A typical Crystal Reports workflow includes connecting to a data source, selecting tables or commands, defining relationships, placing fields in report sections, applying filters, and formatting the final output.
What You Will Learn in This SAP Crystal Reports Tutorial
- Crystal Reports interface, report sections, and design views
- Connecting Crystal Reports to databases and other supported data sources
- Selecting tables, views, stored procedures, and SQL commands
- Creating relationships between tables
- Adding database fields, text objects, special fields, and formulas
- Sorting, grouping, filtering, and summarizing report data
- Using parameters and record-selection formulas
- Creating charts, cross-tabs, subreports, and drill-down reports
- Formatting report headers, details, group sections, and page footers
- Exporting reports to supported output formats
- Diagnosing common Crystal Reports data and layout issues
Prerequisites for Learning SAP Crystal Reports
No previous Crystal Reports experience is required. Basic knowledge of tables, rows, columns, and database relationships will make the data-related topics easier to understand.
Familiarity with SQL is useful when working with custom commands, complex filters, stored procedures, or performance tuning, but it is not required for creating basic reports.
SAP Crystal Reports Interface and Report Sections
A Crystal Report is divided into sections. Each section prints at a specific point in the report-processing cycle.
| Crystal Reports section | Purpose |
|---|---|
| Report Header | Appears once at the beginning of the report |
| Page Header | Appears at the top of each printed page |
| Group Header | Appears at the beginning of each group |
| Details | Prints once for each selected record |
| Group Footer | Appears at the end of each group and commonly contains subtotals |
| Page Footer | Appears at the bottom of each page |
| Report Footer | Appears once at the end of the report and commonly contains grand totals |
The Design view is used to position report objects, while Preview shows the report with retrieved data. Some editions also provide additional design or preview options, depending on the environment in which the report is opened.
How Crystal Reports Retrieves Data
Crystal Reports retrieves data through a configured connection. The available connection types depend on the installed database drivers, Crystal Reports edition, and target data source.
After connecting, you can select database objects such as tables, views, stored procedures, or commands. Crystal Reports then reads the available fields and makes them accessible through the Field Explorer.
Common Crystal Reports Data Sources
- Relational databases accessed through supported native, ODBC, or OLE DB connections
- Database views and stored procedures
- Microsoft Excel workbooks and text-based files, when supported by the installed drivers
- SAP application data exposed through supported integration methods
- Custom SQL commands created inside the report connection
Before designing a report, confirm that the data source is stable and that the report user has permission to read the required tables, views, or procedures.
Create a Basic Report in SAP Crystal Reports
The following sequence describes the standard process for creating a basic report.
- Create a new report and choose a suitable report creation method.
- Select or create the required data connection.
- Add the necessary tables, views, stored procedures, or commands.
- Review and correct table relationships before continuing.
- Add fields to the Details section.
- Place column headings in the Page Header section.
- Apply sorting, grouping, and record-selection rules.
- Add summaries such as counts, sums, averages, minimums, or maximums.
- Format field widths, dates, numbers, borders, and section behavior.
- Preview the report and compare the output with the source data.
- Save and export the report when validation is complete.
Build the first version with only the required fields. Additional formulas, charts, and subreports can be added after the underlying data is verified.
Crystal Reports Table Links and Join Types
When a report uses more than one table, the tables must be linked through related fields. For example, a customer identifier in a customer table may link to the same identifier in an orders table.
An incorrect link can cause duplicate records, missing records, or inaccurate totals. Always inspect the links created automatically by Crystal Reports and change them when they do not match the intended data model.
| Join type | Report behavior |
|---|---|
| Inner join | Returns records that have matching values in both linked tables |
| Left outer join | Returns every record from the left table and matching records from the right table |
| Right outer join | Returns every record from the right table and matching records from the left table |
| Full outer join | Returns matching records and unmatched records from both tables when supported |
The available join behavior can vary by connection and database. Test the resulting record set before adding summaries or charts.
Add Fields and Objects to a Crystal Report
The Field Explorer provides access to the objects that can be placed in the report. Common object categories include database fields, formula fields, parameter fields, running totals, SQL expression fields, group name fields, and special fields.
- Database fields: values retrieved directly from the connected data source
- Text objects: labels, headings, and static explanatory text
- Formula fields: calculated or conditionally displayed values
- Parameter fields: values supplied by a user or calling application
- Special fields: page numbers, print dates, report titles, and related report metadata
- Summary fields: aggregate values such as totals and averages
Place repeating values in the Details section. Place labels in a header section and totals in the appropriate group or report footer.
Sort and Group Data in Crystal Reports
Sorting controls the order in which records appear. Grouping divides records into logical sections and makes it possible to add group headers, group footers, subtotals, and drill-down behavior.
For example, a sales report may group records by region and then sort customers alphabetically within each region. A subtotal can be placed in each Region Group Footer, while the grand total can be placed in the Report Footer.
Choose a grouping field that represents the business level users expect to analyze. Avoid grouping by highly unique fields unless each record genuinely requires its own group.
Filter Records with Crystal Reports Selection Formulas
Record selection determines which rows are included in the report. You can define selection rules through the Select Expert or by editing the record-selection formula.
A filter may limit records by date, status, customer, department, region, product, or another field. Use parameters when the filter value should be supplied at runtime.
{Orders.Status} = "Open"
The example represents a record-selection condition that keeps only records whose order status is Open. Actual table and field names depend on the connected database.
Whenever possible, use conditions that the database can evaluate during data retrieval. This can reduce the number of records transferred to Crystal Reports.
Use Parameters in SAP Crystal Reports
A parameter is a value supplied when the report runs. Parameters can control filtering, formulas, titles, formatting, sorting, or other report behavior.
- Date-range parameters for beginning and ending dates
- Customer, employee, department, or region parameters
- Boolean parameters that enable or disable optional report content
- Dynamic parameters whose available values come from report data
- Multi-value parameters that allow more than one selection
Define the parameter’s data type carefully. A date parameter should be compared with a date field, while a numeric parameter should be compared with a compatible numeric field.
Create Formula Fields in Crystal Reports
Formula fields calculate values, combine text, apply conditional logic, convert data types, or control display behavior. Crystal Reports supports its formula language and, in applicable environments, a Basic-style syntax option.
The following formula combines a first name and last name while adding a space between them.
{Customer.FirstName} + " " + {Customer.LastName}
A conditional formula may return different text depending on a field value.
If {Orders.TotalAmount} >= 1000 Then
"High Value"
Else
"Standard"
Replace the sample table and field names with names from your own report. Check for null values when the source field can be empty, because null handling can affect formula results.
Add Summaries and Running Totals in Crystal Reports
Summary fields calculate aggregate values for a complete report or a group. Common summary operations include sum, count, distinct count, average, minimum, maximum, and percentage-based calculations.
Running totals are useful when a value must accumulate conditionally or reset at a specific point. A running total can be configured to evaluate for selected records, reset when a group changes, and display in a footer.
| Calculation | Typical Crystal Reports use |
|---|---|
| Sum | Total sales, quantities, costs, or balances |
| Count | Number of records in a report or group |
| Distinct count | Number of unique customers, products, or transactions |
| Average | Average order value, score, duration, or quantity |
| Running total | Cumulative values or totals that reset by group |
Place a group summary in the corresponding Group Footer. Place an overall report total in the Report Footer unless the required layout calls for a different section.
Create Charts and Graphs in Crystal Reports
Charts provide a visual summary of grouped or summarized data. The available chart types can include bar, line, pie, area, and other chart formats, depending on the Crystal Reports environment.
A chart generally requires an “on change of” field and a summarized value. For example, a chart may display total sales on change of region.
- Use a bar chart to compare values across categories.
- Use a line chart to show change across a sequence such as dates.
- Use a pie chart only when a small number of categories form a meaningful whole.
- Keep chart labels readable and avoid displaying more categories than the chart can communicate clearly.
- Verify that chart totals match the corresponding report summaries.
Build Cross-Tab Reports in Crystal Reports
A cross-tab summarizes data in a matrix. One field defines the rows, another defines the columns, and one or more summary fields populate the intersecting cells.
For example, a cross-tab may show regions in rows, months in columns, and total sales as the summarized value. Cross-tabs are useful when users need to compare categories across two dimensions.
Place a cross-tab in a section that matches its required scope. A cross-tab in the Report Header or Report Footer can summarize the full report, while a cross-tab inside a group section can summarize that group.
Use Subreports in SAP Crystal Reports
A subreport is a report placed inside another report. It can use the same data source as the main report or a different supported data source.
Subreports may be linked to the main report through one or more fields. A linked subreport typically receives a value from the main report and uses it to filter its own records.
- Use an on-demand subreport when the content should be retrieved only after a user opens it.
- Use a linked subreport when the subreport must display records related to the current main-report record or group.
- Avoid placing an expensive subreport in the Details section unless it is necessary, because it may run repeatedly.
- Check whether a table link, command, or revised data model can replace the subreport more efficiently.
Format Crystal Reports Sections and Fields
Report formatting includes field placement, fonts, borders, alignment, number formats, date formats, section height, page breaks, suppression, and conditional formatting.
- Use consistent date, time, and numeric formats.
- Align numeric values by place value and text fields by their reading direction.
- Suppress empty sections where they create unnecessary blank space.
- Use conditional formatting to emphasize exceptions, not every value.
- Keep repeated headings in the Page Header when they must appear on each page.
- Use the Keep Together and New Page Before or After settings carefully to prevent unexpected blank pages.
Preview the report with short and long field values. A layout that works for sample data may truncate values when production data is longer.
Export Reports from SAP Crystal Reports
Crystal Reports can export report output to supported file formats. Available formats depend on the edition, runtime, and installed export components.
Common export targets can include PDF, spreadsheet formats, word-processing formats, rich text, plain text, and delimited data. The result may differ by format because page-oriented exports preserve layout differently from data-oriented exports.
| Export goal | Suitable format type |
|---|---|
| Preserve the printed page layout | Page-oriented format such as PDF |
| Analyze report data in rows and columns | Spreadsheet or data-oriented format |
| Edit report text in a document | Supported word-processing or rich-text format |
| Transfer simple field values | Delimited or text-based format |
Always test the selected export format. Merged cells, page headers, group sections, formulas, charts, and subreports may not translate identically across every format.
Improve SAP Crystal Reports Performance
Report performance depends on the database query, record count, table links, formulas, subreports, grouping, and the location where calculations are performed.
- Select only the fields and records required by the report.
- Apply restrictive record-selection conditions as early as possible.
- Verify that linked database fields use compatible data types and appropriate indexes.
- Avoid unnecessary tables and subreports.
- Use database-side views, commands, or stored procedures when complex processing is better handled by the database.
- Check whether formulas prevent conditions from being evaluated by the database.
- Test performance with realistic production-size data rather than a small sample.
Use the generated SQL inspection tools available in the report environment, where applicable, to understand what Crystal Reports sends to the database.
Common SAP Crystal Reports Problems
| Problem | What to check |
|---|---|
| Duplicate rows | Table links, one-to-many relationships, and repeated detail records |
| Missing rows | Join type, record-selection formula, parameter values, and null handling |
| Incorrect totals | Duplicate records, summary scope, grouping, and evaluation time |
| Blank report | Connection credentials, filters, parameter values, and source data |
| Database login prompt | Saved connection information, runtime credentials, server name, and driver availability |
| Formula error | Field data types, null values, syntax, and formula evaluation order |
| Unexpected blank pages | Section width, page size, margins, hidden objects, and page-break settings |
| Slow report | Record volume, filters, commands, subreports, joins, and database execution plan |
SAP Crystal Reports Editorial QA Checklist
- Confirm that all report fields come from the intended tables, views, commands, or procedures.
- Compare the report’s selected record count with a trusted source query.
- Verify table links and join types against the actual database relationships.
- Test every parameter with valid, empty, boundary, and multi-value inputs where applicable.
- Check group subtotals and the grand total independently.
- Confirm that formulas handle nulls, dates, and numeric conversions correctly.
- Validate that charts and cross-tabs use the same filtered data as the report body.
- Test page breaks, repeated headers, suppression rules, and long text values.
- Open each exported file and verify layout, data, totals, and page count.
- Run the report with production-scale data to identify performance issues.
SAP Crystal Reports Frequently Asked Questions
Is SQL required to learn SAP Crystal Reports?
No. You can create basic reports by selecting tables and fields through the Crystal Reports interface. SQL knowledge becomes useful when working with commands, stored procedures, complex joins, database-side filtering, and performance analysis.
What is the difference between a Crystal Reports formula and a parameter?
A parameter receives a value when the report runs. A formula calculates or returns a value by using fields, constants, parameters, functions, and conditional logic.
Why does a Crystal Report show duplicate records?
Duplicate records commonly result from one-to-many table relationships, incorrect table links, or multiple matching rows in a joined table. Inspect the database relationships before hiding duplicates through report formatting.
When should a subreport be used in Crystal Reports?
Use a subreport when the required data cannot be represented conveniently through the main report’s tables, groups, or formulas, or when separate report logic must be embedded in the main report. Consider performance before placing a subreport in a repeating section.
Why does an exported Crystal Report look different from Preview?
Each export format handles report sections, page layout, merged cells, charts, and repeated headers differently. Use a page-oriented export when preserving the printed layout is the main requirement and test the final file before distribution.
SAP Crystal Reports Tutorial Summary
SAP Crystal Reports converts data from supported sources into formatted reports. The main skills are connecting to data, defining correct table links, selecting records, grouping data, creating formulas and parameters, adding summaries, and validating the final output. Start with a simple report, confirm the source data, and then add charts, cross-tabs, subreports, and advanced formatting as required.
TutorialKart.com