Tips and Tricks
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Tips and Tricks
Message Icon Topic: One grid with 52 weeks Post Reply Post New Topic
Author Message
edsilva
Newbie
Newbie


Joined: 14 Feb 2008
Location: Brazil
Online Status: Offline
Posts: 2
Quote edsilva Replybullet Topic: One grid with 52 weeks
    Posted: 14 Feb 2008 at 11:32am
I have a maintenance plan with those informations:
1. Equipment         A         A         C          D      D
2.Week                  1         6         4          4      7
3. Activitye             P1       P9       P6        P3     P6
 
I need to prepare a report that shows all 52 weeks but I have more then one activity by equipment.
 
My report must be:
 
Equipment WK1 WK2 WK3 WK4 WK5 WK6 WK7 WK8........ WK52
    A              P1                                      P9
    C                                       P6
    D                                       P3                   P6
 
How can I do this ?
 
Thanks for help
Ed
IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 15 Feb 2008 at 3:21am
Hi
 
Create view using the  Query at backend  and then use that view in the report.
 
"WK_ACT"."EQ",    (Equipment)
"WK_ACT"."WK"     (Week)
"WK_ACT"."ACT      (Activity)
 
 
SELECT
"WK_ACT"."EQ",    (Equipment)
MAX(case "WK_ACT"."WK" when 1 then "WK_ACT"."ACT"  end) 'WK1',
MAX(case "WK_ACT"."WK" WHEN 2 then "WK_ACT"."ACT"  end) 'WK2',
MAX(case "WK_ACT"."WK" WHEN 3 then "WK_ACT"."ACT"  end) 'WK3',
MAX(case "WK_ACT"."WK" WHEN 4 then "WK_ACT"."ACT"  end) 'WK4',
MAX(case "WK_ACT"."WK" WHEN 5 then "WK_ACT"."ACT"  end) 'WK5',
MAX(case "WK_ACT"."WK" WHEN 6 then "WK_ACT"."ACT"  end) 'WK6',
MAX(case "WK_ACT"."WK" WHEN 7 then "WK_ACT"."ACT"  end) 'WK7'
FROM "Test"."dbo"."WK_ACT" "WK_ACT"
GROUP BY "WK_ACT"."EQ"
 
I have done it for 7 weeks... you need to code remaining weeks.......

Output
 
EQ WK1 WK2 WK3 WK4 WK5 WK6 WK7
A P1         P9  
C       P6      
D       P3     P6
 
 
Cheers
Rahul
IP IP Logged
edsilva
Newbie
Newbie


Joined: 14 Feb 2008
Location: Brazil
Online Status: Offline
Posts: 2
Quote edsilva Replybullet Posted: 15 Feb 2008 at 3:57am
That is a good idea, I will test it.
 
Thaks a lot.
 
Edsilva
Ed
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.