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.
- Right-click on the summary field in the group #2 footer and select Format Field. This opens the Format Editor dialog box.
- Click on the Number tab and click the Customize button. This opens the Custom Style dialog box.
- 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.
- Click on the Formula button to open the Formula Workshop dialog box.
- Enter the following formula:
- Click the Save and Close button to save your changes.
- 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.
- Right-click on the summary field in the group #3 footer and select Format Field. This opens the Format Editor dialog box.
- Click on the Number tab and click the Customize button. This opens the Custom Style dialog box.
- Click on the Formula button to open the Formula Workshop dialog box.
- Enter the following formula:
- Click the Save and Close button to save your changes.
- You are now finished with the income statement (congratulations!). Preview the report and it should look similar to Figure A-12.