Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Crystal Reports XI Display String Post Reply Post New Topic
<< Prev  Page  of 2
Author Message
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 24 Apr 2009 at 7:12am
ifejza,
I was recommending creating a formula field (similar to Lockwelle) not changing the suppression formula.
To create a formula go to the Field Explorer, Right click on FOrmula Fields and seelct NEW.
Put in a name of the field. For this put in "New Grouping".
Hit OK.
Put your formula code in there and save and close it.
From here you can use this formula field like any other DB field.
Both lockwelle and I were recommending replacing your group level 2 with one of our formulas.
You would still want to have a group level 3 on the tax type and suppress the details.
 
IP IP Logged
ifejza
Newbie
Newbie
Avatar

Joined: 22 Apr 2009
Location: Albania
Online Status: Offline
Posts: 11
Quote ifejza Replybullet Posted: 24 Apr 2009 at 11:32am
Hi lockwelle & DBlank
Thank you for your comments,
I’m new in Crystal Reports and maybe my question is not clear.

I create a new Formula Fields with your suggestion.
When I used this formula
if {AAA} in ["USA","UK"] then
{AAA}+{BBB}+{CCC}
else
{AAA}+{CCC}
My result is AAA BBB CCC (concatenate)

USA                     1,772,000.00
     CHICAGO               722,000.00
          Tax          150,000.00
          Customs          342,000.00
          Other Tax     230,000.00
     DETROIT                1,050,000.00
          Tax          300,000.00
          Customs          500,000.00
          Other Tax     250,000.00
               
CANADA                    850,000.00
          Tax          120,000.00
          Customs          100,000.00
          Other Tax      65,000.00
          Tax          215,000.00
          Customs          200,000.00
          Other Tax     150,000.00

My result for Canada should be look like this
CANADA                    850,000.00
          Tax          335,000.00
          Customs          300,000.00
          Other Tax     215,000.00
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 24 Apr 2009 at 11:40am

If you need sub totals per city for UK and US use my formula instead of lockwelles. His would work great without needing city and country subtotals.

Group on Country - add sum of taxes
Group on Formula if {table.country} in ["USA","UK"] then {table.city} else {table.country} - conditionally suppress this group header as: IF {AAA} IN [“USA”, “UK”] THEN FALSE  ELSE TRUE. Add a SUm of taxes. Conditionally suppress the SUM field the same way. Suppress the whole section when blank.
group on Taxes -add a SUM of taxes.
Suppress details.
Suppress Group footers as needed for spacing to be the way you want it.


Edited by DBlank - 24 Apr 2009 at 11:41am
IP IP Logged
ifejza
Newbie
Newbie
Avatar

Joined: 22 Apr 2009
Location: Albania
Online Status: Offline
Posts: 11
Quote ifejza Replybullet Posted: 25 Apr 2009 at 6:15am
Hi lockwelle & DBlank

I don’t need for subtotals for Country and City. Subtotals in Text Item are from SQL statement and result is correct.
I need to group Text Item in Detail part when Country NOT IN [“USA”, “UK”]

SELECT country, city, tax_type, SUM(amount)
FROM xxx
GROUP BY country, city, tax_type


Edited by ifejza - 27 Apr 2009 at 12:20am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 27 Apr 2009 at 9:11am
You do want to display the subtotals, correct?
Try and do what I suggested. You can choose how you want to display the sub totals by either using the summary functions or using your pre-calcualted SQl totals (although I think you will need to use the crystal summary function to get your totals for tax types in Canada)...


Edited by DBlank - 27 Apr 2009 at 9:12am
IP IP Logged
<< Prev  Page  of 2
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