Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: cross tab like report. Post Reply Post New Topic
Author Message
Rshekdar
Newbie
Newbie
Avatar

Joined: 22 Feb 2012
Location: Singapore
Online Status: Offline
Posts: 7
Quote Rshekdar Replybullet Topic: cross tab like report.
    Posted: 22 Feb 2012 at 12:54am
I have to create a report which would have been a snap in Cross tab, but its not possible to create it as it needs some columns which i cannot create in cross tab.

so seeking some help.

I have to show a report which looks like this

sn col1 col2  oct-10    nov-10   dec-10  jan-11  Feb-12  Mar-12  Apr-12 tot
                                   aa   bb   aa   bb aa   bb aa   bb  aa   bb  aa   bb
           cent
1   x     AA                    0     0    1     0    3    8    0    0      0    0    0     0   12
2   y     BB                    1     0    0     0    0    0    0    1      3     0   0     0    5
3   z     CC                    0     0    4     0    2    3    0    0      0     1   0     4   10
           east
4   u     DD                    0     0    1     0    3    8    0    0      0    0    0     0   12
5   v     EE                    1     0    0     0    0    0     0    1      3     0   0     0    5
6   w     FF                    0     0    4     0    2    3     0    0      0     1   0     4   10

tot1                              2     0   10    0   10  22   0    2      6     3   0     8   34
tot2                                2           10        33        2             9         8       34
tot3                            80   20 110  40  90  82   0   12    56   33  0    58 581
%of tot2 agaistn tot3
%of tot1 against tot3

the problem is , i have a lot of col2 for which there could be no data present in other tables. I am quite sure this is not very clear if someone would help i could explain more. i am new to crystal reports. i could make this if i was to use something like ASP or java or jsp. But crystal reports is a mystery to me. Please help. i am literally hanging by a thread on this one.
I tried but could not get it, so now seeking help.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 22 Feb 2012 at 3:46am
if you use a stored procedure, life shouldn't be too hard.
 
you would want to return the same number of columns everytime, with the same names.  You can have a column (or I like another table) that will tell CR what to call each column (thus giving the illusion of a cross tabs).
 
Since you are populating each row (you are doing the pivoting) this will ensure that each column has an entry ( or you can leave it null and set the report to replace NULLs with a default value...0 for numbers)
 
Your stored proc can also fill in the extra columns that the cross tabs couldn't have (or if you prefer CR could do, but I usually figure you db server would do it more efficently)
 
then all that is left is for you display the data that your stored proc created/retrieved.
 
HTH
IP IP Logged
kostya1122
Senior Member
Senior Member
Avatar

Joined: 13 Jun 2011
Online Status: Offline
Posts: 475
Quote kostya1122 Replybullet Posted: 22 Feb 2012 at 5:31am
you could also try the hard way
first group on one of this not sure which"sn col1 col2 "
then create a formula for each date something like
if table.emount in date()to date() then table.emount
then create summaries from those formula fields by
using formulas(sum(newField,group) or right clicking on the
field >insert>summary... (place them into group header or footer)
for your totals
create multiple report footers(go report tab >section expert>select report footer
>click insert twice) then create your formulas for totals and place them there.
IP IP Logged
Rshekdar
Newbie
Newbie
Avatar

Joined: 22 Feb 2012
Location: Singapore
Online Status: Offline
Posts: 7
Quote Rshekdar Replybullet Posted: 22 Feb 2012 at 2:25pm
hello lockwelle,

thanks for the suggestion, i was going to go with the stored proc approach but my company is against that. So the struggle with Crystal reports. Lets c will try to create a stored procedure and c how it goes.

much appreciated.

I tried but could not get it, so now seeking help.
IP IP Logged
Rshekdar
Newbie
Newbie
Avatar

Joined: 22 Feb 2012
Location: Singapore
Online Status: Offline
Posts: 7
Quote Rshekdar Replybullet Posted: 22 Feb 2012 at 7:18pm
Hello Kostya,

this approach is not working. still struggling to get this report formatted. But thanks for the help.
I tried but could not get it, so now seeking help.
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.016 seconds.