Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Wot no pivot? Post Reply Post New Topic
Author Message
itsys
Newbie
Newbie
Avatar

Joined: 03 Jul 2009
Location: United Kingdom
Online Status: Offline
Posts: 2
Quote itsys Replybullet Topic: Wot no pivot?
    Posted: 03 Jul 2009 at 2:52am

Having trawled through varoius books and online sources, I'm perplexed. I thought I had a pretty rudimentary reporting requirement that would be easy to implement in Crystal Reports XI; at least it is in Excel...

I've got a table of data:
 
cat        date            limit         percent      booked
----        ------            -----         ----------      ---------
1           mon             100                  25             50
1           tue                90                  20             45
1           wed               70                  15             30
2           mon               90                  25             12
2           tue                 80                  20               9 
2           wed               50                  15               7
 
I want to group by cat, then pivot the remaining 4 columns:
 
cat 1
------
                    mon            tue             wed
limit               100             90               70
percent           25              20              15
booked           50              45               30
 
cat 2
------
                    mon            tue             wed
limit                 90             80              50
percent           25              20              15
booked           12               9                7
 
so... no cross tab totals, just a 'simple' pivot. Took me 10 minutes in Excel but Crystal Reports is driving crazy and I'm on the verge of doing the pivot via SQL functions. I'd really appreciate it if someone with a bit more experience of CR can tell me if this really is hard to accomplish, or I've overlooked the obvious! 
Mike
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 06 Jul 2009 at 6:27am
I haven't used them, but still cross tabs sounds like the simplest way...you don't need to display totals (do you, I don't build cross-tabs, so could be wrong).
 
If cross-tabs don't work for you, there is no easy way in Crystal that I know of to get this done.  it could probably be done with formulas, but for all that work, I would just do in SQL.
 
Crystal isn't the best reporting tool out there, and it isn't the worse...in most cases it is just as simple and just as complex as the others.  Sure, Excel is can reformat the data more simply, but you can't use it to write a report or to connect to a database and retrieve data...
 
Not knocking Crystal or Excel, they just do things differently, as they were designed to accomplish different goals.
IP IP Logged
itsys
Newbie
Newbie
Avatar

Joined: 03 Jul 2009
Location: United Kingdom
Online Status: Offline
Posts: 2
Quote itsys Replybullet Posted: 06 Jul 2009 at 7:40am
Thanks for this, it prompted me to take another look at cross-tabs. You're right, it is possible to suppress the totals: using the cross-tab expert, if I specify 'cat' as the 'Rows', date as the 'Columns', and 'Sum of limit', 'Sum of percent', and 'Sum of booked' as the 'Summarized fields', then I get:
 
                            mon        tue      wed
1     LIMIT             100          90         70
       PERCENT         25          20          15
       BOOKED          50          45          30
2     LIMIT               90          80          50
       PERCENT         25           20         15
       BOOKED          12             9           7
 
So I *just* need to figure out how to get some line-breaks in there and I'll have what I need.
 
BTW I take your point about the differences between CR and Excel :-)
Mike
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.031 seconds.