Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Crosstab column Post Reply Post New Topic
Author Message
hendrikb
Newbie
Newbie


Joined: 26 Jan 2010
Online Status: Offline
Posts: 5
Quote hendrikb Replybullet Topic: Crosstab column
     Posted: 30 Mar 2010 at 11:47am
Hi

I have a basic crosstab with products at the top of the crosstab and
a total column at the end.
Is it possible to add an additional total column that adds up certain products in the crosstab?
If possible, how can this be done?

Thank You
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 30 Mar 2010 at 1:13pm
This possible, but it's kind of quirky.
 
I'm going to assume the following for this example:
 
- You have a specific field that identifies which items to include in this sum.  I'll call this {table.Include_Product} and it will have a value of 1 (include) or 0 (don't include)
- That you want to add up the total inventory of these items as contained in a field I'll call {table.Num_In_Stock}
 
1.  Create a formula (I'll call it {@SpecialInventory} ) that will identify what you want to add up based on the products to be included.  It will look something like this:
If {table.Include_Product} = 1 then {table.Num_In_Stock} else 0
 
2.  Open the Cross Tab Expert and add this new formula to the Summarized Fields and click on OK.
 
You'll now have two summarizations for each product and for the totals, but you only want see the sum of {@SpecialInventory} in the totals.  To get rid of it in the product columns, do the following:
 
1.  Select the column header and column value for {@SpecialInventory} in the CrossTab.  Right-click, select Format Objects, go to the Common tab and check the Suppress checkbox.
 
2.  De-select the column value, leaving just the header selected.  Right-click and select Size and Position.  Set the object width to 0.05 (Crystal won't let you go any smaller).  This also will resize the value. 
 
Your report will now show a separate summary column in the totals.  The one major quirk to this is that if you export to Excel, you'll get an extra blank column for each product where you're suppressed data would go if it weren't suppressed.
 
-Dell
IP IP Logged
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