Crystal Reports Online Training

Learn Online, Anytime, Anywhere

Step-by-step online tutorials.

A.32 Tutorial A-3 Single Year Income Statement, Part 1

Tutorial A-3. Single Year Income Statement

This tutorial walks you through the steps of creating an income statement that only displays a single year. It places all the report objects within the report designer so that you can format them however you wish. Since an income statement only shows summary data for each account class, we will give it drill-down capabilities where the user can get the balance of individual accounts within each class.

  1. Open the “Income Statement Template.rpt” report that you created in Tutorial A-3.
  2. Save it as Income Statement Single Year.rpt so you don’t accidentally overwrite the template report.
  3. Since the template report has all the formulas already created, let’s place them on the report for the first draft of the income statement. Even though the income statement only shows two groups, we are going to add a third group and hide it. This allows the user to drill down into the details of each account class.
  4. For group #1, click the Insert Group button (or select the menu option Insert > Group). Select the formula {@Section ID}, but don’t click the OK button yet.
  5. We don’t want to display the section number on the report. Instead, we want to display the section name. Click the Options tab and click the option Use Formula as Group Name. This opens the Formula Workshop dialog box. For the formula, enter the following text:

{@Section Name}.

  1. Click the Save and Close button to save the changes.
  2. Click the OK button to save your changes for group #1.
  3. For group #2, click the Insert Group button. Choose the formula {@Account Class ID}, but don’t click the OK button yet.
  4. For this group, we don’t want to display the account class number on the report. Instead, we want to display the class name. Click the Options tab and click the option Use Formula as Group Name. This opens the Formula Workshop dialog box. For the formula, enter the following text:

{@Account Class}.

  1. Click the Save and Close button to save the changes.
  2. Click the OK button to save your changes for group #2.
  3. For group #3 (the drill-down group), click the Insert Group button. Choose the field {Account.Account Number}, but don’t click the OK button yet.
  4. For this group, we don’t want to display the account number on the report. Instead, we want to display the account name. Click the Options tab and click the option Customize Group Name Field. In the drop-down box choose the field {Account.Account Name}.
  5. Click the OK button to save your changes for froup #3.
  6. When you create a new group, Crystal Reports automatically puts the group name in the header section. However, we want all groups to show the total balance and this can only be done in the footer section. We need to move the group names out of the header sections and put them in the corresponding footer sections.
  7. Move the group #1 name field to the group #1 footer section.
  8. Suppress the group #1 header section so that it doesn’t use any space.
  9. Move the group #2 name field to the group #2 footer section.
  10. Click on the group #2 name and click on the Bold button to turn off the bold formatting.
  11. Suppress the group #2 header section so that it doesn’t use any space.
  12. Move the group #3 name field to the group #3 footer section.
  13. Click on the group #3 name and click on the Bold button to turn off the bold formatting.
  14. Suppress the group #3 header section so that it doesn’t use any space.
  15. Hide the group #3 footer section. This keeps the individual accounts from being displayed.
  16. Suppress the Details section so that it isn’t visible.
  17. Preview the report and it should look similar to Figure A-10.



Figure A-10. Income statement preview with groups.

With the exception of not having any balances listed, the report preview looks really good. The proper account categories are within each section and the section names are listed after the categories. Now, let’s show the balances on the report.