The GetCrystalQueryPreview and GetCrystalQueryPrint templates both accomplish the exact same task. They retrieve the SQL Query that is sent to the SQL data source. The difference between these two templates is that GetCrystalQueryPreview is used in conjunction with the PreviewCrystalReport template and GetCrystalQueryPrint is used in conjunction with the PrintCrystalReport template.

These templates call the Crystal8.Query method. For more information on these methods refer to the ABC Library Reference, Crystal8 class.


There templates require the PreviewCrystalReport or the PrintCrystalReport template respectively.

Populating the Template

1. From an embed point, press the Insert button and select either the GetCrystalQueryPreview or GetCrystalQueryPrint template.

Template Prompts

These templates provides the following prompts:

Target Variable

Specify a valid variable to store the retrieved SQL query. This may be a STRING, CSTRING, PSTRING, or MEMO data type. The variable may be a local, module, or global variable. You may also use a file field; however, you must write the code to update the file. This variable is required.