Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Override Input Parameter With Formula Post Reply Post New Topic
Author Message
Pat791
Newbie
Newbie


Joined: 03 Aug 2012
Online Status: Offline
Posts: 5
Quote Pat791 Replybullet Topic: Override Input Parameter With Formula
    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

IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet 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
IP IP Logged
Pat791
Newbie
Newbie


Joined: 03 Aug 2012
Online Status: Offline
Posts: 5
Quote Pat791 Replybullet 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
 
 
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet 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
IP IP Logged
Pat791
Newbie
Newbie


Joined: 03 Aug 2012
Online Status: Offline
Posts: 5
Quote Pat791 Replybullet Posted: 07 Aug 2012 at 4:36am

Thanks I will try this out.

Patrick
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.