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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formatting Group Header

Status
Not open for further replies.

mike99

Technical User
Jul 3, 2002
43
CA
I have a report with 3 groups;
Group 1 = Customer
Group 2 = Order
Group 3 = Invoice
I want to format the Group 1 header (to suppress it) based on results determined by a formula in the Group 1 footer.
There is a formula in the Group 1 footer that adds results from formula's in the Group 2 and 3 footers. I want to supress the Group 1 header if the results of the formula in the Group 1 header does not reach a predetermined value.
When I display the results of the "Group1 footer formula" in the Group 1 header the rseult indicates that the header prints before the formula is evaluated.

Any ideas?

Thanks

Mike
 
Have you tried adding

whileprintingrecords;

to the beginning of your suppression statement.

Regards

Ian
 
Ian

Thanks, I did try that but it seemed to make no difference

Mike
 
What is the formula?
If it uses or relies on variables that are WhilePrinting, then you can't use the value in the GH. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Ken

In the group 2 and 3 footers I calculate values that are dependant on the amount of the order and the type of product purchased to award aeromile points to customers.

The formula in the Group 1 footer adds up the points calculated in the formula's in the Group 2 and 3 footers.
I'm not sure if they need to be "WhilePrinting" but I stuck it in any way when nothing else seemed to work.

The Group 3 value is the @SUM of items in the detail section.

The Group 2 values are:
1. The @SUM of the Group 3 @Sum
plus
2.
If (Sum ({@ExtendedPrice}, {SALESHIST1.HI_ORDER_NO}) >= 500 and
Sum ({@ExtendedPrice}, {SALESHIST1.HI_ORDER_NO}) < 1000 ) then 100 else
If (Sum ({@ExtendedPrice}, {SALESHIST1.HI_ORDER_NO}) >= 1000 and
Sum ({@ExtendedPrice}, {SALESHIST1.HI_ORDER_NO}) < 2000 ) then 250 else
If (Sum ({@ExtendedPrice}, {SALESHIST1.HI_ORDER_NO}) >2000 ) then 600
else 0
plus
3. These values that are caculated in the Group 2 footer.

{@AerPastraPoints}+{@AerPBecDicPoints}+{@AerPHerPoints}+{@AerPOmegaPoints}+
{@AerPRadPoints}+{@AerPZPoints}+{@AerPsoftCorePoints}

Hope this expalins it and thanks for your help

Mike
 
Also need the formula from the Group 1 footer. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Ken

Thanks, here are the other formula's


Formula 1 is @Sum of Group3 Airpoints

Formula 2 Name: @AirMilesCustTotDisp
WhilePrintingRecords;
Global numberVar CustTot ;
CustTot := CustTot ;
CustTot
Formula 3 Name:mad:AirMilesCustTotcombDisp
WhilePrintingRecords;
Global numberVar CustTotcomb ;
CustTotcomb := CustTotcomb ;
CustTotcomb
Formual 4 Name: @AirmilesCustGT(Adds previous 3 Formula's)
WhilePrintingRecords;
{@AirMilesCustTotDisp}+Sum ({@Airpoints}, {SALESHIST1.HI_CUST_NO}) + {@AirMilesCustTotcombDisp}
 
What you are doing is a classic example that I use in class (I use a commission based on an invoice total). You are creating a calculated values that relies on the group subtotal. To subtotal these values you have to use a variable based running total. The total is only complete at the group footer, and can't be used to control the GH. Sorry. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Thanks
I appreciate the help

Mike
 
I'm using CR9 to write a rate history report that will display the rate changes for a given bank.

The report should be as follows:

RateDate | NewRate | Increases

13-01-2001 5.75 -
01-02-2001 6.00 0.25
14-02-2001 6.00 0.0
21-03-2001 4.25 -1.75
...

The problem is that the calculated increases amount is usually wrong:

I'm using the formula below to calculate the increase.
What am I missing?

//GetIncreases
currencyvar cvIncreases;
WhilePrintingRecords;
cvIncreases := {NewRate} - Previous({NewRate});

Alternatively, I'd like to perform the calculate on the SQL server instead of relying on CR but now don't know if SQL has a previous record function eqivalent.


 
All you need is:
{NewRate} - Previous({NewRate})

That should work. What is it doing wrong? Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top