Review of SQL Commands

Hour 3, "Accessing Your Data," introduced the new SQL Commands feature of Crystal Reports 9. Let's perform a quick review of what this feature is and what advantages it has.

With reports based on tables, views, or stored procedures, Crystal Reports does the dirty work of generating a query in the background. This query incorporates which fields you have used in the report, any sorting or filtering you've applied, and even some calculations. This is one of the strengths of Crystal Reports you need not be an expert at writing SQL to use the product. All that complexity is abstracted away from the user designing the report. However, sometimes the person developing the report is familiar with the SQL language, and perhaps is also the database administrator. In situations like this, these people often want to write their own query. This could be because of several reasons, including

  • An already defined query, which has the required fields, is in use elsewhere.

  • The user wants to optimize her query beyond what Crystal Reports provides "out of the box."

  • The user wants to perform a complex query that is beyond what Crystal Reports automatically generates; for example, a union query.

The SQL Commands feature is meant to address these needs. Rather than adding a table or view to a report, you can add a SQL Command. This command represents a SQL query that you will type in. After this SQL Command is created, it is treated just like a table in that it contains fields that can be used in the report and can be linked to other tables or SQL Commands. For more information on the creation of SQL Commands, see Hour 3.



Sams Teach Yourself Crystal Reports 9 in 24 Hours
Sams Teach Yourself Crystal Reports 9 in 24 Hours
ISBN: B003D7JUVW
EAN: N/A
Year: 2005
Pages: 230

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net