• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1068
  • Last Modified:

Crystal Reports- Hide Stored Procedure Parameter

Can we hide a stored procedure parameter? I am using a stored procedure for multiple reports. Some parameters are not necessary for some reports. I don't wan't to prompt the user for unecessary parameters. Set to Null option is there at the prompt but that is not the option I am looking for. I want to disable the parameter.
0
Shamanth
Asked:
Shamanth
  • 4
  • 3
  • 2
2 Solutions
 
Kurt ReinhardtCommented:
Sorry, but you can't hide it unless you run the report through some sort of custom front end.

~Kurt
0
 
James0628Commented:
I know of 2 ways to handle this, a shell report or a shell procedure.

 Shell report:

 Create a new report and make your current report a subreport inside that report.  The subreport would have all of the stored procedure's parameters.  The shell report would ask for just the parameters that you wanted.  You'd have formulas in the main report for the remaining stored procedure parameters and they would produce whatever default or dummy values you like.  Link the parameters and formulas in the main report to the stored procedure parameters in the subreport.

 However, this won't work if your current report has any subreports, since a subreport can not contain another subreport.


 Shell procedure:

 Same basic idea.  Create a new stored procedure that executes the original stored procedure.  The new procedure would have whatever parameters you want, and pass preset default/dummy values to the other parameters in the original procedure.  I've used this approach a number of times when I was creating a new report that used the same data as another report, but I wanted to omit one or more of the original parameters.


 FWIW, both of these could be described as using a "front end" of sorts, as Kurt suggested, although I'm guessing that he was talking about some kind of application.

 James
0
 
Kurt ReinhardtCommented:
James is right - those are both possible solutions (similar to what I do when I want to capture multiple value parameters against SQL Commands or Stored Procedures) and I was specifically referring to an application that gathers parameter values and passes them into the report.

~Kurt
0
Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

 
ShamanthAuthor Commented:
So, there is no straightforward way to do this in Crystal?!!!
0
 
Kurt ReinhardtCommented:
It can be done, as indicated by James, but not simply, no.  That's one of the major trade-offs in using Stored Procedures within Crystal Reports.

~Kurt
0
 
ShamanthAuthor Commented:
Thanks!
0
 
James0628Commented:
You're welcome.

 FWIW, I think a later version of CR (after 10, which is the version I have) may have some kind of "optional parameter" feature, but I doubt that it applies to stored procedure parameters.

 James
0
 
Kurt ReinhardtCommented:
James is right, Crystal Reports 2008 has Optional Parameters, but they don't pertain to Stored Procedures.  They're only for Crystal Reports parameters values and take advantage of the new HasValue function.

~Kurt
0
 
James0628Commented:
Thanks for the info Kurt.

 James
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 4
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now