Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Show mutiple rows vertically Post Reply Post New Topic
Author Message
sunsuogun
Newbie
Newbie


Joined: 12 Jun 2012
Location: Nigeria
Online Status: Offline
Posts: 8
Quote sunsuogun Replybullet Topic: Show mutiple rows vertically
     Posted: 12 Jun 2012 at 11:42am
Hi,
 
I am trying to present a report in 
crystal  but cannt get a clue to presenting the report
 
Raw Data in Database
===============
 
StudentID  OfferredSubject Score
4                 ENG                  2
4                 MAT                  50
4                 YOR                   60
4                 FRE                   40
4                 BIO                   80
4                 AGR                  45
5                 ENG                  30
5                 MAT                  70
5                 AGR                  20
5                 EDU                  39
5                 SCI                   98
5                 SOC                  40
 
 
I want the report to be presented in crystal report as
 
StudentID       OfferedSubjectWithScores
 
4                   ENG MAT  YOR
                      2      50    60
                     FRE  BIO   AGR
                      40   80    45
 
5                   ENG  MAT  AGR
                     30    70     20
                    EDU   SCI  SOC
                     39     98   40
 
pls can anyone help out with this.i need to get this report out on time.
 
thanks
 
 
 


Edited by sunsuogun - 12 Jun 2012 at 11:48am
sunsuogun
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 12 Jun 2012 at 1:57pm
if you know the max classes, you can read the data in the detail section and use shared variables to assign to fixed variables that you can then display in the group footer...
in detail (partial code)
shared stringvar classx := {table.offered};
shared numbervar scorex:={table.score};
shared numbervar counter;
shared stringvar class1;
shared numbervar score1;//repeat these for as many as needed
counter := counter + 1;
if counter = 1 then (
  class1 := classx;
  score1 := scorex;
)
 
 
in the group header:
shared numbervar counter := 0;
shared stringvar class1 :="";
shared numbervar score1 := 0; //repeat
 
suppress the detail section since you don't want the output
 
create formulas like:
shared stringvar class1;
class1
 
and
 
shared numbervar score1;
score1
 
place these formulas laid out as desired in the group footer
 
should work.
have fun
IP IP Logged
sunsuogun
Newbie
Newbie


Joined: 12 Jun 2012
Location: Nigeria
Online Status: Offline
Posts: 8
Quote sunsuogun Replybullet Posted: 12 Jun 2012 at 10:42pm
Hi Lockwelle,
 
I have implemented your solution and things have been taking shape.
Every other steps are being implemented as outlined by you except for the modification I made to the group header for the repeating as shown below.
 
shared stringvar classx := {StudentAssessmentScores.SubjectCode};
shared numbervar scorex:={StudentAssessmentScores.CaScore};
shared numbervar counter := 0;
shared stringvar class1 :="";
shared numbervar score1 := 0;
counter := counter + 1;

if counter = 1 then (
  class1 := classx;
  score1 := scorex;
)
 
And I did a class layout of 4 per row,when i run the report i am only having the first offerredSubjectCode being repeated.see  the output below
  
 AGR AGR AGR AGR(offerredusbject)
  29   29   29     29(score)
 
And two, I need a clarification on wht  u mean as classess? Is it the number of columns i want per row as illustrated above?
 
so how can i get the repeated offerredcourses resolved as par my illustrated layout?.which we give me my desired output to be
 
AGR ENG MAT FRE
 40   30   70    62
 
Pls hope to hear from anyone to help me in resolving this.
 
Thanks
 

 
 


Edited by sunsuogun - 12 Jun 2012 at 10:50pm
sunsuogun
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 13 Jun 2012 at 3:59am
classes = offered subjects
 
the repeat for as many as needed was meant to imply:
shared stringvar class1;
shared stringvar class2;
shared stringvar class3;
shared stringvar class4;
 
then your counter would be used like: 
if counter = 1 then ( stuff for class1)
if counter = 2 then ( stuff for class2) etc
 
then you would have a whole lot of formula to display the results at the end...1 per variable.
 
each variable can only hold 1 value. You want to put, in the above example 4 values on a line, so you need 4 variables for the subjects and another 4 values for the scores, since you are going to print them all at once.
 
If the number of scores per student varies, you will need to 1) make enough variables to hold the 'max' number of subjects 2) put logic in to 'hide' scores where there is not a subject associated.
 
HTH
 
IP IP Logged
sunsuogun
Newbie
Newbie


Joined: 12 Jun 2012
Location: Nigeria
Online Status: Offline
Posts: 8
Quote sunsuogun Replybullet Posted: 13 Jun 2012 at 5:26am
Hi Lockwelle,
 
I duely appreciate your quick responses in providing solution to my report design need.I hav tried ur update and things are not working out  yet as expected.Nevertheless,i need some sort of examples.
 
Assuming I hav 2 offerred subject to show as par my desire format.
 
1.For Detail section is it wht i should hav.?
 
shared stringvar classx := {table.offered};
shared numbervar scorex:={table.score};
shared numbervar counter;
 
shared stringvar class1;
shared numbervar score1
 
 
shared stringvar class2;
shared numbervar score2
 
counter := counter + 1;
 
if counter = 1 then (
class1 := classx;
score1 := scorex;
)
 
if counter = 2 then (
class2 := classx;
score2 := scorex;
)
 
2.For the Group Header
 
shared numbervar counter := 0;
 
shared stringvar class1 :="";
shared numbervar score1 := 0;
 
shared stringvar class2:="";
shared numbervar score2 := 0;
 
3.A sample logic to help  hide score if no subjectofferred exist
 
pls help in providing a more illustrative sample to aid my understanding of how to implement your solution.
 
Thanks for your prompt responses.you are geat.
 
 
 
 
 
 
 
sunsuogun
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 13 Jun 2012 at 7:06am
looks correct.
supression would be in the scorex object in the group footer.
section expert / x-2
shared stringvar classx;
classx = ""
IP IP Logged
sunsuogun
Newbie
Newbie


Joined: 12 Jun 2012
Location: Nigeria
Online Status: Offline
Posts: 8
Quote sunsuogun Replybullet Posted: 14 Jun 2012 at 11:25am
Hi lockwelle,
Thanks for your concern so far in providing solution to my report design issues.
 
I did tried my illustrated sample of creating the repeated part of the approach.
Crystal gives me an error that it does not recognise the repeated class and score  ifs:
 
 
if counter = 2 then (
class2 := classx;
score2 := scorex;
)
 
if counter =3 then (
class3 := classx;
score3 := scorex;
)
 
And I am struck.
 
Hope to hear from you.Maybe you might propose another work around for me.
 
Thanks for your timely responses.
sunsuogun
IP IP Logged
sunsuogun
Newbie
Newbie


Joined: 12 Jun 2012
Location: Nigeria
Online Status: Offline
Posts: 8
Quote sunsuogun Replybullet Posted: 22 Jun 2012 at 4:51am
Hi Lockwelle,
 
You are great.I got my report up as desired by implementing your solution.I truely  appreciate your knowledge base.Keep it up!. once again you are greaaaaaaaaaaaaaaaaaaaaaaaaaaaaat!!!.
 
Thanks
sunsuogun
IP IP Logged
enzy
Newbie
Newbie


Joined: 08 Aug 2013
Online Status: Offline
Posts: 1
Quote enzy Replybullet Posted: 13 Aug 2013 at 8:47pm
Just registered to say thanks!
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