Print Page | Close Window

Override Input Parameter With Formula

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=17217
Printed Date: 28 Apr 2024 at 5:41am


Topic: Override Input Parameter With Formula
Posted By: Pat791
Subject: Override Input Parameter With Formula
Date Posted: 06 Aug 2012 at 5:59am

I have the following report set up.

Part Number = 297388
------Jacket
---------layercode = 10
---------diameter
---------thickness
------Insulation
---------layercode = 20
---------diameter
---------thickness
------Conductor
---------layercode = 30
---------diameter
---------thickness

In the program (Jacket, Insulation, Conductor) are Stored Procedures and (layercode, diameter and thickness are Sub Procedure. When entering a new part number, I am prompted to enter the part number and layercode since they are the input parameters. The problem is that if I enter a specific layercode, I only have access to the Stored Procedure which contains that layercode. So if I enter 10 into the layercode. I can only retrieve information from the Jacket Stored Procedure.

Does anyone know how I can get around this? Can I create a formula saying set layercode = 20 to override the input paramater?

Thanks,

Partick




Replies:
Posted By: hilfy
Date Posted: 06 Aug 2012 at 9:01am
I would create one formula for each of your "layers" that will hard-code the layer number for each subreport.  You then use the subreport specific layer formula in the links for the subreport it applies to.
 
-Dell


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: Pat791
Date Posted: 06 Aug 2012 at 9:19am
Thanks Dell
 
Thats sort of what I have been trying to do but I'm not sure how to do it. Im having troubles setting the layercode to a specific value because.
Say I write a formula to set the layercode to 30 for the Conductor values...
 
if {getEN_MVUG_CONDUCTOR;1.layercode} <> 30 then {getEN_MVUG_CONDUCTOR;1.layercode} = 30
 
(getEN_MVUG_CONDUCTOR;1 is the actual name of the stored procedure which contains all of the conductor information)
 
 
This will always give me a value FALSE instead of 30 because its looking for Boolean. I'm also not sure how I would expand on the formula to find one of the other sub procedures.
 
So what I would like to be able to write a formula for
--> If layercode <> 30 then set it to 30
--> with the layercode now set to 30. Display the Diameter
 
Thanks,
Patrick
 
 


Posted By: hilfy
Date Posted: 07 Aug 2012 at 3:01am
I'm assuming that the SP that requires the layercode param is in the subreports.  Is that correct?
 
If so, in your main report, create a very simple "formula" for each layer just sets the constant value for the layer you want.  For example:
 
{@Layer10}
10
 
{@Layer20}
20
 
etc.
 
Link from these "formulas" to the appropriate subreport.
 
-Dell


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: Pat791
Date Posted: 07 Aug 2012 at 4:36am

Thanks I will try this out.

Patrick



Print Page | Close Window