Crystal Reports

This article was originally published in VSJ, which is now part of Developer Fusion.
Most developers will have encountered Crystal Reports at some point in their programming career. It has been bundled with Visual Studio, and is well regarded in its own right for creating reports for a variety of databases. Crystal Reports is now under the ownership of Business Objects, and the development work continues. Crystal Reports 10 has recently been released, with a variety of improvements including increased support for Java and a managed repository to assist with sharing of report designs.

You should be able to find a version of Crystal Reports to suit your needs, no matter what type of application you want to develop. There’s the familiar reporting engine that you can bundle with your desktop apps; the ability to run reports for the Web on your Web server; and a report server that interacts with multi-tier applications via Web services. Crystal Reports can also be integrated with Visual Studio .NET, or run as a standalone package.

Crystal Reports 10 incorporates systems to ease the building of common database management operations
Crystal Reports 10 incorporates systems to ease the building of common database management operations

Enterprise Repository

The addition of the repository is the most visible of the changes to Crystal Reports. If you’ve been using the appropriate version of Crystal Reports 9, you’ll already have a repository, but it’s been changed in version 10 to the Crystal Enterprise repository, which offers managed report writing and maintenance, as well as a repository explorer that lets you search for a particular report and filter the results based on object types and text values. The repository can be used to store report objects such as text objects, SQL commands, bitmaps, and custom functions and formulae.

While the repository is great news if you’re working in an environment where you’re likely to want to share reports and manage large projects, reports are the whole reason behind Crystal Reports, and the report designer itself has also received attention. This version has better report viewing and handling of user interactions. Users have more control over the way they export reports to Excel, and they can also print reports directly from the DHTML viewer when looking at their reports on the Web. The WebForm viewer has also been improved with more facilities for you to have a custom appearance of your forms.

For Java developers, the most important change will probably be the addition of the Java reporting component. This is a 100% Java version of Crystal Reports reporting engine. Version 10 also includes an upgrade to the Java Reporting Component bundled in Borland JBuilder X and BEA WebLogic Workshop. Another improvement for Java programmers is the introduction of a custom Java tag library that should reduce the amount of coding you need to integrate your reports into JSP pages.

Other changes that developers should find useful are designed to simplify the process of integrating reports into .NET, Java, and COM web applications. The .NET element of this comes from a reduction in the number of merge modules that you need to deploy .NET applications. There are now four core merge modules that cover eight potential ways you are likely to deploy Windows applications, ASP.NET applications, and web service applications.

Broad data driver options

Over the years Crystal Reports has developed a great range of data drivers, not just for databases, but for more exotic file formats. The current list of data drivers clocks in at 35, with ODBC, OLE DB, and JDBC options for connecting to the big name databases such as SQL Server, DB2, and Oracle, alongside OLAP and XML. You also get JavaBeans, ADO.NET, and COM Data Providers for those situations where you want more control. While Crystal Reports will of course make use of queries or stored procedures in the databases, you can also write your own SQL commands or use Crystal’s own query designer.

New in this release is the data abstraction layer. As the name suggests, this sits between users and their enterprise data sources. The idea is that the database administrators who know the most about the data sources, their structures, which tables need to be joined for a particular view, etc, set up the details as a business view. The business views can then be used to provide the data for reports without the report designer knowing all the gory details of the underlying data structures.

In the drive to make Crystal Reports ever easier to use, you get an increasing range of facilities to help you – experts, wizards, and sample reports to show the type of reports you might create. The experts and wizards can be used to simplify tasks such as connecting to a data source, selecting, grouping, sorting, and summarising data.

Reporting powerhouse

Crystal offers a variety of more exotic reports in addition to the normal banded reports – top N, cross-tabs, reports with conditional sections. You can also create asymmetric reports of OLAP grids, hiding the data dimensions that aren’t relevant so users can concentrate on the information they need to know about. You can also make use of a selection of maps and charts in your reports. The more exotic chart types include doughnut, gantt, gauge, and (new in this release) funnel in addition to more common versions such as bar, line and XY scatter. Funnel charts are similar to pie charts, but look like a funnel, and are apparently popular in CRM type applications. If you want to use maps, you get a choice ranging from a worldwide map down to city level in a range of major countries including the UK, though France is the only other European country included at this level. Others have only the country level maps.

Some of the more interesting options offered by Crystal Reports are based on the idea that you shouldn’t rely on your users noticing important information. For example, you can design the reports to produce alerts when certain conditions are met in your reports. So if the sales of a particular product reach record levels, you can have a message appear so there’s no danger the person viewing the report will miss that fact. You can also set up navigation paths between objects on a report or on several reports so you can ensure that there’s a good chance the report’s users will see what they ought to see. Finally, you can also set up hyperlinks so that the people viewing the reports can easily find relevant related web sites, documents or other reports.

You also get a good range of choices to ensure your users can see the report in the format they prefer. The choices start with ‘standard’ formats including Excel, PDF, XML, HTML, and RTF, or you can provide either server-side or thin-client report viewers for more exotic choices. There’s a DHTML page (WebForms) viewer, a .NET WinForms viewer, a Java viewer, ActiveX, and Report Part viewer that can be used to show reports on mobile devices. This latter option lets you format your reports so they make sense on WML phones, Blackberry devices, or Compaq iPAQs, by showing specific report elements – charts, summary tables, or individual record details, for example.

In addition to exporting the report as RTF or Excel format, you can also set up reports within Microsoft Office XP using Smart Tags to insert report objects such as charts or tables into Office applications such as Word, Excel or Outlook, so that your users can view and refresh their reports without ever leaving their familiar working environment.

There is a 30-day trial download available so you can try out Crystal Reports for yourself, but be warned, it runs to over 800MB if you want the report designer and the repository, and another 100MB if you also want to test the embedded version.

Managing the presentation of data is a strength of Crystal Reports 10
Managing the presentation of data is a strength of Crystal Reports 10

Conclusion

If you’re using Crystal Reports 9, much of Crystal Reports 10 will be pretty familiar. The repository is improved; the Java support has increased, and there are some nice tweaks to the designer, but none of it is revolutionary. Perhaps the most important message that this version provides is that development work is continuing under the new management of Business Objects.

If you’ve not seen Crystal Reports for a couple of versions, however, this release does show a lot of changes. The reports you can create using Crystal Reports stand up to anything else your users might see. They look good with maps, charts and any layout you choose. You can provide alerts, display the reports on websites, in Office, on mobile devices. Essentially, you can provide the types of reports your users expect and give them the info how they want it, where they want it.

You might also like...

Comments

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“PHP is a minor evil perpetrated and created by incompetent amateurs, whereas Perl is a great and insidious evil perpetrated by skilled but perverted professionals.” - Jon Ribbens