Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Dynamic Column generation in Crystal Report Post Reply Post New Topic
Author Message
Lokesh
Newbie
Newbie


Joined: 31 Mar 2011
Location: India
Online Status: Offline
Posts: 3
Quote Lokesh Replybullet Topic: Dynamic Column generation in Crystal Report
     Posted: 31 Mar 2011 at 9:54pm
Hi,
We have a requirement to generate report in crystal report which is similar to the sample scenario as given below.

List all the Employee details based on their Department ( Grouping ) having start date and End date as input parameter, to display their Gross salary and Take home salary for each month.
Please check the tables for sample whose start date is FEB-2011 and End Date is MAR-2011. This will display 2 columns of gross and take home salary.

If the input date ranges for 5 months then it has to display 5 columns of gross and take home salary and their total.

I hope I made it clear.



Input : Start Date: 11-Feb;  End Date: 11-Mar
 
 
11-Feb
11-Mar
Total
Compliances
Name
Dept
Gross
TakeHome
Gross
TakeHome
Gross
TakeHome
HR
 
 
 
AAA
HR
1000
500
1000
300
2000
800
250
BB
HR
1500
750
1000
500
2500
1250
200
 
 
 
 
 
 
 
 
 
Admin
 
 
CC
Admin
2000
1000
2500
1500
4500
2500
180
DD
Admin
3000
2000
1000
600
4000
2600
154
 
Input: Start Date: 10-Dec; End Date:  11-Mar
 
 
10-Dec
11-Jan
11-Feb
11-Mar
Total
Compliances
Name
Dept
Gross
TakeHome
Gross
TakeHome
Gross
TakeHome
Gross
TakeHome
Gross
TakeHome
HR
 
 
 
AAA
HR
1000
500
1000
300
750
200
500
100
3250
1100
296
BB
HR
1500
750
1000
500
1500
800
700
300
4700
2350
200
 
 
 
 
 
 
 
 
 
 
 
 
 
Admin
 
 
CC
Admin
2000
1000
2500
1500
1500
800
1000
600
7000
3900
180
DD
Admin
3000
2000
1000
600
600
200
100
50
4700
2850
165
 
Query is returning the data as given below
Name
Dept
GrossSalary
TakeHomeSalary
Date
AAA
Hr
1000
500
11-Mar
AAA
Hr
1000
300
11-Feb
BB
Hr
1500
750
11-Mar
BB
Hr
1000
500
11-Feb
CC
Admin
2000
1000
11-Mar
CC
Admin
2500
1500
11-Feb
 


Note: Compliance = (Total Gross / Total TakeHome) * 100


Since I am new to crystal report appreciate your Feedback/suggestion in detail.

Thanking You

Regards,
Lokesh
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 01 Apr 2011 at 2:13am
Use a Cross Tabs report.
 
You aren't looking for dynamic columns, the columns are fixed, they are just repeated for different time periods.
 
I don't have much experience with them, but they deal only in summaries, and should be perfect.
 
HTH
IP IP Logged
Lokesh
Newbie
Newbie


Joined: 31 Mar 2011
Location: India
Online Status: Offline
Posts: 3
Quote Lokesh Replybullet Posted: 04 Apr 2011 at 9:11pm
Thanks HTH !! for your response.

I do know that cross tab has to be used, but being a new to crystal report, I am having tough time to create as per the requirement. so request to give tip / suggestion on how to dynamically create the columns as per the user input.

Regards,
Lokesh
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