Crystal Reports Online Training

Learn Online, Anytime, Anywhere

Step-by-step online tutorials.

A.35 Tutorial A-4 Multi-Year Income Statement, Part 1

Tutorial A-4. Multi-Year Income Statement

This tutorial walks you through the steps of creating a multi-year income statement. It uses the cross-tab object to display multiple columns which summarize the account balances for each year. Using a cross-tab object for the income statement is fairly complex and is going to require advanced formatting techniques. You should be very comfortable with all the concepts covered in the cross-tab chapter to make sure you get the most out of this tutorial.

  1. Open the “Income Statement Template.rpt” report that you created in Tutorial A-2.
  2. Save it as Income Statement MultiYear.rpt so that you don’t accidentally overwrite the template report.
  3. Resize the Report Header section so that it is a couple of inches tall.
  4. Click on the cross-tab object in the menu bar and place it in the report header to the far left.
  5. Right-click on the top left corner of the cross-tab object and select Cross-Tab Expert.
  6. The first step is to add the two formulas that will be the rows in the cross-tab object. Each one has to group on the numeric ID field, but display the text field in the cross-tab.
  7. In the Available Fields list, click on the formula @Section ID and move it to the Rows list.
  8. Click on the @Section ID formula in the Rows list and then click the Group Options button.
  9. Select the Options tab and select the option Use a Formula As Group Name.
  10. Click the Formula button to open the Formula Workshop dialog box.
  11. Enter the following formula:

{@Section Name}

  1. Click the Save and Close button to save your changes.
  2. Click the OK button to return to the Cross-Tab Expert.
  3. In the Available Fields list, click on the formula @Account Class ID and move it to the Rows list. It should now be directly below the @Section ID formula.
  4. Click on the @Account Class ID formula in the Rows list and then click the Group Options button.
  5. Select the Options tab and select the option Use a Formula As Group Name.
  6. Click the Formula button to open the Formula Workshop dialog box.
  7. Enter the following formula:

{@Account Class}

  1. Click the Save and Close button to save your changes.
  2. Click the OK button to return to the Cross-Tab Expert.
  3. The next step is to select the date field that will be summarized in the columns.
  4. In the Available Fields list, click on the field Journal_Entry.Date and move it to the Columns list.
  5. Click on the Journal_Entry.Date field in the Columns list and then click on the Group Options button.
  6. At the bottom of the dialog box, click on the drop-down box for The Column Will Be Printed and choose For Each Year. This will summarize the date column for each year.
  7. Lastly, we need to add the field that will be summarized in the cross-tab.
  8. In the Available Fields list, click on the @Amount formula and move it to the Summarized Fields list.
  9. To make sure that you have added the fields correctly, Figure A-13 shows what your Cross-Tab Expert dialog box should look like.



Figure A-13. Cross-Tab Expert field selections.

  1. If everything looks good, click the OK button to save your changes for the Cross-Tab Expert.
  2. A preview of your report should look like Figure A-14.



Figure A-14. Income Statement first draft.

  1. This report has the basic structure of the income statement, but it still needs a lot of work before we are finished with it.