Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic Global String Array Used in Formula

Status
Not open for further replies.

jpstrzoch

Technical User
Mar 24, 2004
59
0
0
US
Greetings,

I am a long time amateur user of Crystal XI. I have a report that I believe I need to create an Global StringVar Array but I need your assistance. Below is the structure of my report.

GH1 {ORDRHDR.SOLDTOCUSTID}

GH2 @WaveBatchIfThen // When we schedule orders in our WMS, warehouse management system, we do so in groups of orders. A Wave is a small set of orders that have a unique combination of items required to be picked while a Batch is a set of identical orders. Thus Waves are picked discretely, while Batch picking collects an amount of each item to satisfy the group of orders.

GH3 {ORDRHDR.ORDERNUMBER}

Details Left blank, restated, no detail records are in the Details section of the report and is suppressed. Only GH1 and GH2 are visible. For the sake of discussion I've placed the {NOTES.NOTES} field into the Details section of my report.

Example:

GH1 Pioneer
GH2 Wave 630388
GH3 3963993-1
Details CHANGE
Details CARRIER SERVICE CODE
Details MUSTSHIP

As you can see, the {NOTES.NOTES} field will return unique values when placed into the Details section of my report. The {NOTES.NOTES} field is a String value.

My ultimate goal is to build an Array that I can use in a formula like this.

if @Notes Array = “MUSTSHIP”
then “MUSTSHIP”
else “”

I believe the Array must be a Global Array, and I would like it to be accumulative for the purpose of future use, [CHANGE, CARRIER SERVICE CODE, MUSTSHIP], and finally I feel that it must reset to an empty Array for reconsideration of each order within GH3.

Can you please provide your expertise in answering this question for me?

Thank you in advance for your time!
 
Hi jpstrzoch

Maybe I don't fully understand what you are trying to achieve, but based on what I think you are trying to do I don't see a need to use an array (and in 15 years as a Crystal Report developer I have rarely found it necessary to use arrays).

As I understand it, you want to display "Must Ship" on the report if it appears in any one of the detail rows. While not specified, I'm guessing that this would be in one of the Group Sections. If that is it, I would approach it this way:
[ul]
[li]Create a Formula like this:
[CODE {@MustShip_test}]

IF {NOTES.NOTES} = 'MUSTSHIP'
THEN 1
ELSE 0
[/CODE]
[/li]
[li]Place it in the Details section and suppress that section;[/li]
[li]Create the following Formula:
[CODE {@MustShip_display}]
IF MAXIMUM({@MustShip_test}, {ORDRHDR.ORDERNUMBER}) = 1
THEN 'Must Ship'
[/CODE]
[/li]
[li]Place it in the appropriate Group 3 Header/Footer (note that, because it uses a built in Crystal Summary, it can be used in both headers and footers). I assumed the test is applied at Group 3. If it needs to be tested at Group 2 or 1 simply change the group field in the 2nd formula and place it in the appropriate group header/footer.[/li]
[/ul]

Hope this helps. If I have misunderstood what you are trying to do let me know and I will take another look.


Cheers
Pete

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top