Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Cross Tab Report Help Post Reply Post New Topic
Author Message
dotssabdi
Newbie
Newbie
Avatar

Joined: 27 Sep 2010
Location: Pakistan
Online Status: Offline
Posts: 5
Quote dotssabdi Replybullet Topic: Cross Tab Report Help
     Posted: 27 Sep 2010 at 10:34am
I have Just Stuck during developing a report
1st i describe the report

This is Student Attendance report (Cross tab)

Days >>     1-jan 2-jan 3-jan 4-jan 5-jan 6-jan ..
Std_Reg_No
     256541 Presnt Absent Absent Leave Absent Absent
     256542 Presnt Absent Presnt Absent Absent Absent
     256543 Presnt Absent Absent Absent Absent Absent
     256544 Absent Absent Presnt Absent Absent Absent
     256545 Leave Absent Absent Absent Absent Presnt


Problem is tht where i want absent and present Or leave
the report shows me one "1" OR "0" tht is because summarize field can only show numerical value..
i had tried enough also used "Display string" property
i want status as absent/present/leave insted of numerical value
one thing i want to mentioned tht status is stored in
my database table and its field name is student_attendance.status..

any one can help me?
S.Abdi
IP IP Logged
rvink
Groupie
Groupie
Avatar

Joined: 04 Feb 2008
Location: New Zealand
Online Status: Offline
Posts: 55
Quote rvink Replybullet Posted: 27 Sep 2010 at 12:04pm
I assume the database contains only one status for each student on a each day - a student cannot be present and absent on the same day. If so, your query needs to include the status description absent/present/leave. Otherwise create a formula to output the status description based on the status ID number.
In your Crosstab Expert put in the values:
- Rows: Std_Reg_No
- Columns: Date (group by day)
- Summarized field: Max(attendance status)

Even though each cell will only have one record, you must use a summary function. Max() will work for string fields, and will show the description you want.


Edited by rvink - 27 Sep 2010 at 12:06pm
IP IP Logged
dotssabdi
Newbie
Newbie
Avatar

Joined: 27 Sep 2010
Location: Pakistan
Online Status: Offline
Posts: 5
Quote dotssabdi Replybullet Posted: 27 Sep 2010 at 9:15pm
"rvink" Thanks for your reply...

Max() function will also return numerical value while i want string value and it also show "Present/Absent/Leave" bt it is not show in correct position

what i want to say is
student 256541 is leave at 2-jan bt report show it as abent... idont know whyyy

my code is........(this is on show string formula of summarize field)
'------------
    if currentfieldvalue=1 then

        formula={Student_Absent.Status}
       
    else
        formula="P"
    end if

'-----------
while {Student_Absent.Status} is a database field which only found in table if any student is absent or leave...

actual problem is
crystal report padding the very 1st value of {Student_Absent.Status} it found in table
S.Abdi
IP IP Logged
dotssabdi
Newbie
Newbie
Avatar

Joined: 27 Sep 2010
Location: Pakistan
Online Status: Offline
Posts: 5
Quote dotssabdi Replybullet Posted: 28 Sep 2010 at 12:37am
anyone????
S.Abdi
IP IP Logged
Emir_W
Senior Member
Senior Member
Avatar

Joined: 25 Apr 2010
Online Status: Offline
Posts: 228
Quote Emir_W Replybullet Posted: 28 Sep 2010 at 2:07am
try to help.
 
1. create formula for status
e.g.:
xStatus =
if {tbl.status}=0 then 'Absent' else
if {tbl.status}=1 then 'Present' else 'Leave'
 
or something like that.
 
2. in crosstab (CT)
row = student-ID
column = date
summarized = xStatus (formula that you created)
 
 
 
hope it help.
 
Emir W
IP IP Logged
dotssabdi
Newbie
Newbie
Avatar

Joined: 27 Sep 2010
Location: Pakistan
Online Status: Offline
Posts: 5
Quote dotssabdi Replybullet Posted: 29 Sep 2010 at 6:00am
Emir_W thank for reply ..

sorry this is not working bro..

i want to share one thing possible it help u to make some solution ..

when i use this code

(this is on show string formula of summarize field)
'------------
    if currentfieldvalue=1 then

        formula={Student_Absent.Status}
       
    else
        formula="P"
    end if

'-----------

it is not changing the status between "Absent OR Leave"
and doing work for "Present" perfectly ..
what crystal report doing exactly the very 1st record it found in databse padding it in all status for every student on each day ..

plz do reply me.. Thanks
S.Abdi
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