Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Pass value to stored procedure without using a parameter prompt

Posted on 2016-12-01
3
Medium Priority
?
229 Views
Last Modified: 2016-12-01
Crystal Reports 2016

Is it possible to pass a value to be used in a stored procedure from crystal that does not use a parameter prompt?  I ask becuse I wish to use the same sp for various values and wish to hardcode that value in each subreport.

If the stored procedure uses:

@AgencyType

Sub report 1

@AgencyType = 'PD'

Subreport 2

@AgencyType = 'FD'

ect..


The stored procedure is called with

execute CR_UCR_Code_IncidentCntwithPercetageByAgencyType {?Year}, {?AgencyType}


I need to pass the year since this is the date range the report will be run against.
But I don't want individual prompts for each sub report.  I just want that value  'PD' or 'FD' to be hardcoded into each corresponding subreport.
0
Comment
Question by:MikeM670
[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
3 Comments
 
LVL 41

Accepted Solution

by:
Kyle Abrahams earned 2000 total points
ID: 41909497
You can link the subreport parameter value to a forumla.  Also if that's dynamic (Eg: in your result set) you should be able to link the subreport to the value of the field.

from:
https://archive.sap.com/discussions/thread/908053


Create a formula for each parameter you do not want to be prompted by.  If you have a parameter that prompted for a Country then you need to add a country value in the formula.

The formula will look like:

"USA"

So the value passed to the parameter will be USA.

4. Insert you report as a subreport in the Report Footer section.

5. Link the subreport parameters to the formula you just created.

5.1 To link the formula to a parameter, right click on the subreport and in the contextual menu, select "Change Subreport Link"

5.2 In the "Change Subreport Link" window, under the list of available fields in the upper right corner, locate your formula, then add it to the "Fields to Link to" list.

5.3 In the bottom left corner, go in the drop-down list of "Subreport parameter field to use" , and select your subreport parameter.

Repeat the above steps for each parameter you do not want to be prompted by, then click "OK" to accept the changes.

Now when viewing the report, you will not be prompted by your parameter as a default value as been assigned to it.
0
 
LVL 18

Expert Comment

by:vasto
ID: 41909499
You can use a command and in the command to use a Year parameter and hardcoded value for the other parameter
0
 

Author Closing Comment

by:MikeM670
ID: 41909568
That seems to have done the trick!  Thanks!
0

Featured Post

Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

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…
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…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

636 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