Ten tips for Crystal Reports
Some miscellaneous tips to help you get more from CR
Basic operations
-
When using the design tab, zoom to about 120 percent. This will make it easier
to grab the 'handles' of the controls. The design and preview tabs
have independent zoom settings, so changing the zoom in one of them
won't affect the other.
-
To create more space for the report in the design tab, open the Options
dialogue (on the File menu); on the Layout page, enable the 'Short
Section Names' option. This will show an abbreviated version of the
section name in the grey area to left of the design area, thus
leaving more space for the report itself.
Report layout
-
If you have a column of figures which include a currency symbol (such
as £ or $), you will improve the appearance of the report by not
showing the symbol against every figure. Instead, place the symbol
either in the column header or next to the figure on the first row
in each page (to do so, open the field's Format Editor, choose the Number tab,
click on Customize, go to the Currency Symbol page and enable 'One
symbol per page').
-
You can get some interesting visual effects by using the Wingdings font
that comes with Windows. This font includes bullets, arrows, icons
and other fancy characters. To insert one of these characters into a
report, open the Windows Character Map applet, select Wingdings from
the list of fonts, click on the symbol you want, click Select, and
finally click Copy. This will place the symbol in the Clipboard from
where you can paste it into a text object.
Performance
-
You probably
know that you can place fields and other objects inside a text
field. This is useful in mailmerge-style operations, where you want
to merge a value from a database into a piece of text. However, this
technique should be used sparingly - especially with large reports -
as it can greatly slow down the previewing of the report (but it
does not affect the speed of printing or exporting).
-
If you need to view or print a report based on a small subset of data (for
example, if your database table has tens of thousands of records but
you only want to see a few hundred of them), keep your selection
criteria as simple as possible. In particular, avoid using Crystal
formulae in the criteria. If the criteria include Crystal formulae
or any other syntax that the database cannot understand, the
database server will send the entire table across the network, which could
take a long time.
-
Keep in mind that sub-reports can have a bad effect on performance. If
performance is an issue, try to reduce the use of sub-reports as
much as possible.
Formula Editor
-
If you have
difficulty reading the text in the formula editor, open the Options
dialogue (File menu), go to the Editors tab and choose a larger font
size. You can also change the font (only fixed-pitch fonts are
permitted here) and customise the syntax colouring. The choices you
make here also affect the SQL Expression Editor.
-
If you want
to prevent one or more lines of a formula from being executed but
you don't want to delete them (for example, if you want to test the
effect of not running part of the code), turn the lines in question
into comments. To do so, type two forward slashes in front of the
line(s) if you are using Crystal syntax; type a single-quote
character in front of the line(s) if you are using Basic syntax.
Either way, the code will be treated as comments and will not be
executed. To restore the code, simply remove the slashes or the
quote.
-
Going further, if you have a large block of code that you wish to turn into
comments, highlight the block, then either press Alt-M or click the
'Comment / Uncomment Selected Text' button on the toolbar. Repeat
the operation to remove the commenting.
For more advice on using CR, be sure to visit this site regularly.
Mike Lewis Consultants Ltd. January 2004.
These pages are maintained by Mike Lewis Consultants Ltd. as a service to the
CR community. Feel free to download and use any code or components, and to pass around copies of the
articles (but please do not remove our copyright notices or disclaimers).
The information given on this site has been carefully checked and is believed to be correct,
but no legal liability can be accepted for its use. Do not use code, components or techniques
unless you are satisfied that they will work correctly in your applications.
© Copyright Mike Lewis Consultants Ltd.