import AEP_MY_FRST_PDF:*; rem global variables used in main body of this report; Global number &gbl_basic, &gbl_allow, &gbl_ded, &gbl_tax, &gbl_net; rem Component variables that hold totals at company, paygroup, department and report levels; Component number &gbl_company_total_basic, &gbl_company_total_allow, &gbl_company_total_ded, &gbl_company_total_tax, &gbl_company_total_net; Component number &gbl_paygroup_total_basic, &gbl_paygroup_total_allow, &gbl_paygroup_total_ded, &gbl_paygroup_total_tax, &gbl_paygroup_total_net; Component number &gbl_dept_total_basic, &gbl_dept_total_allow, &gbl_dept_total_ded, &gbl_dept_total_tax, &gbl_dept_total_net; Component number &gbl_grand_total_basic, &gbl_grand_total_allow, &gbl_grand_total_ded, &gbl_grand_total_tax, &gbl_grand_total_net; rem Formatting constants; Constant &PrintAtr_HeaderLine = "FontSize=10, Bold, Color=magenta"; Constant &PrintAtr_HeaderLineRight = "FontSize = 10, Bold,Color = magenta, right"; Constant &PrintAtr_BeforeTitle = "FontSize=10,Bold,Color=cyan"; Constant &PrintAtr_TotalLine = "FontSize=10,Bold,Color=green"; Constant &PrintAtr_TotalLineRight = "FontSize=10,Bold,Color=green,right"; Constant &PrintAtr_Default = ""; rem column position constants; Constant &Pos_Basic = 43; Constant &pos_Allow = 55; Constant &Pos_Ded = 67; Constant &Pos_Tax = 79; Constant &Pos_Net = 91; Function rpt_begin(&AEP_RPT As AEP_MY_FRST_PDF:AEP_MY_FRST_PDF, &Rec As Record); End-Function; Function rpt_page_header(&AEP_RPT As AEP_MY_FRST_PDF:AEP_MY_FRST_PDF, &Rec As Record); Local number &xPoint, &yPoint, &xPoint2, &yPoint2; &xPoint = &AEP_RPT.get_CurrLeftMargin(); &yPoint = &AEP_RPT.get_PageBottomRight_y() - 20; &xPoint2 = &AEP_RPT.get_PageBottomRight_x(); &yPoint2 = &yPoint - 20; &AEP_RPT.NewLine(1, &Rec); &AEP_RPT.PrintStr(1, "PeopleSoft", "FontName=Helvetica,FontSize=12,Bold,Underline,Centre=,Color=red"); rem print image at Top Right Corner of the page reducing size of the image to 20%; &AEP_RPT.PrintImage(&AEP_RPT.get_PageBottomRight_x(), &AEP_RPT.get_PageTopLeft_y(), 0.2, "c:\sqrplus\docs\psoft.jpg"); &AEP_RPT.NewLine(1, &Rec); &AEP_RPT.PrintStr(1, "Report ID: ", "Bold,Color=blue"); &AEP_RPT.PrintStr(10, Upper(&AEP_RPT.ReportName), "Bold,Color=orange"); &AEP_RPT.NewLine(1, &Rec); &AEP_RPT.PrintStr(1, "Company:", "Bold,Color=blue"); &AEP_RPT.PrintStr(10, "ALL - All Companies", "Bold,Color=orange"); &AEP_RPT.PrintStr(1, &AEP_RPT.ReportDescr, "FontSize=20,Bold,Centre=,Color=green"); &AEP_RPT.PrintStr(75, "Page: " | &AEP_RPT.get_PageNum() | " Of ", "Bold,Color=blue"); &AEP_RPT.PrintTotalPages("Bold,Color=blue"); &AEP_RPT.NewLine(1, &Rec); &AEP_RPT.AdjustCurrPointY( - (&AEP_RPT.get_CharHeight() * 1.5)); &AEP_RPT.PrintStr(1, "PayGroup:", "Bold,Color=blue"); &AEP_RPT.PrintStr(10, "ALL - All Paygroups", "Bold,Color=orange"); &AEP_RPT.PrintStr(75, "Run Date: " | %Date, "Bold,Color=blue"); &AEP_RPT.NewLine(1, &Rec); &AEP_RPT.PrintStr(1, "Department:", "Bold,Color=blue"); &AEP_RPT.PrintStr(10, "ALL - All Departments", "Bold,Color=orange"); &AEP_RPT.PrintStr(75, "Run Time: " | Left(String(%Time), 8), "Bold,Color=blue"); &AEP_RPT.NewLine(1, &Rec); /* blank line */ &AEP_RPT.NewLine(1, &Rec); &AEP_RPT.PrintStr(1, "Slno : Emplid and Name", &PrintAtr_HeaderLine); &AEP_RPT.PrintStr(&Pos_Basic, "Basic", &PrintAtr_HeaderLineRight); &AEP_RPT.PrintStr(&pos_Allow, "Allowances", &PrintAtr_HeaderLineRight); &AEP_RPT.PrintStr(&Pos_Ded, "Deductions", &PrintAtr_HeaderLineRight); &AEP_RPT.PrintStr(&Pos_Tax, "Tax", &PrintAtr_HeaderLineRight); &AEP_RPT.PrintStr(&Pos_Net, "Net", &PrintAtr_HeaderLineRight); &AEP_RPT.NewLine(1, &Rec); rem draw line; &xPoint = &AEP_RPT.get_CurrLeftMargin(); &yPoint = &AEP_RPT.get_CurrPointY() + (&AEP_RPT.get_CharHeight() * 0.5); &xPoint2 = &AEP_RPT.get_CurrPageWidth() - &AEP_RPT.get_CurrRightMargin(); &yPoint2 = &yPoint; &AEP_RPT.DrawLine(&xPoint, &yPoint, &xPoint2, &yPoint2, "color=red"); /* insert some vertical blank space */ &AEP_RPT.AdjustCurrPointY(&AEP_RPT.get_CharHeight() * 1.5); End-Function; Function rpt_page_footer(&AEP_RPT As AEP_MY_FRST_PDF:AEP_MY_FRST_PDF, &Rec As Record); Local number &xPoint, &yPoint, &xPoint2, &yPoint2; rem draw rectangle at the footer of the page; &xPoint = &AEP_RPT.get_CurrLeftMargin(); &yPoint = &AEP_RPT.get_PageBottomRight_y() + 20; &xPoint2 = &AEP_RPT.get_PageBottomRight_x(); &yPoint2 = &yPoint - 20; &AEP_RPT.DrawBox(&xPoint, &yPoint, &xPoint2, &yPoint2, "lineThickness=0,color=red,fillcolor=lightGray"); rem fill is Opaque so printing should be done after filling the box; &AEP_RPT.NewLine(1, &Rec); If &AEP_RPT.LastReportPage() = True Then &AEP_RPT.AdjustCurrPointY( - (&AEP_RPT.get_CharHeight() * 2.0)); &AEP_RPT.PrintStr(65, "Produced by AePlus ", "color=blue"); Else &AEP_RPT.PrintStr(65, "Produced by AePlus, Contd... ", "color=blue"); End-If; rem some absolute printing; &xPoint = &xPoint + 5; &yPoint = &yPoint - 12; &AEP_RPT.PrintStrAbs(&xPoint, &yPoint, "Absolute Printing at Position: (" | Integer(&xPoint) | "," | Integer(&yPoint) | ")", "color=red"); End-Function; Function print_totals_and_reset(&AEP_RPT As AEP_MY_FRST_PDF:AEP_MY_FRST_PDF, &NeedLines As number, &Rec As Record, &key_desc As string, &key_val As string, &Basic As number, &Allow As number, &Ded As number, &Tax As number, &Net As number) Local string &line; rem common function - called from 'AFTER' break events; &AEP_RPT.NewLine(&NeedLines, &Rec); &line = &key_desc | " " | &key_val | " - Totals :"; &AEP_RPT.PrintStr(5, &line, &PrintAtr_TotalLine); &AEP_RPT.PrintStr(&Pos_Basic, NumberToString("%6.2", &Basic), &PrintAtr_TotalLineRight); &AEP_RPT.PrintStr(&pos_Allow, NumberToString("%6.2", &Allow), &PrintAtr_TotalLineRight); &AEP_RPT.PrintStr(&Pos_Ded, NumberToString("%6.2", &Ded), &PrintAtr_TotalLineRight); &AEP_RPT.PrintStr(&Pos_Tax, NumberToString("%6.2", &Tax), &PrintAtr_TotalLineRight); &AEP_RPT.PrintStr(&Pos_Net, NumberToString("%6.2", &Net), &PrintAtr_TotalLineRight); rem initialise totals after printing; &Basic = 0; &Allow = 0; &Ded = 0; &Tax = 0; &Net = 0; End-Function; Function rpt_before_aep_company(&AEP_RPT As AEP_MY_FRST_PDF:AEP_MY_FRST_PDF, &Rec As Record); Local string &filename; Local string &descr; &descr = "Before Company: " | &Rec.GetField(Field.AEP_COMPANY).Value | ", EffDt: " | &Rec.GetField(Field.EFFDT).Value; &AEP_RPT.NewPage(&Rec, ""); &AEP_RPT.PrintStr(1, &descr, &PrintAtr_BeforeTitle); End-Function; Function rpt_after_aep_company(&AEP_RPT As AEP_MY_FRST_PDF:AEP_MY_FRST_PDF, &Rec As Record); print_totals_and_reset(&AEP_RPT, 1, &Rec, "Company", &Rec.GetField(Field.AEP_COMPANY).Value, &gbl_company_total_basic, &gbl_company_total_allow, &gbl_company_total_ded, &gbl_company_total_tax, &gbl_company_total_net); End-Function; Function rpt_before_aep_paygroup(&AEP_RPT As AEP_MY_FRST_PDF:AEP_MY_FRST_PDF, &Rec As Record); &AEP_RPT.NewLine(2, &Rec); &AEP_RPT.PrintStr(1, "Before Paygroup: " | &Rec.GetField(Field.AEP_PAYGROUP).Value, &PrintAtr_BeforeTitle); End-Function; Function rpt_after_aep_paygroup(&AEP_RPT As AEP_MY_FRST_PDF:AEP_MY_FRST_PDF, &Rec As Record); print_totals_and_reset(&AEP_RPT, 2, &Rec, "Paygroup", &Rec.GetField(Field.AEP_PAYGROUP).Value, &gbl_paygroup_total_basic, &gbl_paygroup_total_allow, &gbl_paygroup_total_ded, &gbl_paygroup_total_tax, &gbl_paygroup_total_net); End-Function; Function rpt_before_aep_deptid(&AEP_RPT As AEP_MY_FRST_PDF:AEP_MY_FRST_PDF, &Rec As Record); &AEP_RPT.NewLine(3, &Rec); &AEP_RPT.PrintStr(1, "Before Dept: " | &Rec.GetField(Field.AEP_DEPTID).Value, &PrintAtr_BeforeTitle | ",underline"); End-Function; Function rpt_after_aep_deptid(&AEP_RPT As AEP_MY_FRST_PDF:AEP_MY_FRST_PDF, &Rec As Record); print_totals_and_reset(&AEP_RPT, 3, &Rec, "Department", &Rec.GetField(Field.AEP_DEPTID).Value, &gbl_dept_total_basic, &gbl_dept_total_allow, &gbl_dept_total_ded, &gbl_dept_total_tax, &gbl_dept_total_net); End-Function; Function rpt_detail_section(&AEP_RPT As AEP_MY_FRST_PDF:AEP_MY_FRST_PDF, &Rec As Record); Local string &print_str; Local string &PrintAtr_detail_right = "right"; &AEP_RPT.NewLine(1, &Rec); &print_str = &AEP_RPT.get_RptRowNum() | " : " | &Rec.GetField(Field.AEP_KEY_DETAIL).Value | " - (" | &Rec.GetField(Field.AEP_COMPANY).Value | ":" | &Rec.GetField(Field.AEP_PAYGROUP).Value | ":" | &Rec.GetField(Field.AEP_DEPTID).Value | ") Name"; &AEP_RPT.PrintStr(1, &print_str, &PrintAtr_Default); &AEP_RPT.PrintStr(43, NumberToString("%6.2", &gbl_basic), &PrintAtr_detail_right); &AEP_RPT.PrintStr(55, NumberToString("%6.2", &gbl_allow), &PrintAtr_detail_right); &AEP_RPT.PrintStr(67, NumberToString("%6.2", &gbl_ded), &PrintAtr_detail_right); &AEP_RPT.PrintStr(79, NumberToString("%6.2", &gbl_tax), &PrintAtr_detail_right); &AEP_RPT.PrintStr(91, NumberToString("%6.2", &gbl_net), &PrintAtr_detail_right); rem accumulate break levels totals; &gbl_company_total_basic = &gbl_company_total_basic + &gbl_basic; &gbl_company_total_allow = &gbl_company_total_allow + &gbl_allow; &gbl_company_total_ded = &gbl_company_total_ded + &gbl_ded; &gbl_company_total_tax = &gbl_company_total_tax + &gbl_tax; &gbl_company_total_net = &gbl_company_total_net + &gbl_net; &gbl_paygroup_total_basic = &gbl_paygroup_total_basic + &gbl_basic; &gbl_paygroup_total_allow = &gbl_paygroup_total_allow + &gbl_allow; &gbl_paygroup_total_ded = &gbl_paygroup_total_ded + &gbl_ded; &gbl_paygroup_total_tax = &gbl_paygroup_total_tax + &gbl_tax; &gbl_paygroup_total_net = &gbl_paygroup_total_net + &gbl_net; &gbl_dept_total_basic = &gbl_dept_total_basic + &gbl_basic; &gbl_dept_total_allow = &gbl_dept_total_allow + &gbl_allow; &gbl_dept_total_ded = &gbl_dept_total_ded + &gbl_ded; &gbl_dept_total_tax = &gbl_dept_total_tax + &gbl_tax; &gbl_dept_total_net = &gbl_dept_total_net + &gbl_net; &gbl_grand_total_basic = &gbl_grand_total_basic + &gbl_basic; &gbl_grand_total_allow = &gbl_grand_total_allow + &gbl_allow; &gbl_grand_total_ded = &gbl_grand_total_ded + &gbl_ded; &gbl_grand_total_tax = &gbl_grand_total_tax + &gbl_tax; &gbl_grand_total_net = &gbl_grand_total_net + &gbl_net; End-Function; Function rpt_init_variables(&AEP_RPT As AEP_MY_FRST_PDF:AEP_MY_FRST_PDF, &Rec As Record); rem init variables; &gbl_net = 0; &gbl_basic = 0; &gbl_allow = 0; &gbl_ded = 0; &gbl_tax = 0; End-Function; Function rpt_skip(&AEP_RPT As AEP_MY_FRST_PDF:AEP_MY_FRST_PDF, &Rec As Record) Returns boolean; rem if row after consolodation needs to be skiped based on certain conditions, true should be returned; Local boolean &RtnSts; &RtnSts = False; If &gbl_tax < 700 Or &gbl_net < 1500 Then &RtnSts = True; End-If; Return &RtnSts; End-Function; Function rpt_end(&AEP_RPT As AEP_MY_FRST_PDF:AEP_MY_FRST_PDF, &Rec As Record); Local string &PrintAtr_str = "FontName=Times-Roman,color=16711680,bold,FontSize=12"; If &AEP_RPT.DataReported() = True Then print_totals_and_reset(&AEP_RPT, 10, &Rec, "Grand", "", &gbl_grand_total_basic, &gbl_grand_total_allow, &gbl_grand_total_ded, &gbl_grand_total_tax, &gbl_grand_total_net); End-If; &AEP_RPT.NewLine(1, &Rec); &AEP_RPT.NewLine(1, &Rec); &AEP_RPT.NewLine(1, &Rec); &AEP_RPT.PrintStr(40, "Total Input Rows Processed: " | &AEP_RPT.get_InputRowNum(), &PrintAtr_str); /* insert some vertical blank space */ &AEP_RPT.AdjustCurrPointY(&AEP_RPT.get_CharHeight()); &AEP_RPT.NewLine(1, &Rec); &AEP_RPT.PrintStr(40, "Total Rows Reported: " | &AEP_RPT.get_RptRowNum(), &PrintAtr_str); &AEP_RPT.NewLine(1, &Rec); &AEP_RPT.NewLine(1, &Rec); &AEP_RPT.NewLine(1, &Rec); &AEP_RPT.PrintStr(1, "*** End of Report ***", "fontsize=16,centre=,italic,color = rgb(60 : 179 : 113)"); &AEP_RPT.NewLine(1, &Rec); &AEP_RPT.NewLine(1, &Rec); End-Function;