In previous chapters, the Crystal syntax was used for all formulas. However, formulas in Crystal Reports can be created, edited, and modified using one of two languages. The Crystal syntax is the most used language, but the Basic syntax is also available.
Both languages are equal in their functionalitymeaning that if something was added to Crystal syntax, it was also added to Basic. The reason you're given a choice is for your comfortyou can use whichever language you are more comfortable with using.
Understanding Syntax Differences
The Crystal syntax is most similar to the Pascal or Delphi programming languages. It's not exactly like Pascal, but if you're a Delphi developer or a longtime Crystal Report developer, this syntax is probably your first choice.
The Basic syntax is most similar to Visual Basic as a programming language. If you're a Visual Basic developer, you'll likely find this syntax most beneficial.
Some specific differences between the two languages are described in Table 13.1.
Description |
Crystal |
Basic |
---|---|---|
Variable declarations |
StringVar |
Dim |
Statement endings |
; |
None required |
Comment characters |
// |
' |
Variable assignment |
:= |
= |
Formula statement |
None required |
Required |
Formula returns |
None required |
Return statement |
Multiline statement indicators |
None required |
_ |
If statement ending |
; |
End If |
Why Basic Syntax Was Added
Many functions and operators provided by the Basic language increase the productivity of Crystal Reports users. By implementing the whole language, the existing Crystal syntax users could benefit from the new operators and functions and at the same time, newer users who are familiar with the Basic language through other development endeavors could easily make the jump to creating formulas in Crystal Reports.
Some of the functions and operators that were added as a result of the addition of the Basic syntax are
Selecting the Best Syntax for You
Whether you choose Basic or Crystal syntax, they are both equally capable of doing the job and there is no performance implication in making this choice. The decision is entirely based on the comfort level and familiarity of each language for report designers.
TIP
Whichever syntax you prefer to use most often, you can set it up as the default for all new formulas by going to File, Options, Reporting, and choosing the desired syntax in the Formula Language list box.
Part I. Crystal Reports Design
Creating and Designing Basic Reports
Selecting and Grouping Data
Filtering, Sorting, and Summarizing Data
Understanding and Implementing Formulas
Implementing Parameters for Dynamic Reporting
Part II. Formatting Crystal Reports
Fundamentals of Report Formatting
Working with Report Sections
Visualizing Your Data with Charts and Maps
Custom Formatting Techniques
Part III. Advanced Crystal Reports Design
Using Cross-Tabs for Summarized Reporting
Using Record Selections and Alerts for Interactive Reporting
Using Subreports and Multi-Pass Reporting
Using Formulas and Custom Functions
Designing Effective Report Templates
Additional Data Sources for Crystal Reports
Multidimensional Reporting Against OLAP Data with Crystal Reports
Part IV. Enterprise Report Design Analytic, Web-based, and Excel Report Design
Introduction to Crystal Repository
Crystal Reports Semantic Layer Business Views
Creating Crystal Analysis Reports
Advanced Crystal Analysis Report Design
Ad-Hoc Application and Excel Plug-in for Ad-Hoc and Analytic Reporting
Part V. Web Report Distribution Using Crystal Enterprise
Introduction to Crystal Enterprise
Using Crystal Enterprise with Web Desktop
Crystal Enterprise Architecture
Planning Considerations When Deploying Crystal Enterprise
Deploying Crystal Enterprise in a Complex Network Environment
Administering and Configuring Crystal Enterprise
Part VI. Customized Report Distribution Using Crystal Reports Components
Java Reporting Components
Crystal Reports .NET Components
COM Reporting Components
Part VII. Customized Report Distribution Using Crystal Enterprise Embedded Edition
Introduction to Crystal Enterprise Embedded Edition
Crystal Enterprise Viewing Reports
Crystal Enterprise Embedded Report Modification and Creation
Part VIII. Customized Report Distribution Using Crystal Enterprise Professional
Introduction to the Crystal Enterprise Professional Object Model
Creating Enterprise Reports Applications with Crystal Enterprise Part I
Creating Enterprise Reporting Applications with Crystal Enterprise Part II
Appendix A. Using Sql Queries In Crystal Reports
Creating Enterprise Reporting Applications with Crystal Enterprise Part II