cancel
Showing results for 
Search instead for 
Did you mean: 

Conditional Data show / change values to be shown for months

Former Member
0 Kudos

Dear All,

I am trying to make a report for Employee Compensation History with the following query

SELECT T1.DocEntry, T2.Period, T2.u_payperiod,T0.dept, T3.Name, T0.empID, T0.firstName, 
T4.U_note,T0.lastName, T1.U_ebasic, T1.U_ehra, T1.U_etrspt, T1.U_ecola, 
(T1.U_ebasic + T1.U_ehra + T1.U_etrspt + T1.U_ecola) 'Sub-Total 1',  
T1.U_education,T1.U_grosssal, (T1.U_grosssal + T1.U_education) 'Sub-Total 2',
T1.U_oadd, T1.U_enothour, T1.U_ebonus, (T1.U_oadd + T1.U_enothour + T1.U_ebonus) 'Additions Sub-Total-3',
T1.U_dedhra, T1.U_dedtrans, T1.U_dedsa, 
T1.U_oded,T1.U_ducloan,(T1.U_dedhra + T1.U_dedtrans + T1.U_dedsa + T1.U_oded +T1.U_ducloan) 'Deductions Sub-Total-4',
T1.U_netsal, T1.U_bank, T1.U_accno, T1.U_Remarks 
FROM dbo.OHEM T0 
INNER JOIN [dbo].[OUDP] T3 ON T3.Code = T0.dept
INNER JOIN [dbo].[@PAYROLL_PR_DETAIL] T1 ON t1.U_ecode=t0.empid
INNER JOIN [dbo].[@PAYROLL_PROLL_HEAD] T2 ON t2.docentry=t1.docentry 
INNER JOIN [dbo].[@PAYROLE_PP_HEAD] T4 ON T4.u_srlno=t2.u_payperiod

In crystal Report I have made a Group of T0.firstName which is the Employee Name, Second I have made a group of T4.U_Note wherein Each Month is displayed ( E.g Jan, Feb, March, April, May...till December ).

I have bought u_ebasic ( which is the basic salary ) in the second group row. Next T1.u_ehra and so on side by.

Hence the reports looks like

Employee A      u_eBasic      u_ehra
Jan 09               5000             2000 
Feb 09               5000             2000
March 09           6000             3000
April 09              6000            3000
May 09               6000            3000
June 09              6000            3000
July 09               6000            3000
August 09          7000            3500
September 09    7000            3500 
October 09        7000            3500
November 09     7000           3500
December 09     7000           3500

Now I want to display in the above only the changes row in the report. Means Jan09 should show as its the starting then March 09 with the value of 6000 for Basic and Hra should show as its revised, then August 09 should show with the corresponding vales and supress or skip all data where there is no change.

How to achieve such conditions through Crystal Report. Please advise.

Best Regards,

Depika

Accepted Solutions (1)

Accepted Solutions (1)

former_member260594
Active Contributor
0 Kudos

Hello Depika,

If I understand correctly you only want to display rows where the basic amount if different from the previous amount. If that is correct then you can suppress the section based on a formula similar to the following;

not (onfirstrecord) and = previous()

Former Member
0 Kudos

Dear Graham,

An excellent suggestion. The problem seems to be resolved.

Mohammed : Thanks to you also for giving suggestions.

Regards,

Depika

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi

please create fomuael variable with each varibale assigned witht he tale ffields and arrange those varaibles as the table in CR designer.

Use suppress in format object to acheiver the things youare looking for. YOu have to write the formuael.

whati s the backended DB? I suggest sif it is sql or oracle then dont gofor command query. place and conditionally handle the objects.

Former Member
0 Kudos

Dear Mohammad,

I am not able to understand. Can you please explain in details or show some examples of how to achieve the requirement.

Regards,

Depika

Former Member
0 Kudos

Hi deepika

Actually, my input is quite simillar to what Graham has suggested. only difference is the object should be suppressed and the display of data should be handled.

because your core requirement is to conditionally display the data based on some logic.

Let me rephrase the statement

Instaad of putting the database fields directly into the designer, please use formulae variables.

that means, the new formulae which you have created each will hold each database field.

Design the blank report with formuale and use suppress option of the object to conditionally display the data you want.

Int his way, you will have less maintenance in future. My idea is similar to adhoc reporting.