Crystal Reports Online Training

Learn Online, Anytime, Anywhere

Step-by-step online tutorials.

A.34 Tutorial A-3 Single Year Income Statement, Part 3

There is one last change that needs to be made to the report. If you recall, one of the rules of the income statement is that all balances must be shown as positive. Even though the expenses reduce the revenue balance and have negative values, the standard format of the income statement requires that they be shown as positive numbers. However, if we modify the {@Amount} formula to reverse the sign of the balances, this will make them positive numbers and the running total field will be incorrect. Luckily, Crystal Reports gives us a way to change the sign of a number without affecting how it is used in calculations. This is done with the Format Editor dialog box. The option called Reverse For Display lets you flip the sign of a number without changing the underlying value used in calculations. This option was added primarily for use in financial reports such as this.

  1. Right-click on the summary field in the group #2 footer and select Format Field. This opens the Format Editor dialog box.
  2. Click on the Number tab and click the Customize button. This opens the Custom Style dialog box.
  3. Near the bottom of the dialog box is the Reverse Sign For Display option. If you click this button, will reverse the signs for the sub-totals of all the classes. But, we don’t want to select this because it would reverse the sign for the revenue accounts as well. That would make it look like the company lost money, when in fact, it made money. We have to use conditional formatting to reverse the sign only for the expense accounts.
  4. Click on the Formula button to open the Formula Workshop dialog box.
  5. Enter the following formula:

{Account_Type.Account Type} = “Expense”

  1. Click the Save and Close button to save your changes.
  2. We need to do the same for balance in group #3 so that if the user drills-down on the data then the signs match.
  3. Right-click on the summary field in the group #3 footer and select Format Field. This opens the Format Editor dialog box.
  4. Click on the Number tab and click the Customize button. This opens the Custom Style dialog box.
  5. Click on the Formula button to open the Formula Workshop dialog box.
  6. Enter the following formula:

{Account_Type.Account Type} = “Expense”

  1. Click the Save and Close button to save your changes.
  2. You are now finished with the income statement (congratulations!). Preview the report and it should look similar to Figure A-12.



Figure A-12. Income statement final version.