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

parameter question

Status
Not open for further replies.

Tailgun

Technical User
Mar 30, 2002
417
US
I have a report using Crystal 8.5 instead of writing a second report exactly like the first except for adding a parameter, can you write the parameter then have it suppressed for one report then using the calling VB app unsuppress it and use it for another version of the same report ? Or can you add a parameter dynamicly when it is called ? I hope this makes sense to someone :):)
 
I wasn't aware of this forum Crystal Decisions: Crystal Reports 1 Formulas till today and posted the question there and it was resolved.
 
My mistake :( this hasn't been resolved. It was an earlier post about formula probs that was resolved
 
Instead of dynamically adding and removing the parameter, why don't you only build the report with the parameter in it, and pass a value of, say, "XXX" to the parameter from the VB script when you don't want the parameter to be evaluated.

Then, in your select criteria, have something along the lines of:

If {?MyParameter} = "XXX" Then True
Else {?MyParameter} = {Field}

You can conditionally suppress the parameter where it appears in the report based on the XXX value.

Naith
 
Thanks for all the help from this forum. Its working fine now thats to everyone.
 
Hi!

The above parameter passing worked fine but i have one more question like i put that in formula and i wanted it to pass in the where clause in the SQL Query to improve the performance.... It would be great if somebody can help out.

thanks in advance..
sunsree
 
Try this:

(
If {?MyParameter} <> &quot;XXX&quot; Then
{Field} = {?MyParameter}
else
if
{?MyParameter} = &quot;XXX&quot; then
true
(

I know it seems like overkill with the extra parens and the double qualification of the criteria, but this is how I construct the record selection criteria to consistently pass the SQL.

Since you did NOT post what you hd used, you make it difficult for people to debug it, but another thing that destroys pass through is the use of variables.

-k kai@informeddatadecisions.com
 
No i put the above formula in the select expert in the formula but the query is working as it is before but only thing i dont see it getting passed in the where clause......... in the show sql query
 
How can I pass parammeters to Crystal reports? And then how do I use them in queryes?
Thanks a lot.
 
sunsree: Show me what you have in the record selection criteria.

Bogdanf: Pass parameters from what?

If you use a Stored Procedure, Crystal will automatically create and prompt for the parameters within.

-k kai@informeddatadecisions.com
 
I'm working winth MS Access. I need to retreve data from a table but to put some conditions. So, I need to transmit some parameters from a form build in VC++ 6.0. How do I do that?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top