ConfusedByTrying
ConfusedByTrying

Reputation: 1

Crystal reports-How to force the group footer to pull the correct field based on another field in the same table?

I am using 2016 Crystal Reports pulling data from 2021 Sage 100 database.

My corporate IT moved us from our Sage environment to their consolidated Sage environment for multiple companies they own. This eliminated our old work order module and we are now on Sanco's Operation Management module. I am trying to recreate my reports from the old WO module and I am running into issues because of the way the new Work Ticket process is setup. This may or may not be relevant information depending on if anyone is familiar with this sytem.

My question: How do you return a value based on the value of a different field in a group section. I have tried If/Then statements, Select/Case (I am not good at these) and several other methods that all fail. All of the data is in 1 table.

Each WT number has several steps and the new system seperates the data based on the step number. Step 000 is the only record that includes the parent item number. I grouped the records by the WT number and sumarized it and hid the detail section since I am only looking for the totals by WT for this report. I cannot get the item number to show on my report because the step in the summary is never 000.

What formula can I do to tell the system to use the item code in step 000?

Sorry for the long question, any help would be appreciated.

Here is an example of what I have tried hopeing the field in the group footer would show the item code, what I got was a blank field.

Select {JT_WorkTicketHistory.WTStep} Case "000":{JT_WorkTicketHistory.HdrParentItemCode}

The result was a blank field. enter image description here

I appreciate any help or direction you can offer.

Upvotes: 0

Views: 21

Answers (1)

MilletSoftware
MilletSoftware

Reputation: 4026

One option is to create a formula {@Capture_ItemCode_Into_Variable} like this:

Global StringVar HeaderParentItemCode;

IF {JT_WorkTicketHistory.WTStep} = "000" Then 
HeaderParentItemCode := {JT_WorkTicketHistory.HdrParentItemCode};

In the Group Footer, use another formula {@Display_Variable_Value} to simply display the value in the variable:

Global StringVar HeaderParentItemCode;

Upvotes: 0

Related Questions