<%@ page contentType="text/html; charset=UTF-8"%> <%@ page import="com.csc.library.system.*,com.csc.library.utilities.*,com.csc.library.cscexport.*,java.util.*,com.csc.library.entry.*,com.csc.library.database.*,com.csc.library.session.*"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <HTML> <HEAD> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <META name="GENERATOR" content="IBM WebSphere Studio"> <META http-equiv="Content-Style-Type" content="text/css"> <LINK href="theme/Master.css" rel="stylesheet" type="text/css"> <TITLE>Export income || tax to Text</TITLE> </HEAD> <BODY> <% UProfile UP = new UProfile(); UP = new UProfile(); //UP.setDbName("EASYBUY_ORACLE"); UP.setDbName("ORA_PRDBS"); //UP.setDbName("MYHRDBS"); UP.setSchemaName("PR"); UP.setUserName("myhradmin"); UP.set("companyid", "001"); //UP.set("companyid", "10"); UP.set("lang", "eng"); UP.set("appname","Payroll"); int error=0; try{ String data = "",tmp=""; DbInquiry tax = new InitialInquiry(UP).getDbInquiry(); tax.setParam("PERIOD_MONTH","11"); tax.setParam("PERIOD_YEAR","2005"); tax.initMyTable("Reportpgd","",""); tax.setColumn("*"); tax.setFilter("employeeid >= 'J2203024' and employeeid <= 'P9911002'"); //tax.setFilter("employeeid <= 'J2406053'"); DbInquiry taxm = new InitialInquiry(UP).getDbInquiry(); taxm.initMyTable("pmempl_taxy","period='11'",""); taxm.setColumn("*"); tax.putChild(taxm); tax.refresh(); while (tax.next()){ //System.out.print("Employee ID = "+tax.getString("employeeid")); //System.out.print(" Income = "+tax.getString("_inc_check_caltax")); data += "Employee ID = "+tax.getString("employeeid")+"\t\t\t\t\t"+tax.getString("_inc_check_caltax"); tmp =""; tmp += "\t\t\t\t\t"+tax.getString("_inctax"); DbInquiry tax2 = new InitialInquiry(UP).getDbInquiry(); tax2.setParam("PERIOD_MONTH","12"); tax2.setParam("PERIOD_YEAR","2005"); tax2.initMyTable("Reportpgd","",""); tax2.setColumn("*"); tax2.setFilter("employeeid",tax.getString("employeeid")); DbInquiry taxm2 = new InitialInquiry(UP).getDbInquiry(); taxm2.initMyTable("pmempl_taxy","period='12'",""); taxm2.setColumn("*"); tax2.putChild(taxm2); tax2.refresh(); while (tax2.next()){ //System.out.println(" "+ tax2.getString("_inc_check_caltax")); data += " || "+tax2.getString("_inc_check_caltax"); tmp += " || "+tax2.getString("_inctax"); data += tmp+"\r\n"; } }// end--while WriteFile w = new WriteFile("D:/EnterprisePT/Jboss4/server/default/deploy/HRPEAP.ear/hrAppWeb.war/PAYROLL/EXPORT/Report PGD.txt"); w.writeString(data); out.println(data); }catch(Exception e){ e.printStackTrace(); } %> </BODY> </HTML>