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

grouping doesn't show everything

Status
Not open for further replies.

dmccallum

Programmer
Jan 5, 2001
90
US
I created a report that has a group with a formula and I suspected that it wasn't working correctly so I showed the details using the same formula and there were several numbers in the columns when I showed the details. But the group would show 0. How can that be possible?
 
Post the formula here.
Tell us which section you put the formula in, and the values you are seeing. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
There are three groups: salesman, district and customer. I put the formula group 3 (customer) for 12 columns representing months.

When I decided to show the details I copied the formula from the group 3 and pasted it below in the details. That's when I discovered that some of the values were being ignored. The value is how much is spent minus taxes during a certain month. The footer shows the correct subtotal even when the group shows 0.

The formula is as follows:

If NumericText({Header_.Del_Date}) then

If (ToNumber(mid({?Date Range}, 5, 2)) + 1) < 13 and
(ToNumber(mid({?Date Range}, 5, 2)) + 1) = (ToNumber(mid({Header_.Del_Date}, 5, 2)))
then {Header_.Grand_Inv_Total} - ({Header_.CC_Tax}+{Header_.MiscTax})
else
if (ToNumber(mid({?Date Range}, 5, 2)) - 12) = (ToNumber(mid({Header_.Del_Date}, 5, 2)))
and
(ToNumber(mid({?Date Range}, 1, 4)) + 1) = ToNumber(mid({Header_.Del_Date}, 1, 4))
then {Header_.Grand_Inv_Total} - ({Header_.CC_Tax}+{Header_.MiscTax})
 
>>The footer shows the correct subtotal
>>even when the group shows 0.

What does this mean? Putting a formula on the Group Header or footer doesn't turn it into a subtotal. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
I clicked on the formula in the detail section and it gave me the option of creating subtotals and grand totals. That is what appears in the footer. Even when the group says the amount is 0 the details shows there are amounts and the subtotal and grand total shows the correct amount.
 
>>Even when the group says the amount is 0
>>the details shows there are amounts
>>and the subtotal and grand total shows the >>correct amount.

I am lost because a &quot;group&quot; can't say anything. So, in preview mode click on the &quot;group&quot; that says the amount is 0 and tell me what that object is named, and which section it is sitting in. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
What is the formula for this field?

Wha is this fields value on the last detail record for this group? Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
dmccalum: It may help to examine your formula and ensure that you are assigning check values for the 'else' portions. I often use this technique to see if I've forgotten any combination of tests which I should be using. At present your formula reads as follows:

If (test1) then
If (test2 and test3 ) then
{Header_.Grand_Inv_Total} - ({Header_.CC_Tax}+{Header_.MiscTax})
else
If (test4 and test5) then
{Header_.Grand_Inv_Total} - ({Header_.CC_Tax}+{Header_.MiscTax})

I suggest the following:

If (test1) then
If (test2 and test3 ) then
{Header_.Grand_Inv_Total} - ({Header_.CC_Tax}+{Header_.MiscTax})
else
If (test4 and test5) then
{Header_.Grand_Inv_Total} - ({Header_.CC_Tax}+{Header_.MiscTax})
ELSE 999999
ELSE 111111

This may help to see when your formula is not returning the values you are expecting David C. Monks
david.monks@chase-international.com
Accredited Crystal Decisions Enterprise Partner
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top