Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Interact with the SQL statements

Status
Not open for further replies.

neozeke

Programmer
Oct 6, 2008
31
0
0
US
Hi,

I was planning to have my SQL interact with the Crystal Reports XI parameters.

Sample:
select field from table where field = <crystal reports xi parameter>

is this possible?

Thanks.
 
Are you trying to use the SQL Command feature in Crystal? Yes, you can use a Crystal parameter with SQL.

1) go to your Database Expert, ODBC connection
2) click on Add Command, a new screen "Add Command to Report" will pop up
3) type in your select statement (query)
4) on the right side of the pop up screen, you will see a small window called "Parameter List"
5) Create your parameter there and select it in your query

You are done!
 
One rather severe limitation with those parameters: you can't reference them in the report. So if you have start and end date parameters in the SQL - they are not available to print on the report to tell what dates the report was run for.
 
Charliy,

That is not true. Parameters created within a command appear in the parameter list just as would a parameter created in the usual way, and they can be displayed using the same techniques.

-LB
 
I've tried it in XI and they did not appear in the list of parameters when I tried to make a formula appending them into something usable like "For the Period "&{?Start Date}&" thru "&{?End Date}
 
Change it to

"For the Period "& totext({?Start Date},"MM/dd/yyyy")&" thru "& totext({?End Date},"MM/dd/yyyy")
 
I use XI as well, and am able to reference parameters created within a command. Are you sure you are not thinking of parameters in stored procedures?

-LB
 
My point is they were not visible while in the formula editor.
 
Just tested to make sure, and they are visible in both the formula editor in the field explorer and in the record selection formula. There are some formula areas (e.g., customize group name) where parameters are not available, but that would be true whether they were created in a command or not.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top