Commit d061a8aa authored by bpandey's avatar bpandey

develop a new report with chart


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@93319 ce508802-f39f-4f6c-b175-0d175dae99d5
parent c6f82fd9
package ibase.dashboard.sfa.ejb;
import ibase.system.config.ConnDriver;
import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;
import javax.ejb.Stateless;
/**
* Session Bean implementation class CustomerMeetingTrends
*/
@Stateless
public class CustomerMeetingTrends extends ValidatorEJB implements CustomerMeetingTrendsRemote, CustomerMeetingTrendsLocal
{
/**
* Default constructor.
*/
String salePersn = "";
public String getSalePersn()
{
return salePersn;
}
public void setSalePersn(String salePersn)
{
this.salePersn = salePersn;
}
public CustomerMeetingTrends()
{
// TODO Auto-generated constructor stub
}
public String getData() throws RemoteException, ITMException
{
return "";
}
public String getData(String loginCode) throws RemoteException, ITMException
{
String sql = "";
ResultSet rs = null;
Connection conn = null;
PreparedStatement pstmt = null;
ConnDriver connDriver = new ConnDriver();
StringBuffer xmlData = null;
List<String> weekList = new ArrayList<String>();
List<String> cyearList = new ArrayList<String>();
List<String> doctorList = new ArrayList<String>();
List<String> chemistList = new ArrayList<String>();
List<String> stockistList = new ArrayList<String>();
List<String> unlistedList = new ArrayList<String>();
try
{
conn = connDriver.getConnectDB("DriverITM");
connDriver = null;
sql = "select sp.sales_pers, sp.sp_name, sp.year, sp.week, Sum(Case When Strg_Meet.Strg_Type = 'D' and Strg_Meet.Strg_Code Not Like 'UL%' then 1 Else 0 End) as Doctors, Sum(Case When Strg_Meet.Strg_Type = 'C' and Strg_Meet.Strg_Code Not Like 'UL%' then 1 Else 0 End) as Chemist, Sum(Case When Strg_Meet.Strg_Type = 'S' and Strg_Meet.Strg_Code Not Like 'UL%' then 1 Else 0 End) as STockist, Sum(Case When Strg_Meet.Strg_Type = 'D' and Strg_Meet.Strg_Code Like 'UL%' then 1 Else 0 End) as Unlisted from ( select sales_pers, SP_NAME, Dt, to_char(dt,'WW') as Week, month_no AS Month, TO_CHAR(DT,'MON') as Month_Mon, year from sales_pers cross join sfa_time where sales_pers =? and Sfa_time.dt >= (trunc(sysdate,'WW')+6)-41 and Sfa_time.dt <= to_Date(sysdate) ) sp left Join strg_meet on strg_meet.sales_pers=sp.sales_pers and strg_meet.event_date = sp.dt Group by sp.sales_pers, sp.sp_name, sp.year, sp.week Order by Year asc , Week asc";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, loginCode);
rs = pstmt.executeQuery();
xmlData = new StringBuffer("<?xml version='1.0'?> <Root>");
while (rs.next())
{
cyearList.add(rs.getString(3));
weekList.add(rs.getString(4));
doctorList.add(rs.getString(5));
chemistList.add(rs.getString(6));
stockistList.add(rs.getString(7));
unlistedList.add(rs.getString(8));
}
pstmt.close();
pstmt = null;
rs.close();
rs = null;
/** XML String for year-week **/
xmlData.append("<Detail1>");
for(int i=0;i<cyearList.size();i++)
{
xmlData.append("<yearweek><![CDATA[ ").append(cyearList.get(i)+"-"+weekList.get(i)).append( "]]></yearweek>");
}
xmlData.append("</Detail1>");
/** XML String for Doctors **/
xmlData.append("<Detail2>");
for (String doctor : doctorList)
{
xmlData.append("<doctor><![CDATA[ ").append(doctor).append( "]]></doctor>");
}
xmlData.append("</Detail2>");
/** XML String for Chemist **/
xmlData.append("<Detail3>");
for (String chemist : chemistList)
{
xmlData.append("<chemist><![CDATA[ ").append(chemist).append( "]]></chemist>");
}
xmlData.append("</Detail3>");
/** XML String for Stockist **/
xmlData.append("<Detail4>");
for (String stockist : stockistList)
{
xmlData.append("<stockist><![CDATA[ ").append(stockist).append( "]]></stockist>");
}
xmlData.append("</Detail4>");
/** XML String for Unlisted **/
xmlData.append("<Detail5>");
for (String unListed : unlistedList)
{
xmlData.append("<unlisted><![CDATA[ ").append(unListed).append( "]]></unlisted>");
}
xmlData.append("</Detail5>");
xmlData.append("</Root>");
System.out.println("data xml-->[" + xmlData.toString() + "]");
} catch (Exception e)
{
e.printStackTrace();
throw new ITMException(e);
} finally
{
try
{
if (conn != null)
{
if (rs != null)
rs.close();
rs = null;
if (pstmt != null)
pstmt.close();
pstmt = null;
conn.close();
conn = null;
}
conn = null;
} catch (Exception d)
{
d.printStackTrace();
throw new ITMException(d);
}
}
return xmlData.toString();
}
private String checkNull(String input)
{
System.out.print("in check null method =" + input);
if (input == null)
{
input = "";
} else
{
input = input.trim();
}
return input;
}
}
package ibase.dashboard.sfa.ejb;
import ibase.webitm.ejb.ValidatorLocal;
import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException;
import javax.ejb.Local;
@Local
public interface CustomerMeetingTrendsLocal extends ValidatorLocal {
public String getData(String loginCode) throws RemoteException, ITMException;
public String getData() throws RemoteException,ITMException;
}
package ibase.dashboard.sfa.ejb;
import ibase.webitm.ejb.ValidatorRemote;
import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException;
import javax.ejb.Remote;
@Remote
public interface CustomerMeetingTrendsRemote extends ValidatorRemote
{
public String getData(String loginCode) throws RemoteException, ITMException;
public String getData() throws RemoteException,ITMException;
}
\ No newline at end of file
package ibase.dashboard.sfa.ejb;
import javax.ejb.Stateless;
import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException;
import java.sql.*;
import ibase.system.config.ConnDriver;
/**
* Session Bean implementation class DashboardPortal
*/
@Stateless
public class DoctorsMeetingByClass extends ValidatorEJB implements DoctorsMeetingByClassRemote, DoctorsMeetingByClassLocal
{
/**
* Default constructor.
*/
String salePersn = "";
public String getSalePersn()
{
return salePersn;
}
public void setSalePersn(String salePersn)
{
this.salePersn = salePersn;
}
public DoctorsMeetingByClass()
{
// TODO Auto-generated constructor stub
}
public String getData() throws RemoteException, ITMException
{
return "";
}
/*
* private Connection getConn() throws ITMException { Connection conn =
* null; ConnDriver connDriver = new ConnDriver(); try { conn =
* connDriver.getConnectDB("DriverITM"); connDriver = null;
*
* } catch (Exception e) { e.printStackTrace(); throw new ITMException(e); }
* connDriver = null; return conn; }
*/
public String getData(String loginCode) throws RemoteException, ITMException
{
String sql = "";
ResultSet rs = null;
Connection conn = null;
PreparedStatement pstmt = null;
ConnDriver connDriver = new ConnDriver();
StringBuffer xmlData = null;
try
{
conn = connDriver.getConnectDB("DriverITM");
connDriver = null;
/*Calendar c= Calendar.getInstance();
java.util.Date date = new java.util.Date(c.getTimeInMillis());
cyear = new SimpleDateFormat("yy").format(date);
cmonth = new SimpleDateFormat("MMMM").format(date); */
sql = "Select Sales_Pers.Sales_Pers as Sales_Pers, Sales_Pers.SP_Name as SP_Name, (Case When Strg_Meet.Strg_Type = 'D' then 'Doctor' End) as Cust_Type, (Case When Strg_Meet.Strg_Code Like 'UL%' then 'Unlisted' Else Strg_Cust_Class.Class_Code_Descr End) as Category, Count(Strg_Meet.Strg_Code ) as Visits from Sales_Pers Inner Join Strg_Meet on Strg_Meet.Sales_Pers = Sales_Pers.Sales_Pers And Strg_Meet.Strg_Type = 'D' Inner Join Strg_Cust_Class on Strg_Meet.Strg_Type = Strg_Cust_Class.Cust_type and Strg_Meet.Strg_Class_Code = Strg_Cust_Class.Class_Code where Sales_Pers.Sales_Pers = ? and To_Char(Strg_Meet.Event_date,'MMYYYY') = To_Char(sysdate,'MMYYYY') Group By Sales_Pers.Sales_Pers, Sales_Pers.SP_Name, Strg_Meet.Strg_Type, (Case When Strg_Meet.Strg_Code Like 'UL%' then 'Unlisted' Else Strg_Cust_Class.Class_Code_Descr End) Order By Category";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, loginCode);
rs = pstmt.executeQuery();
//xmlData = new StringBuffer("<?xml version='1.0'?><chart caption='Doctors Meeting by Class for "+cmonth+"-"+cyear+"' baseFont='Arial' xAxisName='Category' yAxisName='Visits' showLabels='0' showLegend='1'>");
xmlData = new StringBuffer("<?xml version=\"1.0\"?><Root>");
while (rs.next())
{
xmlData.append("<Detail>");
xmlData.append("<category>").append("<![CDATA[" + checkNull(rs.getString("Category"))+"]]>").append("</category>");
xmlData.append("<visits>").append("<![CDATA[" + checkNull(rs.getString("Visits"))+"]]>").append("</visits>");
xmlData.append("</Detail>");
}
xmlData.append("</Root>");
System.out.println("XML DATA is= >"+xmlData);
pstmt.close();
pstmt = null;
rs.close();
rs = null;
} catch (Exception e)
{
e.printStackTrace();
throw new ITMException(e);
} finally
{
try
{
if (conn != null)
{
if (rs != null)
rs.close();
rs = null;
if (pstmt != null)
pstmt.close();
pstmt = null;
conn.close();
conn = null;
}
conn = null;
} catch (Exception d)
{
d.printStackTrace();
throw new ITMException(d);
}
}
return xmlData.toString();
}
private String checkNull(String input)
{
System.out.print("in check null method =" + input);
if (input == null)
{
input = "";
} else
{
input = input.trim();
}
return input;
}
}
package ibase.dashboard.sfa.ejb;
import ibase.webitm.ejb.ValidatorLocal;
import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException;
import javax.ejb.Local;
@Local
public interface DoctorsMeetingByClassLocal extends ValidatorLocal
{
public String getData(String loginCode) throws RemoteException, ITMException;
public String getData() throws RemoteException,ITMException;
}
package ibase.dashboard.sfa.ejb;
import ibase.webitm.ejb.ValidatorRemote;
import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException;
import javax.ejb.Remote;
@Remote
public interface DoctorsMeetingByClassRemote extends ValidatorRemote
{
public String getData(String loginCode) throws RemoteException, ITMException;
public String getData() throws RemoteException,ITMException;
}
package ibase.dashboard.sfa.ejb;
import javax.ejb.Stateless;
import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException;
import java.sql.*;
import ibase.system.config.ConnDriver;
/**
* Session Bean implementation class DashboardPortal
*/
@Stateless
public class ExpenseProcessStatus extends ValidatorEJB implements ExpenseProcessStatusRemote, ExpenseProcessStatusLocal
{
/**
* Default constructor.
*/
String salePersn = "";
public String getSalePersn()
{
return salePersn;
}
public void setSalePersn(String salePersn)
{
this.salePersn = salePersn;
}
public ExpenseProcessStatus()
{
// TODO Auto-generated constructor stub
}
public String getData() throws RemoteException, ITMException
{
return "";
}
/*
* private Connection getConn() throws ITMException { Connection conn =
* null; ConnDriver connDriver = new ConnDriver(); try { conn =
* connDriver.getConnectDB("DriverITM"); connDriver = null;
*
* } catch (Exception e) { e.printStackTrace(); throw new ITMException(e); }
* connDriver = null; return conn; }
*/
public String getData(String loginCode) throws RemoteException, ITMException
{
String sql = "";
ResultSet rs = null;
Connection conn = null;
PreparedStatement pstmt = null;
ConnDriver connDriver = new ConnDriver();
StringBuffer xmlData = null;
try
{
conn = connDriver.getConnectDB("DriverITM");
connDriver = null;
sql = "Select sp_period.sales_pers as sales_code, initcap(sp_period.sp_name) as salesperson_name, to_char(sp_period.fr_date,'YY') as Period1, to_char(sp_period.fr_date,'MM') as Period2, to_char(sp_period.fr_date,'YYYYMM') as Period3, concat(concat((concat(' ',trim(to_char(sp_period.fr_date,'Month')))),' - '),to_char(sp_period.fr_date,'YY')) as Period, Tour.Net_Amt as Amount, to_char(Tour.Chg_Date,'dd/mm/yy') as Submitted_Date, Obj_Sign_Trans_1.Sign_Status as Apporval_Status, to_char(Max(Wf_Prc_Status.Status_Date),'dd/mm/yy') as Status_Date from ( select sales_pers,sp_name,active_yn, fr_date,to_date from sales_pers,period where fr_date >= to_char(last_day(add_months(sysdate,-4))+1) and to_date < = to_char(last_day(add_months(sysdate,-1))) ) sp_period left join Tour on Tour.emp_code = sp_period.sales_pers and Tour.Date_from = sp_period.fr_date and Tour.Date_to = sp_period.to_date left join Wf_Prc_Status on Wf_Prc_Status.ref_id = Tour.Tour_Id left join Obj_Sign_Trans on Obj_Sign_Trans.Ref_Id = Tour.Tour_Id inner join ( select Ref_Id,Sign_Status,line_no from Obj_Sign_Trans ) Obj_Sign_Trans_1 on Obj_Sign_Trans_1.Ref_Id = Obj_Sign_Trans.Ref_Id where sp_period.active_yn = 'Y' and sp_period.sales_pers = ? " + " group by sp_period.sales_pers, sp_period.sp_name, to_char(sp_period.fr_date,'YY'), to_char(sp_period.fr_date,'MM'), to_char(sp_period.fr_date,'YYYYMM'), to_char(sp_period.fr_date,'Month'), Tour.Net_Amt, Obj_Sign_Trans_1.Line_No, to_char(Tour.Chg_Date,'dd/mm/yy'), Obj_Sign_Trans_1.Sign_Status having (Obj_Sign_Trans_1.line_no = max(Obj_Sign_Trans.line_no)) UNION ALL Select sp_period.sales_pers as sales_code, initcap(sp_period.sp_name) as salesperson_name, to_char(sp_period.fr_date,'YY') as Period1, to_char(sp_period.fr_date,'MM') as Period2, to_char(sp_period.fr_date,'YYYYMM') as Period3, concat(concat((concat(' ',trim(to_char(sp_period.fr_date,'Month')))),' - '),to_char(sp_period.fr_date,'YY')) as Period, Tour.Net_Amt as Amount, to_char(Tour.Chg_Date,'dd/mm/yy') as Submitted_Date, 'NOT' as Apporval_Status, to_char(Max(Wf_Prc_Status.Status_Date),'dd/mm/yy') as Status_Date from ( select sales_pers,sp_name,active_yn, fr_date,to_date from sales_pers,period where fr_date >= to_char(last_day(add_months(sysdate,-4))+1) and to_date < = to_char(last_day(add_months(sysdate,-1))) ) sp_period left join Tour on Tour.emp_code = sp_period.sales_pers and Tour.Date_from = sp_period.fr_date and Tour.Date_to = sp_period.to_date left join Wf_Prc_Status on Wf_Prc_Status.ref_id = Tour.Tour_Id left join Obj_Sign_Trans on Obj_Sign_Trans.Ref_Id = Tour.Tour_Id where sp_period.active_yn = 'Y' and sp_period.sales_pers = ? " + " group by sp_period.sales_pers, sp_period.sp_name, to_char(sp_period.fr_date,'YY'), to_char(sp_period.fr_date,'MM'), to_char(sp_period.fr_date,'YYYYMM'), to_char(sp_period.fr_date,'Month'), Tour.Net_Amt, to_char(Tour.Chg_Date,'dd/mm/yy'), 'NOT' having ( max(Obj_Sign_Trans.line_no) IS NULL) ORDER BY Period1, Period2, Period3, Period ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, loginCode);
pstmt.setString(2, loginCode);
rs = pstmt.executeQuery();
xmlData = new StringBuffer("<?xml version=\"1.0\"?><Root>");
while (rs.next())
{
this.setSalePersn(rs.getString("salesperson_name"));
xmlData.append("<Detail>");
xmlData.append("<period >").append("<![CDATA[" + checkNull(rs.getString("Period")) + "]]>").append("</period>");
xmlData.append("<amount>").append("<![CDATA[" + rs.getDouble("Amount") + "]]>").append("</amount>");
System.out.print("in check Date method =" + rs.getString("Submitted_Date") );
if (rs.getString("Submitted_Date") != null)
{
xmlData.append("<submitted_date>").append("<![CDATA[" + rs.getString("Submitted_Date") + "]]>").append("</submitted_date>");
} else
{
xmlData.append("<submitted_date>").append("<![CDATA[ ]]>").append("</submitted_date>");
}
xmlData.append("<apporval_status>").append("<![CDATA[" + checkNull(rs.getString("Apporval_Status")) + "]]>").append("</apporval_status>");
xmlData.append("</Detail>");
}
xmlData.append("</Root>");
pstmt.close();
pstmt = null;
rs.close();
rs = null;
} catch (Exception e)
{
e.printStackTrace();
System.out.println("Exception in: ExpenseProcessStatus :"+e.getMessage());
throw new ITMException(e);
} finally
{
try
{
if (conn != null)
{
if (rs != null)
rs.close();
rs = null;
if (pstmt != null)
pstmt.close();
pstmt = null;
conn.close();
conn = null;
}
conn = null;
} catch (Exception d)
{
d.printStackTrace();
System.out.println("Exception : ExpenseProcessStatus:" + d.getMessage());
throw new ITMException(d);
}
}
return xmlData.toString();
}
private String checkNull(String input)
{
System.out.print("in check null method =" + input);
if (input == null)
{
input = "";
} else
{
input = input.trim();
}
return input;
}
}
package ibase.dashboard.sfa.ejb;
import ibase.webitm.ejb.ValidatorLocal;
import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException;
import javax.ejb.Local;
@Local
public interface ExpenseProcessStatusLocal extends ValidatorLocal
{
public String getData(String loginCode) throws RemoteException, ITMException;
public String getData() throws RemoteException,ITMException;
public String getSalePersn();
}
package ibase.dashboard.sfa.ejb;
import ibase.webitm.ejb.ValidatorRemote;
import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException;
import javax.ejb.Remote;
@Remote
public interface ExpenseProcessStatusRemote extends ValidatorRemote
{
public String getData(String loginCode) throws RemoteException, ITMException;
public String getData() throws RemoteException,ITMException;
public String getSalePersn();
}
package ibase.dashboard.sfa.ejb;
import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import ibase.system.config.ConnDriver;
import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.utility.ITMException;
import javax.ejb.Stateless;
/**
* Session Bean implementation class ImpDocMissed
*/
@Stateless
public class ImpDocMissed extends ValidatorEJB implements ImpDocMissedRemote, ImpDocMissedLocal
{
/**
* Default constructor.
*/
String SalePersn = "";
public String getSalePersn()
{
return SalePersn;
}
public void setSalePersn(String salePersn)
{
SalePersn = salePersn;
}
public ImpDocMissed()
{
// TODO Auto-generated constructor stub
}
@Override
public String getData() throws RemoteException, ITMException
{
return "";
}
@Override
public String getData(String loginCode) throws RemoteException, ITMException
{
String sql = "";
ResultSet rs = null;
Connection conn = null;
PreparedStatement pstmt = null;
ConnDriver connDriver = new ConnDriver();
StringBuffer xmlData = null;
try
{
conn = connDriver.getConnectDB("DriverITM");
connDriver = null;
sql = "SELECT initcap(SALES_PERS.SP_NAME) AS SALESPERSON_NAME, SYSDATE AS CURRENT_DATE, FN_R_CHECK_PRINT2(STRG_SERIES.SALES_PERS,SYSDATE,STRG_SERIES.NO_VISIT,STRG_SERIES.SC_CODE) AS ACTUAL_VISITS, FN_R_CHECK_COUNT(SYSDATE,STRG_SERIES.NO_VISIT) AS ACTUAL_CHECK, (CASE WHEN (FN_R_CHECK_PRINT2(STRG_SERIES.SALES_PERS,SYSDATE,STRG_SERIES.NO_VISIT,STRG_SERIES.SC_CODE)) < FN_R_CHECK_COUNT(SYSDATE,STRG_SERIES.NO_VISIT) THEN initcap(STRG_CUSTOMER.FIRST_NAME||' '||STRG_CUSTOMER.LAST_NAME ) ELSE ' ' END) AS DOCTORS_NAME, FN_R_DAYS_SINCE_NOT_MET(STRG_SERIES.SALES_PERS,SYSDATE,STRG_SERIES.SC_CODE) AS DAYS_SINCE_NOT_MET_n, (case when (FN_R_CHECK_COUNT(SYSDATE,STRG_SERIES.NO_VISIT) -FN_R_CHECK_PRINT2(STRG_SERIES.SALES_PERS,SYSDATE,STRG_SERIES.NO_VISIT,STRG_SERIES.SC_CODE) ) <0 then 0 else (FN_R_CHECK_COUNT(SYSDATE,STRG_SERIES.NO_VISIT) -FN_R_CHECK_PRINT2(STRG_SERIES.SALES_PERS,SYSDATE,STRG_SERIES.NO_VISIT,STRG_SERIES.SC_CODE) ) end ) as VISITS_MISSED FROM STRG_SERIES,SALES_PERS,STRG_CUSTOMER WHERE STRG_SERIES.SALES_PERS=SALES_PERS.SALES_PERS AND STRG_SERIES.SC_CODE=STRG_CUSTOMER.SC_CODE AND STRG_SERIES.CUST_TYPE = 'D' AND STRG_SERIES.STATUS = 'Y' AND STRG_SERIES.CLASS_CODE = 'A' AND STRG_SERIES.SALES_PERS IN ( select emp_code from employee start with emp_code = (select emp_code from users where code= ?) connect by prior emp_code = report_to ) and (CASE WHEN (FN_R_CHECK_PRINT2(STRG_SERIES.SALES_PERS,SYSDATE,STRG_SERIES.NO_VISIT,STRG_SERIES.SC_CODE)) < FN_R_CHECK_COUNT(SYSDATE,STRG_SERIES.NO_VISIT) THEN STRG_CUSTOMER.FIRST_NAME||' '||STRG_CUSTOMER.LAST_NAME ELSE ' ' END)<>' '";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, loginCode);
rs = pstmt.executeQuery();
xmlData = new StringBuffer("<?xml version=\"1.0\"?><Root>");
while (rs.next())
{
this.setSalePersn(rs.getString("SALESPERSON_NAME"));
xmlData.append("<Detail>");
xmlData.append("<doctors_name >").append("<![CDATA[" + checkNull(rs.getString("DOCTORS_NAME")) + "]]>").append("</doctors_name>");
xmlData.append("<days_since_not_met>").append("<![CDATA[" + checkNull(rs.getString("DAYS_SINCE_NOT_MET_n")) + "]]>").append("</days_since_not_met>");
xmlData.append("<visits_missed>").append("<![CDATA[" + checkNull(rs.getString("VISITS_MISSED")) + "]]>").append("</visits_missed>");
xmlData.append("</Detail>");
}
xmlData.append("</Root>");
pstmt.close();
pstmt = null;
rs.close();
rs = null;
} catch (Exception e)
{
e.printStackTrace();
System.out.println("Exception : ImpDocMissed:" + e.getMessage());
throw new ITMException(e);
} finally
{
try
{
if (conn != null)
{
if (rs != null)
rs.close();
rs = null;
if (pstmt != null)
pstmt.close();
pstmt = null;
conn.close();
conn = null;
}
conn = null;
} catch (Exception d)
{
d.printStackTrace();
System.out.println("Exception :ImpDocMissed:" + d.getMessage());
throw new ITMException(d);
}
}
return xmlData.toString();
}
private String checkNull(String input)
{
if (input == null)
{
input = "";
} else
{
input = input.trim();
}
return input;
}
}
package ibase.dashboard.sfa.ejb;
import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException;
import javax.ejb.Local;
@Local
public interface ImpDocMissedLocal {
public String getData(String loginCode) throws RemoteException, ITMException;
public String getData() throws RemoteException,ITMException;
public String getSalePersn();
}
package ibase.dashboard.sfa.ejb;
import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException;
import javax.ejb.Remote;
@Remote
public interface ImpDocMissedRemote {
public String getData(String loginCode) throws RemoteException, ITMException;
public String getData() throws RemoteException,ITMException;
public String getSalePersn();
}
package ibase.dashboard.sfa.ejb;
import ibase.system.config.ConnDriver;
import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import javax.ejb.Stateless;
/**
* Session Bean implementation class ImpEvents
*/
@Stateless
public class ImpEvents extends ValidatorEJB implements ImpEventsRemote, ImpEventsLocal {
/**
* Default constructor.
*/
public ImpEvents() {
// TODO Auto-generated constructor stub
}
@Override
public String getData() throws RemoteException, ITMException
{
// TODO Auto-generated method stub
return null;
}
@Override
public String getData(String loginCode) throws RemoteException, ITMException
{
String sql = "";
ResultSet rs = null;
Connection conn = null;
PreparedStatement pstmt = null;
ConnDriver connDriver = new ConnDriver();
StringBuffer xmlData =null;
try
{
conn = connDriver.getConnectDB("DriverITM");
connDriver = null;
xmlData = new StringBuffer("<?xml version=\"1.0\"?><Root>");
sql = "select STRG_EVENTS.EVENT_DATE as Event_Date, STRG_CUSTOMER.SC_CODE, INITCAP(strg_customer.first_name||' '||strg_customer.middle_name||' '||strg_customer.last_name )AS DrName, LISTAGG(STRG_EVENTS.DESCR, ', ') WITHIN GROUP (ORDER BY STRG_EVENTS.DESCR) as Event FROM SALES_PERS INNER JOIN STRG_SERIES on STRG_SERIES.SALES_PERS = SALES_PERS.SALES_PERS and STRG_SERIES.Cust_Type = 'D' and STRG_SERIES.Status = 'Y' INNER JOIN STRG_CUSTOMER ON STRG_CUSTOMER.SC_CODE = STRG_SERIES.SC_CODE INNER JOIN STRG_EVENTS ON STRG_CUSTOMER.SC_CODE = STRG_EVENTS.SC_CODE WHERE SALES_PERS.SALES_PERS = ? AND STRG_EVENTS.EVENT_DATE = TO_DATE(sysdate,'dd/mm/yy HH24:MI:SS') group by STRG_EVENTS.EVENT_DATE , STRG_CUSTOMER.SC_CODE, strg_customer.first_name, strg_customer.middle_name, strg_customer.last_name";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, loginCode);
rs = pstmt.executeQuery();
while (rs.next())
{
xmlData.append("<Detail1>");
xmlData.append("<drname>").append("<![CDATA[" + checkNull(rs.getString("DrName")) + "]]>").append("</drname>");
xmlData.append("<event>").append("<![CDATA[" + checkNull(rs.getString("Event"))+"]]>").append("</event>");
xmlData.append("</Detail1>");
}
pstmt.close();
pstmt = null;
rs.close();
rs = null;
sql="select STRG_EVENTS.EVENT_DATE as Event_Date, STRG_CUSTOMER.SC_CODE, INITCAP(strg_customer.first_name||' '||strg_customer.middle_name||' '||strg_customer.last_name )AS DrName, LISTAGG(STRG_EVENTS.DESCR, ', ') WITHIN GROUP (ORDER BY STRG_EVENTS.DESCR) as Event FROM SALES_PERS INNER JOIN STRG_SERIES on STRG_SERIES.SALES_PERS = SALES_PERS.SALES_PERS and STRG_SERIES.Cust_Type = 'D' and STRG_SERIES.Status = 'Y' INNER JOIN STRG_CUSTOMER ON STRG_CUSTOMER.SC_CODE = STRG_SERIES.SC_CODE INNER JOIN STRG_EVENTS ON STRG_CUSTOMER.SC_CODE = STRG_EVENTS.SC_CODE WHERE SALES_PERS.SALES_PERS = ? AND STRG_EVENTS.EVENT_DATE = TO_DATE(sysdate,'dd/mm/yy HH24:MI:SS') + 1 group by STRG_EVENTS.EVENT_DATE , STRG_CUSTOMER.SC_CODE, strg_customer.first_name, strg_customer.middle_name, strg_customer.last_name";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, loginCode);
rs = pstmt.executeQuery();
while (rs.next())
{
xmlData.append("<Detail2>");
xmlData.append("<drname>").append("<![CDATA[" + checkNull(rs.getString("DrName"))+ "]]>").append("</drname>");
xmlData.append("<event>").append("<![CDATA[" + checkNull(rs.getString("Event"))+"]]>").append("</event>");
xmlData.append("</Detail2>");
}
pstmt.close();
pstmt = null;
rs.close();
rs = null;
sql="select STRG_EVENTS.EVENT_DATE as Event_Date, STRG_CUSTOMER.SC_CODE, INITCAP(strg_customer.first_name||' '||strg_customer.middle_name||' '||strg_customer.last_name )AS DrName, LISTAGG(STRG_EVENTS.DESCR, ', ') WITHIN GROUP (ORDER BY STRG_EVENTS.DESCR) as Event FROM SALES_PERS INNER JOIN STRG_SERIES on STRG_SERIES.SALES_PERS = SALES_PERS.SALES_PERS and STRG_SERIES.Cust_Type = 'D' and STRG_SERIES.Status = 'Y' INNER JOIN STRG_CUSTOMER ON STRG_CUSTOMER.SC_CODE = STRG_SERIES.SC_CODE INNER JOIN STRG_EVENTS ON STRG_CUSTOMER.SC_CODE = STRG_EVENTS.SC_CODE WHERE SALES_PERS.SALES_PERS = ? AND STRG_EVENTS.EVENT_DATE >= TO_DATE(sysdate,'dd/mm/yy HH24:MI:SS')+2 AND STRG_EVENTS.EVENT_DATE <= TO_DATE(sysdate,'dd/mm/yy HH24:MI:SS')+8 group by STRG_EVENTS.EVENT_DATE, STRG_CUSTOMER.SC_CODE, strg_customer.first_name, strg_customer.middle_name, strg_customer.last_name";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, loginCode);
rs = pstmt.executeQuery();
while (rs.next())
{
xmlData.append("<Detail3>");
xmlData.append("<drname>").append("<![CDATA[" + checkNull(rs.getString("DrName")) + "]]>").append("</drname>");
xmlData.append("<event>").append("<![CDATA[" + rs.getString(("Event"))+"]]>").append("</event>");
xmlData.append("<event_date >").append("<![CDATA[" + rs.getDate("Event_Date") + "]]>").append("</event_date>");
xmlData.append("</Detail3>");
}
pstmt.close();
pstmt = null;
rs.close();
rs = null;
xmlData.append("</Root>");
} catch (Exception e)
{
e.printStackTrace();
System.out.println("Exception :ImpEvents:" + e.getMessage());
throw new ITMException(e);
} finally
{
try
{
if (conn != null)
{
if (rs != null)
rs.close();
rs = null;
if (pstmt != null)
pstmt.close();
pstmt = null;
conn.close();
conn = null;
}
conn = null;
} catch (Exception d)
{
d.printStackTrace();
System.out.println("Exception :ImpEvents:" + d.getMessage());
throw new ITMException(d);
}
}
return xmlData.toString();
}
private String checkNull(String input)
{
if (input == null)
{
input = "";
} else
{
input = input.trim();
}
return input;
}
}
package ibase.dashboard.sfa.ejb;
import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException;
import javax.ejb.Local;
@Local
public interface ImpEventsLocal {
public String getData(String loginCode) throws RemoteException, ITMException;
public String getData() throws RemoteException,ITMException;
}
package ibase.dashboard.sfa.ejb;
import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException;
import javax.ejb.Remote;
@Remote
public interface ImpEventsRemote
{
public String getData(String loginCode) throws RemoteException, ITMException;
public String getData() throws RemoteException, ITMException;
}
package ibase.dashboard.sfa.ejb;
import ibase.system.config.ConnDriver;
import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import javax.ejb.Stateless;
/**
* Session Bean implementation class PlannedVSActualActionTypes
*/
@Stateless
public class PlannedVSActualActionTypes implements PlannedVSActualActionTypesRemote, PlannedVSActualActionTypesLocal {
/**
* Default constructor.
*/
private String salesPerson="";
public String getSalesPerson()
{
return salesPerson;
}
public void setSalesPerson(String salesPerson)
{
this.salesPerson = salesPerson;
}
public PlannedVSActualActionTypes() {
}
@Override
public String getData() throws RemoteException, ITMException
{
// TODO Auto-generated method stub
return null;
}
@Override
public String getData(String loginCode) throws RemoteException, ITMException
{
String sql = "";
ResultSet rs = null;
Connection conn = null;
PreparedStatement pstmt = null;
ConnDriver connDriver = new ConnDriver();
StringBuffer xmlData =null;
try
{
conn = connDriver.getConnectDB("DriverITM");
connDriver = null;
sql="select initcap(sales_pers.sp_name)as sp_name from sales_pers where sales_pers = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, loginCode);
rs = pstmt.executeQuery();
if (rs.next())
{
this.setSalesPerson(rs.getString("sp_name"));
}
sql = "select INITCAP(trim(strg_customer.first_name)||''|| (CASE WHEN trim(strg_customer.middle_name) IS NULL THEN '' ELSE (' '||strg_customer.middle_name) END ) ||' ' ||trim(strg_customer.last_name) )AS DrName from sprs_plan, strg_customer where sprs_plan.plan_status = 'P' AND STRG_CUSTOMER.CUST_TYPE = 'D' AND sprs_plan.strg_code = strg_customer.sc_code and sprs_plan.sprs_code__plan = ? and sprs_plan.plan_date = to_char(sysdate) minus select INITCAP(trim(strg_customer.first_name)||''|| (CASE WHEN trim(strg_customer.middle_name) IS NULL THEN '' ELSE (' '||strg_customer.middle_name) END ) ||' ' ||trim(strg_customer.last_name) )AS DrName from sprs_plan,strg_meet, strg_customer where sprs_plan.plan_status = 'P' AND STRG_CUSTOMER.CUST_TYPE = 'D' AND sprs_plan.plan_date = strg_meet.event_date AND sprs_plan.strg_code = strg_customer.sc_code AND SPRS_PLAN.STRG_CODE = STRG_MEET.STRG_CODE AND sprs_plan.sprs_code__plan = STRG_MEET.SALES_PERS and sprs_plan.sprs_code__plan = ? and sprs_plan.plan_date = to_char(sysdate) order by 1 ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, loginCode);
pstmt.setString(2, loginCode);
rs = pstmt.executeQuery();
xmlData = new StringBuffer("<?xml version=\"1.0\"?><Root>");
while (rs.next())
{
xmlData.append("<dr_not_visited>").append("<![CDATA[" +checkNull(rs.getString("DrName"))+ "]]>").append("</dr_not_visited>");
}
pstmt.close();
pstmt = null;
rs.close();
rs = null;
sql="select INITCAP(trim(strg_customer.first_name)||''|| (CASE WHEN trim(strg_customer.middle_name) IS NULL THEN '' ELSE (' '||strg_customer.middle_name) END ) ||' ' ||trim(strg_customer.last_name) )AS DrName from sprs_plan,strg_meet, strg_customer where sprs_plan.plan_status = 'P' AND STRG_CUSTOMER.CUST_TYPE = 'D' AND sprs_plan.plan_date = strg_meet.event_date AND sprs_plan.strg_code = strg_customer.sc_code AND SPRS_PLAN.STRG_CODE = STRG_MEET.STRG_CODE AND sprs_plan.sprs_code__plan = STRG_MEET.SALES_PERS and sprs_plan.sprs_code__plan = ? and sprs_plan.plan_date = to_char(sysdate) order by INITCAP(strg_customer.first_name||' '||strg_customer.middle_name||' '||strg_customer.last_name )";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,loginCode);
rs = pstmt.executeQuery();
while (rs.next())
{
xmlData.append("<dr_visitd>").append("<![CDATA[" + checkNull(rs.getString("DrName"))+ "]]>").append("</dr_visitd>");
}
pstmt.close();
pstmt = null;
rs.close();
rs = null;
sql=" select INITCAP(trim(strg_customer.first_name)||''|| (CASE WHEN trim(strg_customer.middle_name) IS NULL THEN '' ELSE (' '||strg_customer.middle_name) END ) ||' ' ||trim(strg_customer.last_name) )AS DrName from strg_meet INNER JOIN strg_customer ON strg_customer.sc_code = STRG_MEET.STRG_CODE AND STRG_CUSTOMER.CUST_TYPE = 'D' and STRG_MEET.SALES_PERS = ? and STRG_MEET.EVENT_DATE = to_char(sysdate) MINUS select INITCAP(trim(strg_customer.first_name)||''|| (CASE WHEN trim(strg_customer.middle_name) IS NULL THEN '' ELSE (' '||strg_customer.middle_name) END ) ||' ' ||trim(strg_customer.last_name) )AS DrName from sprs_plan, strg_customer where sprs_plan.plan_status = 'P' AND STRG_CUSTOMER.CUST_TYPE = 'D' AND sprs_plan.strg_code = strg_customer.sc_code and sprs_plan.sprs_code__plan = ? and sprs_plan.plan_date = to_char(sysdate) ORDER BY 1";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, loginCode);
pstmt.setString(2, loginCode);
rs = pstmt.executeQuery();
while (rs.next())
{
xmlData.append("<un_dr_visitd>").append("<![CDATA[" + checkNull(rs.getString("DrName"))+ "]]>").append("</un_dr_visitd>");
}
pstmt.close();
pstmt = null;
rs.close();
rs = null;
xmlData.append("</Root>");
} catch (Exception e)
{
e.printStackTrace();
System.out.println("Exception in EJB :PlannedVSActualActionTypes:" + e.getMessage());
throw new ITMException(e);
} finally
{
try
{
if (conn != null)
{
if (rs != null)
rs.close();
rs = null;
if (pstmt != null)
pstmt.close();
pstmt = null;
conn.close();
conn = null;
}
conn = null;
} catch (Exception d)
{
d.printStackTrace();
System.out.println("Exception in EJB :PlannedVSActualActionTypes:" + d.getMessage());
throw new ITMException(d);
}
}
return xmlData.toString();}
private String checkNull(String input)
{
if (input == null)
{
input = "";
} else
{
input = input.trim();
}
return input;
}
}
\ No newline at end of file
package ibase.dashboard.sfa.ejb;
import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException;
import javax.ejb.Local;
@Local
public interface PlannedVSActualActionTypesLocal {
public String getData(String loginCode) throws RemoteException, ITMException;
public String getData() throws RemoteException,ITMException;
}
package ibase.dashboard.sfa.ejb;
import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException;
import javax.ejb.Remote;
@Remote
public interface PlannedVSActualActionTypesRemote {
public String getSalesPerson();
public String getData(String loginCode) throws RemoteException, ITMException;
public String getData() throws RemoteException,ITMException;
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<%@ page contentType="text/html"%>
<%@ page
import="javax.xml.parsers.DocumentBuilderFactory,javax.xml.parsers.DocumentBuilder,org.w3c.dom.*"%>
<%@page import="ibase.dashboard.sfa.ejb.*"%>
<!--<%@page import="ibase.webitm.reports.utility.ResourceConstants"%>
-->
<%@page import="ibase.utility.CommonConstants"%>
<%@ page import="javax.naming.InitialContext"%>
<%@page import="javax.naming.Context"%>
<%@page import="org.w3c.dom.Node"%>
<%@page import="org.w3c.dom.NodeList"%>
<%@page import="ibase.webitm.utility.GenericUtility"%>
<%!GenericUtility genericUtility = GenericUtility.getInstance();
String xmlString = "";
String objName = "";
Document dom = null;
NodeList dtlList = null;
Node parentNode = null;
NodeList childNodeList = null;
Node currDetail = null;
String childNodeName = "";
String yearweek="";
String doctors="";
String chemist="";
String stockist="";
String unlisted="";
String rptTitle="";
StringBuffer xmlData = null;
%>
<%
response.setHeader("Expires", "Sat, 6 May 1995 12:00:00 GMT");
response.setHeader("Cache-Control", "no-store, no-cache,must-revalidate");
response.addHeader("Cache-Control", "post-check=0, pre-check=0");
response.setHeader("Pragma", "no-cache");
int ctr = 0;
CommonConstants.setAPPLICATION_CONTEXT(config.getServletContext().getRealPath("/"));
%>
<html>
<head>
<script type="text/javascript" src="/ibase/FusionChart/js/FusionCharts.js"> </script>
</head>
<body>
<%
try
{
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
String user = userInfo.getLoginCode();
System.out.println("user ::" + user);
rptTitle = request.getParameter("rtitle");
if (rptTitle == null || rptTitle.trim().length() == 0)
{
rptTitle =" " ;
} else
{
if(rptTitle.equalsIgnoreCase("Y") && rptTitle.trim().length()!= 0)
{
rptTitle ="Customer Meeting Trends ";
}
else{
rptTitle =" " ;
}
}
Context context = new InitialContext();
CustomerMeetingTrendsRemote dashboardPortal = (CustomerMeetingTrendsRemote) context.lookup("ibase/CustomerMeetingTrends/remote");
System.out.println("Ejb remote =>" + dashboardPortal);
if (user != null && user.trim().length() != 0)
{
xmlString = dashboardPortal.getData(user);
System.out.println("xmlString length is ==>" + xmlString.length());
System.out.println("xmlString in jsp ==>" + xmlString);
}
xmlData = new StringBuffer("<chart caption='");
xmlData.append(rptTitle);
xmlData.append("' xaxisname='Week' yaxisname='Number of Visits' numdivlines='9' showSum='1' showvalues='0' useRoundEdges='1' showLabels='1'>" );
if (xmlString != null && xmlString.trim().length() > 0)
{
dom = genericUtility.parseString(xmlString);
if(dom !=null )
{
dtlList = dom.getElementsByTagName("Detail1");
System.out.println("Detail Node Length==" + dtlList.getLength());
xmlData.append("<categories font='Arial' >");
for (int cntr = 0; cntr < dtlList.getLength(); cntr++)
{
parentNode = dtlList.item(cntr);
childNodeList = parentNode.getChildNodes();
System.out.println("child Node Length==" + childNodeList.getLength());
for (int nodCtr = 0; nodCtr < childNodeList.getLength(); nodCtr++)
{
currDetail = childNodeList.item(nodCtr);
childNodeName = currDetail.getNodeName();
if (childNodeName.trim().equals("yearweek"))
{
//String yearweek1 = genericUtility.getColumnValueFromNode("yearweek", parentNode);
yearweek =currDetail.getTextContent();
xmlData.append("<category label='"+yearweek+"'/>");
}
}
}
xmlData.append("</categories>");
dtlList = dom.getElementsByTagName("Detail2");
System.out.println("Detail Node Length==" + dtlList.getLength());
xmlData.append("<dataset seriesname='Doctors' color='8BBA00' showValues='0'>");
for (int cntr = 0; cntr < dtlList.getLength(); cntr++)
{
parentNode = dtlList.item(cntr);
childNodeList = parentNode.getChildNodes();
for (int nodCtr = 0; nodCtr < childNodeList.getLength(); nodCtr++)
{
currDetail = childNodeList.item(nodCtr);
childNodeName = currDetail.getNodeName();
if (childNodeName.trim().equals("doctor"))
{
//doctors = genericUtility.getColumnValueFromNode("doctor", parentNode);
doctors = currDetail.getTextContent();
}xmlData.append("<set value='"+doctors+"'/>");
}
}
xmlData.append("</dataset>");
dtlList = dom.getElementsByTagName("Detail3");
System.out.println("Detail Node Length==" + dtlList.getLength());
xmlData.append("<dataset seriesname='Chemist' color='F6BD0F' showValues='0'>");
for (int cntr = 0; cntr < dtlList.getLength(); cntr++)
{
parentNode = dtlList.item(cntr);
childNodeList = parentNode.getChildNodes();
for (int nodCtr = 0; nodCtr < childNodeList.getLength(); nodCtr++)
{
currDetail = childNodeList.item(nodCtr);
childNodeName = currDetail.getNodeName();
if (childNodeName.trim().equals("chemist"))
{
//chemist = genericUtility.getColumnValueFromNode("chemist", parentNode);
chemist = currDetail.getTextContent();
xmlData.append("<set value='"+chemist+"'/>");
}
}
}
xmlData.append("</dataset>");
dtlList = dom.getElementsByTagName("Detail4");
System.out.println("Detail Node Length==" + dtlList.getLength());
xmlData.append("<dataset seriesname='Stockist' color='F781F3' showValues='0'>");
for (int cntr = 0; cntr < dtlList.getLength(); cntr++)
{
parentNode = dtlList.item(cntr);
childNodeList = parentNode.getChildNodes();
for (int nodCtr = 0; nodCtr < childNodeList.getLength(); nodCtr++)
{
currDetail = childNodeList.item(nodCtr);
childNodeName = currDetail.getNodeName();
if (childNodeName.trim().equals("stockist"))
{
//stockist = genericUtility.getColumnValueFromNode("stockist", parentNode);
stockist = currDetail.getTextContent();
xmlData.append("<set value='"+stockist+"'/>");
}
}
}
xmlData.append("</dataset>");
dtlList = dom.getElementsByTagName("Detail5");
System.out.println("Detail Node Length==" + dtlList.getLength());
xmlData.append("<dataset seriesname='Unlisted' color='AFD8F8' showValues='0'>");
for (int cntr = 0; cntr < dtlList.getLength(); cntr++)
{
parentNode = dtlList.item(cntr);
childNodeList = parentNode.getChildNodes();
for (int nodCtr = 0; nodCtr < childNodeList.getLength(); nodCtr++)
{
currDetail = childNodeList.item(nodCtr);
childNodeName = currDetail.getNodeName();
if (childNodeName.trim().equals("unlisted"))
{
//unlisted = genericUtility.getColumnValueFromNode("unlisted", parentNode);
unlisted =currDetail.getTextContent();
xmlData.append("<set value='"+unlisted+"'/>");
}
}
}
xmlData.append("</dataset>");
}
}
xmlData.append("</chart>");
System.out.println("xmlDataString----->"+xmlData.toString());
%>
<div id="chartContainer">FusionCharts XT will load here!</div>
<script type="text/javascript">
var myChart = new FusionCharts( "/ibase/FusionChart/images/StackedColumn2D.swf", "myChartId", "250", "300","0");
myChart.setXMLData("<%=xmlData.toString()%>");
myChart.render("chartContainer");
function view2D()
{
var chartToView2D = getChartFromId("myChartId");
chartToView2D.view2D();
}
</script>
<%
} catch (Exception ex)
{
System.out.println("Exception : ITMWizardHandlerServlet sMessageArguments(String,wizardBean) :" + ex); //$NON-NLS-1$
}
%>
</body>
</html>
<%@ page contentType="text/html"%>
<%@ page
import="javax.xml.parsers.DocumentBuilderFactory,javax.xml.parsers.DocumentBuilder,org.w3c.dom.*"%>
<%@page import="ibase.dashboard.sfa.ejb.*"%>
<!--<%@page import="ibase.webitm.reports.utility.ResourceConstants"%>
-->
<%@page import="ibase.utility.CommonConstants"%>
<%@ page import="javax.naming.InitialContext"%>
<%@page import="javax.naming.Context"%>
<%@page import="org.w3c.dom.Node"%>
<%@page import="org.w3c.dom.NodeList"%>
<%@page import="ibase.webitm.utility.GenericUtility"%>
<%@page import="java.util.Calendar"%>
<%@page import="java.text.SimpleDateFormat"%>
<%!GenericUtility genericUtility = GenericUtility.getInstance();
String xmlString = "";
String objName = "";
Document dom = null;
NodeList dtlList = null;
Node parentNode = null;
NodeList childNodeList = null;
Node currDetailNode = null;
String childNodeName = "";
String visits="";
String category="";
String cyear="";
String cmonth="";
StringBuffer chartData=null;
String xmlData= "";
Calendar calender= Calendar.getInstance();
java.util.Date date = new java.util.Date(calender.getTimeInMillis());
String rptTitle="";
%>
<%
response.setHeader("Expires", "Sat, 6 May 1995 12:00:00 GMT");
response.setHeader("Cache-Control", "no-store, no-cache,must-revalidate");
response.addHeader("Cache-Control", "post-check=0, pre-check=0");
response.setHeader("Pragma", "no-cache");
int ctr = 0;
CommonConstants.setAPPLICATION_CONTEXT(config.getServletContext().getRealPath("/"));
%>
<html>
<head>
<script type="text/javascript"
src="/ibase/FusionChart/js/FusionCharts.js"> </script>
</head>
<body>
<%
try
{
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
cyear = new SimpleDateFormat("yy").format(date);
cmonth = new SimpleDateFormat("MMMM").format(date);
rptTitle = request.getParameter("rtitle");
if (rptTitle == null || rptTitle.trim().length() == 0)
{
rptTitle =" " ;
} else
{
if(rptTitle.equalsIgnoreCase("Y") && rptTitle.trim().length()!= 0)
{
rptTitle =" Doctors Meeting by Class for "+ cmonth + "-"+ cyear;
}
else{
rptTitle =" " ;
}
}
String user = userInfo.getLoginCode();
System.out.println("user ::" + user);
Context context = new InitialContext();
DoctorsMeetingByClassRemote dashboardPortal = (DoctorsMeetingByClassRemote) context.lookup("ibase/DoctorsMeetingByClass/remote");
System.out.println("Ejb remote =>" + dashboardPortal);
if (user != null && user.trim().length() != 0)
{
xmlString = dashboardPortal.getData(user);
}
chartData=new StringBuffer("<chart caption='");
chartData.append(rptTitle);
chartData.append("' baseFont='Arial' xAxisName='Category' yAxisName='Visits' showLabels='0' showLegend='1'>");
dom = genericUtility.parseString(xmlString);
if(dom !=null )
{
dtlList = dom.getElementsByTagName("Detail");
for (int cntr = 0; cntr < dtlList.getLength(); cntr++)
{
parentNode = dtlList.item(cntr);
childNodeList = parentNode.getChildNodes();
for (int nodCtr = 0; nodCtr < childNodeList.getLength(); nodCtr++)
{
currDetailNode = childNodeList.item(nodCtr);
childNodeName = currDetailNode.getNodeName();
if (childNodeName.trim().equals("category"))
{
category = genericUtility.getColumnValueFromNode("category", parentNode);
}
if(childNodeName.trim().equals("visits"))
{
visits = genericUtility.getColumnValueFromNode("visits", parentNode);
}
}
chartData.append("<set label='").append(category+"' value='").append(visits+"'>").append("</set>");
}
}
chartData.append("</chart>");
System.out.println("chartData "+chartData);
%>
<div id="chartContainer">FusionCharts XT will load here!</div>
<script type="text/javascript">
var myChart = new FusionCharts("/ibase/FusionChart/images/Pie2D.swf", "myChartId", "250", "300","0");
myChart.setXMLData("<%= chartData.toString()%>");
myChart.render("chartContainer");
function view2D()
{
var chartToView2D = getChartFromId("myChartId");
chartToView2D.view2D();
}
</script>
<%
} catch (Exception ex)
{
System.out.println("Exception : ITMWizardHandlerServlet sMessageArguments(String,wizardBean) :" + ex);
}
%>
</body>
</html>
<%@ page contentType="text/html"%>
<%@ page
import="javax.xml.parsers.DocumentBuilderFactory,javax.xml.parsers.DocumentBuilder,org.w3c.dom.*"%>
<%@page import="ibase.dashboard.sfa.ejb.*"%>
<!--<%@page import="ibase.webitm.reports.utility.ResourceConstants"%>
-->
<%@page import="ibase.utility.CommonConstants"%>
<%@ page import="javax.naming.InitialContext"%>
<%@page import="javax.naming.Context"%>
<%@page import="org.w3c.dom.Node"%>
<%@page import="org.w3c.dom.NodeList"%>
<%@page import="ibase.webitm.utility.GenericUtility"%>
<%!GenericUtility genericUtility = GenericUtility.getInstance();
String xmlString = "";
String rptTitle = "";
Document dom = null;
NodeList dtlList = null;
Node parentNode = null;
NodeList childNodeList = null;
Node currDetail = null;
String childNodeName = "";
String salePersnName = "", submitted_date = "", amount = "", period = " ",
status = " ", doctorsName = "", notMetSince = "", visitMissed = "";
%>
<%
response.setHeader("Expires", "Sat, 6 May 1995 12:00:00 GMT");
response.setHeader("Cache-Control", "no-store, no-cache,must-revalidate");
response.addHeader("Cache-Control", "post-check=0, pre-check=0");
response.setHeader("Pragma", "no-cache");
int ctr = 0;
CommonConstants.setAPPLICATION_CONTEXT(config.getServletContext().getRealPath("/"));
%>
<html>
<head>
<style type="text/css">
.reportName {
FONT-FAMILY: Arial;
FONT-SIZE: 12pt;
font-weight: bold;
}
.reportTitle {
FONT-FAMILY: Arial;
FONT-SIZE: 10pt;
}
.reportDetail {
FONT-FAMILY: Arial;
FONT-SIZE: 10pt;
width: 280px;
border: 1px solid;
}
.tblHeader
{
font-weight: bold;
}
</style>
</head>
<body>
<%
try
{
rptTitle = request.getParameter("rtitle");
if (rptTitle == null || rptTitle.trim().length() == 0)
{
rptTitle =" " ;
} else
{
if(rptTitle.equalsIgnoreCase("Y") && rptTitle.trim().length()!= 0)
{
rptTitle ="Expense Request Status" ;
}
else{
rptTitle =" " ;
}
}
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
String user = userInfo.getLoginCode();
System.out.println("user ::" + user);
Context context = new InitialContext();
ExpenseProcessStatusRemote dashboardPortal = (ExpenseProcessStatusRemote) context.lookup("ibase/ExpenseProcessStatus/remote");
//DashboardPortal dashboardPortal=(DashboardPortal)context.lookup("ibase.dashboard.sfa.ejb.DashboardPortal.class.getName()");
if (user != null && user.trim().length() != 0)
{
xmlString = dashboardPortal.getData(user);
System.out.println("Return xmlString====" + xmlString);
}
%>
<%
if (xmlString != null && xmlString.trim().length() > 0)
{
%>
<table class="reportName">
<tr>
<td><%=rptTitle%></td>
</tr>
</table>
<table>
<tr class="reportTitle">
<td><b>Sales Person:</b></td>
<td><%=dashboardPortal.getSalePersn()%></td>
</tr>
</table>
<table class="reportDetail" rules="rows" FRAME=BOX >
<tr class="tblHeader">
<th> </th>
<th align="center">Period</th>
<th align="right">Amount</th>
<th align="right">Submitted Date</th>
</tr>
<%
dom = genericUtility.parseString(xmlString);
if(dom !=null )
{
dtlList = dom.getElementsByTagName("Detail");
for (int cntr = 0; cntr < dtlList.getLength(); cntr++)
{
parentNode = dtlList.item(cntr);
childNodeList = parentNode.getChildNodes();
for (int nodCtr = 0; nodCtr < childNodeList.getLength(); nodCtr++)
{
currDetail = childNodeList.item(nodCtr);
childNodeName = currDetail.getNodeName();
if (childNodeName.trim().equals("period"))
{
period = genericUtility.getColumnValueFromNode("period", parentNode);
}
if (childNodeName.trim().equals("amount"))
{
amount = genericUtility.getColumnValueFromNode("amount", parentNode);
}
if (childNodeName.trim().equals("submitted_date"))
{
submitted_date = genericUtility.getColumnValueFromNode("submitted_date", parentNode);
}
if (childNodeName.trim().equals("apporval_status"))
{
status = genericUtility.getColumnValueFromNode("apporval_status", parentNode);
}
}
%>
<tr>
<td>
<%
if (status.equals("S"))
{
%> <img alt="" height="10" width="10" src="../images/check_mark.png">
<%
}
if (status.equals("U"))
{
%> <img alt="" height="10" width="10" src="../images/clock.png">
<%
}
if (status.equals("R"))
{
%> <img alt="" height="10" width="10" src="../images/Reject.jpg">
<%
}
%>
</td>
<td align="center"><%=period%></td>
<td align="right"><%=amount%></td>
<td align="center"><%=submitted_date%></td>
</tr>
<%
}
}
%>
</table>
<%
}
} catch (Exception ex)
{
System.out.println("Exception : ExpenseProcessStatus:" + ex.getMessage());
}
%>
</body>
</html>
<%@ page contentType="text/html"%>
<%@ page
import="javax.xml.parsers.DocumentBuilderFactory,javax.xml.parsers.DocumentBuilder,org.w3c.dom.*"%>
<%@page import="ibase.dashboard.sfa.ejb.*"%>
<!--<%@page import="ibase.webitm.reports.utility.ResourceConstants"%>
-->
<%@page import="ibase.utility.CommonConstants"%>
<%@ page import="javax.naming.InitialContext"%>
<%@page import="javax.naming.Context"%>
<%@page import="org.w3c.dom.Node"%>
<%@page import="org.w3c.dom.NodeList"%>
<%@page import="ibase.webitm.utility.GenericUtility"%>
<%!GenericUtility genericUtility = GenericUtility.getInstance();
String xmlString = "";
String objName = "";
Document dom = null;
NodeList dtlList = null;
Node parentNode = null;
NodeList childNodeList = null;
Node currDetail = null;
String childNodeName = "";
String salePersnName = "",doctorsName = "", notMetSince = "", visitMissed = "",rptTitle;%>
<%
response.setHeader("Expires", "Sat, 6 May 1995 12:00:00 GMT");
response.setHeader("Cache-Control", "no-store, no-cache,must-revalidate");
response.addHeader("Cache-Control", "post-check=0, pre-check=0");
response.setHeader("Pragma", "no-cache");
int ctr = 0;
CommonConstants.setAPPLICATION_CONTEXT(config.getServletContext().getRealPath("/"));
%>
<html>
<head>
<style type="text/css">
.reportName {
FONT-FAMILY: Arial;
FONT-SIZE: 12pt;
font-weight: bold;
}
.reportTitle {
FONT-FAMILY: Arial;
FONT-SIZE: 10pt;
}
.reportDetail {
FONT-FAMILY: Arial;
FONT-SIZE: 10pt;
width: 350px;
border: 1px solid;
}
.tblHeader
{
font-weight: bold;
}
</style>
<script type="text/javascript" src="FusionCharts.js"></script>
</head>
<body>
<%
try
{
rptTitle = request.getParameter("rtitle");
if (rptTitle == null || rptTitle.trim().length() == 0)
{
rptTitle =" " ;
} else
{
if(rptTitle.equalsIgnoreCase("Y") && rptTitle.trim().length()!= 0)
{
rptTitle ="Important Doctors Missed ";
}
else{
rptTitle =" " ;
}
}
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
String user = userInfo.getLoginCode();
System.out.println("user ::" + user);
Context context = new InitialContext();
ImpDocMissedRemote dashboardPortal = (ImpDocMissedRemote)context.lookup("ibase/ImpDocMissed/remote");
//DashboardPortal dashboardPortal=(DashboardPortal)context.lookup("ibase.dashboard.sfa.ejb.DashboardPortal.class.getName()");
if (user != null && user.trim().length() != 0)
{
xmlString = dashboardPortal.getData(user);
System.out.println("Return xmlString====" + xmlString);
}
%>
<%
if (xmlString != null && xmlString.trim().length() > 0)
{
%>
<table class="reportName">
<tr>
<td><%=rptTitle%></td>
</tr>
</table>
<table class="reportDetail" rules="all" FRAME=BOX>
<tr class="tblHeader">
<td>Doctors Name</td>
<td>Not Met Since</td>
<td>No.Of Visit Missed</td>
</tr>
<tr>
<td colspan="3"><b>Sales Person:</b><%=dashboardPortal.getSalePersn()%></td>
</tr>
<%
dom = genericUtility.parseString(xmlString);
if(dom !=null)
{
dtlList = dom.getElementsByTagName("Detail");
for (int cntr = 0; cntr < dtlList.getLength(); cntr++)
{
parentNode = dtlList.item(cntr);
childNodeList = parentNode.getChildNodes();
for (int nodCtr = 0; nodCtr < childNodeList.getLength(); nodCtr++)
{
currDetail = childNodeList.item(nodCtr);
childNodeName = currDetail.getNodeName();
if (childNodeName.trim().equals("doctors_name"))
{
doctorsName = genericUtility.getColumnValueFromNode("doctors_name", parentNode);
}
if (childNodeName.trim().equals("days_since_not_met"))
{
notMetSince = genericUtility.getColumnValueFromNode("days_since_not_met", parentNode);
}
if (childNodeName.trim().equals("visits_missed"))
{
visitMissed = genericUtility.getColumnValueFromNode("visits_missed", parentNode);
}
}
%>
<tr>
<td width="180px"><%=doctorsName%></td>
<td align="right"><%=notMetSince%></td>
<td align="center"><%=visitMissed%></td>
</tr>
<%
}}
%>
</table>
<%
}
} catch (Exception ex)
{
System.out.println("Exception in JSP :ImpDocMissed:" + ex.getMessage());
}
%>
</body>
</html>
\ No newline at end of file
<%@ page contentType="text/html"%>
<%@ page
import="javax.xml.parsers.DocumentBuilderFactory,javax.xml.parsers.DocumentBuilder,org.w3c.dom.*"%>
<%@page import="ibase.dashboard.sfa.ejb.*"%>
<!--<%@page import="ibase.webitm.reports.utility.ResourceConstants"%>
-->
<%@page import="ibase.utility.CommonConstants"%>
<%@ page import="javax.naming.InitialContext"%>
<%@page import="javax.naming.Context"%>
<%@page import="org.w3c.dom.Node"%>
<%@page import="org.w3c.dom.NodeList"%>
<%@page import="ibase.webitm.utility.GenericUtility"%>
<%!GenericUtility genericUtility = GenericUtility.getInstance();
String xmlString = "";
String objName = "";
Document dom = null;
NodeList dtlList = null;
Node parentNode = null;
NodeList childNodeList = null;
Node currDetail = null;
String childNodeName = "";
String rptTitle="";
String event = " ", doctorsName = "", eventDate = "";%>
<%
response.setHeader("Expires", "Sat, 6 May 1995 12:00:00 GMT");
response.setHeader("Cache-Control", "no-store, no-cache,must-revalidate");
response.addHeader("Cache-Control", "post-check=0, pre-check=0");
response.setHeader("Pragma", "no-cache");
int ctr = 0;
CommonConstants.setAPPLICATION_CONTEXT(config.getServletContext().getRealPath("/"));
%>
<html>
<head>
<style type="text/css">
.reportName {
FONT-FAMILY: Arial;
FONT-SIZE: 12pt;
font-weight: bold;
}
.reportTitle {
FONT-FAMILY: Arial;
FONT-SIZE: 10pt;
}
.reportDetail {
FONT-FAMILY: Arial;
FONT-SIZE: 10pt;
width: 300px;
border: 1px solid;
}
.reportDetail1 {
FONT-FAMILY: Arial;
FONT-SIZE: 10pt;
width: 350px;
border: 1px solid;
}
.rowColor
{
background-color:#D3D3D3;
text-align:left;
font-weight: bold;
}
</style>
<script type="text/javascript" src="FusionCharts.js"></script>
</head>
<body>
<%
try
{
rptTitle = request.getParameter("rtitle");
if (rptTitle == null || rptTitle.trim().length() == 0)
{
rptTitle =" " ;
} else
{
if(rptTitle.equalsIgnoreCase("Y") && rptTitle.trim().length()!= 0)
{
rptTitle ="Important Events ";
}
else{
rptTitle =" " ;
}
}
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
String user = userInfo.getLoginCode();
System.out.println("user ::" + user);
//String outputFilename = objName + user + System.currentTimeMillis();
Context context = new InitialContext();
ImpEventsRemote impEvents = (ImpEventsRemote) context.lookup("ibase/ImpEvents/remote");
//DashboardPortal dashboardPortal=(DashboardPortal)context.lookup("ibase.dashboard.sfa.ejb.DashboardPortal.class.getName()");
System.out.println("Ejb remote =>" + impEvents);
if (user != null && user.trim().length() != 0)
{
xmlString = impEvents.getData(user);
System.out.println("Return xmlString====" + xmlString);
System.out.println("xmlString length is ==>" + xmlString.length());
}
%>
<%
if (xmlString != null && xmlString.trim().length() > 0)
{
%>
<table class="reportName">
<tr>
<td><%=rptTitle%> </td>
</tr>
</table>
<table class="reportDetail1" FRAME=BOX >
<tr class="rowColor">
<td colspan="3">Today</td>
</tr>
<%
dom = genericUtility.parseString(xmlString);
if (dom != null)
{
dtlList = dom.getElementsByTagName("Detail1");
System.out.println("Detail Node Length==" + dtlList.getLength());
for (int cntr = 0; cntr < dtlList.getLength(); cntr++)
{
parentNode = dtlList.item(cntr);
childNodeList = parentNode.getChildNodes();
for (int nodCtr = 0; nodCtr < childNodeList.getLength(); nodCtr++)
{
currDetail = childNodeList.item(nodCtr);
childNodeName = currDetail.getNodeName();
if (childNodeName.trim().equals("drname"))
{
doctorsName = genericUtility.getColumnValueFromNode("drname", parentNode);
}
if (childNodeName.trim().equals("event"))
{
event = genericUtility.getColumnValueFromNode("event", parentNode);
}
}
%>
<tr >
<td><%=doctorsName%></td>
<td><%=event%></td>
</tr>
<%
}
}
%>
<tr class="rowColor">
<td colspan="3">Tomorrow</td>
</tr>
<%
if (dom != null)
{
dom = genericUtility.parseString(xmlString);
dtlList = dom.getElementsByTagName("Detail2");
for (int cntr = 0; cntr < dtlList.getLength(); cntr++)
{
parentNode = dtlList.item(cntr);
childNodeList = parentNode.getChildNodes();
for (int nodCtr = 0; nodCtr < childNodeList.getLength(); nodCtr++)
{
currDetail = childNodeList.item(nodCtr);
childNodeName = currDetail.getNodeName();
if (childNodeName.trim().equals("drname"))
{
doctorsName = genericUtility.getColumnValueFromNode("drname", parentNode);
}
if (childNodeName.trim().equals("event"))
{
event = genericUtility.getColumnValueFromNode("event", parentNode);
}
}
%>
<tr>
<td><%=doctorsName%> -</td>
<td><%=event%></td>
</tr>
<%
}
}
%>
<tr class="rowColor">
<td colspan="3">Upcoming</td>
</tr>
<%
if (dom != null)
{
dom = genericUtility.parseString(xmlString);
dtlList = dom.getElementsByTagName("Detail3");
for (int cntr = 0; cntr < dtlList.getLength(); cntr++)
{
parentNode = dtlList.item(cntr);
childNodeList = parentNode.getChildNodes();
for (int nodCtr = 0; nodCtr < childNodeList.getLength(); nodCtr++)
{
currDetail = childNodeList.item(nodCtr);
childNodeName = currDetail.getNodeName();
if (childNodeName.trim().equals("event_date"))
{
eventDate = genericUtility.getColumnValueFromNode("event_date", parentNode);
}
if (childNodeName.trim().equals("drname"))
{
doctorsName = genericUtility.getColumnValueFromNode("drname", parentNode);
}
if (childNodeName.trim().equals("event"))
{
event = genericUtility.getColumnValueFromNode("event", parentNode);
}
}
%>
<tr>
<td><%=eventDate%></td>
<td><%=doctorsName%> -</td>
<td><%=event%></td>
</tr>
<%
}
}
%>
</table>
<%
}
} catch (Exception ex)
{
System.out.println("Exception in JSP:ImpEvents:" + ex.getMessage());
}
%>
</body>
</html>
\ No newline at end of file
<%@ page contentType="text/html"%>
<%@ page
import="javax.xml.parsers.DocumentBuilderFactory,javax.xml.parsers.DocumentBuilder,org.w3c.dom.*"%>
<%@page import="ibase.dashboard.sfa.ejb.*"%>
<!--<%@page import="ibase.webitm.reports.utility.ResourceConstants"%>
-->
<%@page import="ibase.utility.CommonConstants"%>
<%@ page import="javax.naming.InitialContext"%>
<%@page import="javax.naming.Context"%>
<%@page import="org.w3c.dom.Node"%>
<%@page import="org.w3c.dom.NodeList"%>
<%@page import="ibase.webitm.utility.GenericUtility"%>
<%!GenericUtility genericUtility = GenericUtility.getInstance();
String xmlString = "";
String objName = "";
Document dom = null;
NodeList dtlList = null;
Node parentNode = null;
NodeList childNodeList = null;
Node currDetail = null;
String childNodeName = "";
String drNotVisited = "", unDrtVisited = "", drVisited = "";
String visitedDr = "", notVisitedDr = "", unPlndDrVisited = "";
ArrayList<String> unDrVisitedList=null;
ArrayList<String> drVisitedList =null;
ArrayList<String> drNotVisitedList =null;
int unDrVisitedListSize=0;
int drVisitedListSize=0;
int drNotVisitedListSize=0;
String rptTitle="";
%>
<%
response.setHeader("Expires", "Sat, 6 May 1995 12:00:00 GMT");
response.setHeader("Cache-Control", "no-store, no-cache,must-revalidate");
response.addHeader("Cache-Control", "post-check=0, pre-check=0");
response.setHeader("Pragma", "no-cache");
int ctr = 0;
CommonConstants.setAPPLICATION_CONTEXT(config.getServletContext().getRealPath("/"));
%>
<%@page import="java.util.ArrayList"%>
<html>
<head>
<style type="text/css">
.reportName {
FONT-FAMILY: Arial;
FONT-SIZE: 12pt;
font-weight: bold;
}
.reportTitle {
FONT-FAMILY: Arial;
FONT-SIZE: 10pt;
}
.reportDetail{
FONT-FAMILY: Arial;
FONT-SIZE: 10pt;
width: 550px;
}
.rowColor {
background-color: grey;
text-align: left;
font-weight: bold;
}
.tblHeader
{
border:1px solid
font-weight: bold;
}
</style>
</head>
<body>
<%
try
{
rptTitle = request.getParameter("rtitle");
if (rptTitle == null || rptTitle.trim().length() == 0)
{
rptTitle =" " ;
} else
{
if(rptTitle.equalsIgnoreCase("Y") && rptTitle.trim().length()!= 0)
{
rptTitle =" Planned v/s Actual Doctors Visit ";
}
else{
rptTitle =" " ;
}
}
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
String user = userInfo.getLoginCode();
System.out.println("user ::" + user);
//String outputFilename = objName + user + System.currentTimeMillis();
Context context = new InitialContext();
PlannedVSActualActionTypesRemote plannedVSActualAction = (PlannedVSActualActionTypesRemote) context.lookup("ibase/PlannedVSActualActionTypes/remote");
//DashboardPortal dashboardPortal=(DashboardPortal)context.lookup("ibase.dashboard.sfa.ejb.DashboardPortal.class.getName()");
if (user != null && user.trim().length() != 0)
{
xmlString = plannedVSActualAction.getData(user);
System.out.println("Return xmlString====" + xmlString);
System.out.println("xmlString length is ==>" + xmlString.length());
}
%>
<%
if (xmlString != null && xmlString.trim().length() > 0)
{
%>
<table class="reportName">
<tr>
<td><%=rptTitle %></td>
</tr>
</table>
<table>
<tr class="reportTitle">
<td><b>Sales Person:</b></td>
<td><%=plannedVSActualAction.getSalesPerson()%></td>
</tr>
</table>
<table class="reportDetail" RULES="cols" FRAME=BOX >
<tr class="tblHeader">
<th> Planned Doctors Not Visited</th>
<th> Planned Doctors Visited</th>
<th> Unplanned Doctors Visited</th>
</tr>
<%
unDrVisitedList = new ArrayList<String>();
drVisitedList = new ArrayList<String>();
drNotVisitedList = new ArrayList<String>();
dom = genericUtility.parseString(xmlString);
if (dom != null)
{
dtlList = dom.getElementsByTagName("un_dr_visitd");
System.out.println("Detail Node Length==" + dtlList.getLength());
for (int cntr = 0; cntr < dtlList.getLength(); cntr++)
{
parentNode = dtlList.item(cntr);
unDrtVisited = parentNode.getTextContent();
unDrVisitedList.add(unDrtVisited);
}
dtlList = dom.getElementsByTagName("dr_visitd");
for (int cntr = 0; cntr < dtlList.getLength(); cntr++)
{
parentNode = dtlList.item(cntr);
drVisited = parentNode.getTextContent();
drVisitedList.add(drVisited);
}
dtlList = dom.getElementsByTagName("dr_not_visited");
for (int cntr = 0; cntr < dtlList.getLength(); cntr++)
{
parentNode = dtlList.item(cntr);
drNotVisited = parentNode.getTextContent();
drNotVisitedList.add(drNotVisited);
}
}
unDrVisitedListSize = unDrVisitedList.size();
drVisitedListSize = drVisitedList.size();
drNotVisitedListSize = drNotVisitedList.size();
System.out.print("unDrVisitedListSize ="+unDrVisitedListSize +"drVisitedListSize ="+drVisitedListSize + "drNotVisitedListSize :"+drNotVisitedListSize);
int maxLength = Math.max(unDrVisitedListSize, Math.max(drVisitedListSize, drNotVisitedListSize));
System.out.print("Max Length is ="+maxLength);
for (int i = 0; i < maxLength; i++)
{
if (i<drVisitedListSize)
{
visitedDr = drVisitedList.get(i);
System.out.print("Visited Dr ="+visitedDr);
} else
{
visitedDr = " ";
}
if(i < drNotVisitedListSize)
{
notVisitedDr = drNotVisitedList.get(i);
}else{
notVisitedDr="";
}
if(i< unDrVisitedListSize)
{
unPlndDrVisited = unDrVisitedList.get(i);
System.out.print("unPlndDrVisited Dr are ="+unPlndDrVisited);
}else
{
unPlndDrVisited=" ";
}
%>
<tr>
<td><%=notVisitedDr%></td>
<td><%=visitedDr%></td>
<td><%= unPlndDrVisited%></td>
</tr>
<%
}
%>
</table>
<%
}
} catch (Exception ex)
{
System.out.println("Exception in JSP :PlannedVSActualActionTypes:" + ex.getMessage());
}
%>
</body>
</html>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment