Solved

Crystal Reports- Hide Stored Procedure Parameter

Posted on 2010-09-01
9
996 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
  • 4
  • 3
  • 2
9 Comments
 
LVL 26

Assisted Solution

by:Kurt Reinhardt
Kurt Reinhardt earned 150 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 34

Accepted Solution

by:
James0628 earned 350 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
 

Author Comment

by:Shamanth
ID: 33587078
So, there is no straightforward way to do this in Crystal?!!!
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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 34

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 34

Expert Comment

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

 James
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
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…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

863 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

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now