Solved

Crystal Reports 11 command parameters

Posted on 2011-02-16
4
601 Views
Last Modified: 2012-08-13
How do Crystal Reports 11 commands work exactly? Commands look like database tables during a report setup. Are these command/tables recreated in their entirety each time a report table link points to a command?

Within Crystal Reports 11, is it possible to automatically and variably populate a command parameter from the main report?
0
Comment
Question by:BuddyTo
4 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 34909948
Commands are like a database stored procedure.

The command is run each time the report is opened just as a stored procedure is or a view is run.

Not sure what you are getting at with
--   is it possible to automatically and variably populate a command parameter from the main report?

mlmcc
0
 
LVL 26

Accepted Solution

by:
Kurt Reinhardt earned 500 total points
ID: 34911132
1)  A command is conceptually the same as a stored procedure - it must be executed 100% before most other Crystal Reports functionality.  That's not really the same as a view, which is simply treated by Crystal like any other table (it's simply materialized at runtime). Generally speaking, if you're using a command as a data source for your report then it should be the only data source.

2)  A command parameter needs to be created inside the command explicitly as opposed to normal Crystal Reports parameters that are created in the Field Explorer.  Once you've created the command and it's parameters, you can edit the parameter in the field explorer and append a list of values to it.  Those values, however, will be static. You can't make them dynamic, which is what it sounds like you're asking for.

Is there a specific reason you're using a command where regular tables or a view won't work?

~Kurt
0
 

Author Closing Comment

by:BuddyTo
ID: 35031134
Thank you for your answer.
I am using commands because my connection to the target database is restricted to Crystal only. No SQL views, stored procedures, other languages, etc, are allowed.
If commands allowed "dynamic" parameter passing, then a command could act like a sub report AND could be placed on a sub report... a sub report on a sub report. This would help solve some fairly complex report problems I have involving nested bills of materials and my need for recursive reports.
0
 
LVL 34

Expert Comment

by:James0628
ID: 35042965
 > If commands allowed "dynamic" parameter passing, then a
 > command could act like a sub report AND could be placed
 > on a sub report... a sub report on a sub report.

 I'm not sure what you're suggesting.  A Command parameter can be "dynamic" in that it can be passed different values.  For example, you could have a subreport that uses a Command that has a "part code" parameter and reads data for that part code, and a main report that reads a list of part codes.  The main report executes the subreport for each part code, and passes the part code to the parameter in the subreport, which uses that part code in the Command.

 But a Command is a datasource.  It's not "placed on" a report.  So I don't know what you were getting at there.

 Also, FWIW, a dynamic parameter in CR is one that gets the list of default values from a query, but someone/something still has to choose values from that list.  So, that kind of dynamic parameter doesn't really seem relevant/useful here.

 James
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question