I am currently working on a project designing a suite of reports for a new client, using SQL Server Reporting Services and a customerised Microsoft CRM system.
Obviously over time the number of reports will increase, and it is so easy to forget why the report was designed in the first place.
Adding comments to designed reports is really good practice for a number of reasons including:
- Documenting the work and amendments as one goes along, makes it easier for others to work on the reports at a later date.
- Creating a clear understanding and logic used when writing SQL Statements and formulas
- They act as reminders of what and why things were done, if they have to be reworked and/or amended at a later date.
Luckily there are features and methods within Crystal Reports, Crystal Xcelsius and SQL Server Reporting Services that can be used to make life easier for designers.
Commenting in Crystal Reports
To Add Comments to Reports, from the File menu select Summary Info:
These comments can be viewed when the report is opened in the Open dialog box, and the Properties button is selected:
Using a Text Box
Another method would be to add report comments to text boxes and add them to either the Report header and/or Report footer sections.
To make sure that they could only be visible in the Design View, suppress the Text box, by:
- Right click on the object - Format Text, or
- Select the Textbox Object, from the Format menu select Format Text
- In the Format Editor dialog box, select the Common Tab
- Select the Suppress checkbox
Adding Comments to Formulas
To Add comments to formulas, within the Formula Editor, for:
- Crystal Syntax - type two forward slashes (// )before the text.
- Basic Syntax - type an apostrophe (') before the text.
This turns the font colour green, and Crystal Reports knows that the following text is comments, and not part of the formula:
Commenting in SQL Server Reporting Services
To Add Comments to Reports, from the Reports menu select Report Properties:
Using a Text Box
Another method would be to add report comments to text boxes and add them to either the Page Header and/or Page Footer sections.
To make sure that they could only be visible in the Layout View, suppress the Text box, by:
- Right clicking on the Textbox object - Properties
- In the Textbox Properties dialog box, select the Visibility Tab
- Select the Initial Visibility - Hidden radio button option
Adding Comments to SQL Statements
There are 2 ways of commenting SQL Statements. To add comments to SQL statements:
- A single line or part of a line of SQL type: --
- Multiple lines of SQL at the beginning type: /** and at the end type **/:
Commenting in Xcelsius
To add comments to dashboards, from the File menu select Document Properties: