Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Cross-Tab Report Post Reply Post New Topic
Author Message
Don L
Newbie
Newbie


Joined: 26 Mar 2015
Online Status: Offline
Posts: 4
Quote Don L Replybullet Topic: Cross-Tab Report
    Posted: 08 Apr 2015 at 10:33am
Greetings,

I am new to the Crystal Forum and would like to say I am looking forward to learning lots of great report techniques from the experts! :)

So here goes...I have created a Cross-Tab Report for reporting monthly data. You enter a date, which determines the desired year. The report returns records from the 1st day of the selected year to the last day of the selected year.

Using the Cross-Tab Expert, I have selected a Column TRXDATE and set the Group Options as " This column will be printed: for each month."

When the report runs I have Columns for each month as desired.

Here is my question. When I run the report for a history year such as 2014. I have 12 evenly spaced columns. When I run the report for the current year, I naturally only have columns for months having transactions, (i.e. Jan, Feb, Mar, Apr). The displayed report only has 4 columns.

Is there a way to show 12 columns when the report is run in the current year? 4 Columns would have data and 8 columns would show a zero?

Thank you.
Don L.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 08 Apr 2015 at 12:03pm
For a Cross Tab your source needs to have all of the values in it. Usually this is accomplished by outer joining the original table to a calendar table and then grouping on the calendar table date field rather than your original date field.
You can also mimic the look of a crosstab using grouping and running totals (or the like) to give you monthly calendar sums that you can lay out like columns in the group footer. 
IP IP Logged
Don L
Newbie
Newbie


Joined: 26 Mar 2015
Online Status: Offline
Posts: 4
Quote Don L Replybullet Posted: 12 Apr 2015 at 1:58pm
Thank you! I have created the Calendar table and joined this table to the desired table. My purpose in this is to create a Cross-Tab report that will contain a Bar chart. The chart will group on the Month and then Accounts. For each month, an item has Sales, Cost and Volume. The desired bar chart would have three bars for each month. Up to this point, I can only display one bar for each month.

Again, I am grouping on Month (Jan, Feb, Mar, etc.) and Accounts (Sales, Cost, Volume).

I appreciate your guidance on creating a Cross-Tab Report, with a Bar chart having three columns each month.

Thank you!
Don L.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 13 Apr 2015 at 4:07am
I don't really understand what a CrossTab has to do with the chart or how you have an 'Account' in the mix but in general you can
insert a chart
set to side by side bar chart
under data set the on change of to the date field set to per month
in show values
   add Sales field as a sum
   add Cost field as a sum
   add Volume as a sum
 
if you place the chart in a group header or footer the dat ain the chart is limited in scope to the data that is in that group
so if you are grouping on 'Account' and place this chart in that group then you will get repeated charts per account.
 
IP IP Logged
Don L
Newbie
Newbie


Joined: 26 Mar 2015
Online Status: Offline
Posts: 4
Quote Don L Replybullet Posted: 14 Apr 2015 at 9:09am
Thank you! Worked great!

Hopefully, this is my last question, I am still working with the Cross-Tab report and I am trying to create a summarized field call % Margin. This field uses two formula fields. The first is Spread (which is Cost/Sales) and the second is Sales.

The formula is displayed as Spread/Sales *100. When I run the report the value is wrong.

I am using Crystal XI.

Any suggestions?
Don L.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 14 Apr 2015 at 9:13am
break out each parts and display each one seperately in the location that you want to display the final value and see which of the parts (if any) are right
IP IP Logged
Don L
Newbie
Newbie


Joined: 26 Mar 2015
Online Status: Offline
Posts: 4
Quote Don L Replybullet Posted: 14 Apr 2015 at 9:44am
They are correctly displayed individually. It's when I try and preform the calculation the calculation is incorrect.
Don L.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 14 Apr 2015 at 9:59am
what is the exact formula you are using to display it and where are you placing it? a header? a footer? in a grouping? detail section?
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.047 seconds.