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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

pass parameters to command object parameters

Status
Not open for further replies.

bodev

Technical User
Mar 5, 2012
15
US
Hi All,

SCENARIO:
I have a report that contains a command object besides some database tables. I do not have the command object linked to any tables. I have 3 parameters in the report that I require the user to enter.

ISSUE:
Is there a way that I can pass these 3 parameters to the command object?

Please help.

Thank you.
 
Yes. You have to create the parameters in the command editor instead of in the report itself. Then you'll use the parameters in your command using standard Crystal syntax with quotes around the parameter if it's a string:

MyTable.MyStringField = '{?MyStringParam}'
or
MyTable.MyNotStringField = {?MyNotStringParam}

If you've already created the params in your report, you'll need to delete them prior to adding them to the command.

-Dell

DecisionFirst Technologies - Six-time SAP BusinessObjects Solution Partner of the Year
 
Hi Dell,

thanks for your reply. Perhaps, I should have mentioned earlier that I have some conditions in record selection for this report and I m using the report parameters in there as well. So, once I delete the report parameters and create them in my command object, can I still use them in my record selection?

Thanks.
 
Yes. The will be available as regular parameter. However, I would try to push as much of your selection criteria into the command as you can. When you use a command and you have selection criteria in the report instead of in the command, Crystal will pull all of the data into memory and then filter it there instead of having the database do the filtering. This will slow down your report.

-Dell

DecisionFirst Technologies - Six-time SAP BusinessObjects Solution Partner of the Year
 
i can certainly bring the selection criteria into the command object SQL, but the issue is that I m using database tables for this report besides the command object and the command object is not Linked to the tables. If I move the selection criteria to the command object which is not Linked to the tables then i m afraid that data from the database tables is not going to be restricted. Is my concern appropriate?

The reason i thought of the command object is that i needed a count based on some condition and I was going to check off a box if the count was more than a certain number.
 
Can you link the command to the tables? Or can you bring the table data into the command? Generally, combining tables and commands in a report is not a good idea because it will significantly slow down your report. With a combination of a command and anything else, Crystal will pull all of the data into memory and do the join there instead of pushing it down to the database. This is not that big a deal if you're dealing with just a few rows, but can be an issue if you're pulling lots of data.

-Dell

DecisionFirst Technologies - Six-time SAP BusinessObjects Solution Partner of the Year
 
Instead of using the Command, you may want a SQL Expression. That may be able to give you the Count you are looking for.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top