?
Solved

Crystal Reports- Hide Stored Procedure Parameter

Posted on 2010-09-01
9
Medium Priority
?
1,036 Views
Last Modified: 2012-05-10
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
Comment
Question by:Shamanth
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
9 Comments
 
LVL 26

Assisted Solution

by:Kurt Reinhardt
Kurt Reinhardt earned 600 total points
ID: 33583640
Sorry, but you can't hide it unless you run the report through some sort of custom front end.

~Kurt
0
 
LVL 35

Accepted Solution

by:
James0628 earned 1400 total points
ID: 33583791
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
 
LVL 26

Expert Comment

by:Kurt Reinhardt
ID: 33583861
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
On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

 

Author Comment

by:Shamanth
ID: 33587078
So, there is no straightforward way to do this in Crystal?!!!
0
 
LVL 26

Expert Comment

by:Kurt Reinhardt
ID: 33587796
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
 

Author Closing Comment

by:Shamanth
ID: 33588161
Thanks!
0
 
LVL 35

Expert Comment

by:James0628
ID: 33593714
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
 
LVL 26

Expert Comment

by:Kurt Reinhardt
ID: 33596212
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
 
LVL 35

Expert Comment

by:James0628
ID: 33602114
Thanks for the info Kurt.

 James
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

752 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