Skip to Content

The Best Little Known Features of Crystal Reports 2008 – Part 4

Multi-Value Parameters to SQL Commands

SQL Command Objects are very useful as they allow a report designer to enter a custom SQL statement to use as the data query for the report.  Any part of the SQL statement can be parameterized using Command Object Parameters.  New to Crystal Reports 2008 is the ability to pass a multi-value parameter to SQL Commands.  For example, I have created a SQL command with the following text: SELECT * FROM Customers WHERE country in {?Countries List}

I have also created “Countries List” as a Command Object Parameter and set the “Allow multiple values” checkbox.  Now when I run the report I will be prompted to enter in one more many countries.  These countries are then formatted and placed into the placeholder area {?Countries List} of the SQL Command.

 By using this feature to call a stored procedure from within your SQL command, you can also pass multi value parameters to stored procedures as well.

 Henry, Crystal Reports Product Manager

1 Comment
You must be Logged on to comment or reply to a post.
  • I’d really be interested in how I can pass a multi-value parameter to a stored procedure. Up to now, I did not find a way to do it.