<!DOCTYPE html>

<%
/*****************************************************************************
*	File name		: ErPrintDataReport.jsp
*	Purpose			: This page Handles PrintDataReport
*	Version			: Reporter 4.0
*	Changed by		: SakthiVel (02/07/08)
*	Author			:
*	design Changes	: Jaiwin
*	Alligned by		: Jaiwin (09/08/10)
********************************************************************************/
%>
<%@ include file="ErTracker.jsp"%>
<%@ page import="egurkha.reporter.*"%>
<%@ page import="com.eg.EgDiscInfoHelper"%>
<%@ page import="java.util.*"%>
<%@ page import="egurkha.TransactionBean"%>
<%@ page import="egurkha.EgDbAdapterUI"%>
<%@ page import="com.eg.EgDbAdapterTypeUI"%>
<%@ page import="com.eg.*"%>
<%@ page import="com.eg.EgDbInfo"%>
<%@ page import="com.eg.IniFile"%>
<%@ page import="com.eg.EgInstallInfo,com.eg.EgTopoInfo,com.eg.EgSpecsInfo"%>
<%@ page import="egurkha.EgCrawler"%>
<%@ page import="com.eg.EgTopoInfo"%>
<%@ page import="com.eg.EgDateInfo"%>
<%@ page import="java.text.Format.*"%>
<%@ page import="java.text.DateFormat.*"%>
<%@ page import="java.text.*"%>
<%@ page import="com.eg.EgReportInfo"%>
<%@ page import="com.eg.EgMappingInfo"%>
<%@ page import="com.eg.EgTablesInfo"%>
<%@ page import="com.egurkha.util.DateUtil"%>
<%@ page import="com.egurkha.util.*"%>
<%@ page import="com.egurkha.util.DateTimeTokenizer"%>
<%@ page import="com.eg.EgTesterInfo"%>
<%@ page import="com.eg.EgTestInfo"%>
<%@ page import="com.eg.EgURLDecoder"%>
<%@ page import="com.eg.EgDbInfo"%>
<%@ page import="com.eg.EgConfigInfo"%>
<%@ page import="java.io.*"%>
<%@ page import="com.egurkha.util.StringUtils"%>
<%@ page import = "net.sf.json.*" %>
<%@ taglib prefix="egui" uri="../WEB-INF/eg-taglib.tld"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import = "com.egurkha.monitor.EgServiceMappingBean"%>
<jsp:useBean id="esmb" scope="page" class="com.egurkha.monitor.EgServiceMappingBean" />

<%
	// For Service component mapping
	// by Saravanan.A
	Hashtable resultServiceNamesForComp=(Hashtable)esmb.getServiceNamesForComponentMap();
%>
<%
		String titleToDisplay ="";

try
{
	String er_showResourceUsage = request.getParameter("er_showResourceUsage");
	boolean isSummary=false;
	String er_aggregateValue = request.getParameter("er_aggregateValue");
	String strGroup = request.getParameter("er_organize");
	
	er_aggregateValue =request.getParameter("er_aggregateValue");	
	if(er_aggregateValue==null)		
			er_aggregateValue="Details";			
	if(er_aggregateValue==null || er_aggregateValue.equalsIgnoreCase("Details"))
	{
		isSummary=false;
		er_aggregateValue="Details";
	}else
	{
		isSummary=true;
	
	}
	if(strGroup!=null && strGroup.equalsIgnoreCase("AD"))
	{
			isSummary=false;
			er_aggregateValue="Details";
	}
	String queryString = ErUtils.prepareQueryString(request.getParameterMap());
	String qString=getEncodedQueryString(queryString);
	String mngrIP= new IniFile(new EgConfigInfo("manager").getDbFile()).getValue("DB_PROPERTIES","ManagerUrl");
	String strManagerURL = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort();
	UBean = new ErUserData(urs,false);
	session.setAttribute("UBean",UBean);
	ErReqData erd = new ErReqData(request);
	EgDateInfo egDt =new EgDateInfo();
	ErUtils erUtils = new ErUtils();
	ErReportHelper erh=new ErReportHelper();
	EgMappingInfo intlmp=new EgMappingInfo(thisuser.getLanguage());
	ErComponentsUtils compUtil = new ErComponentsUtils(thisuser.getLoginID());
	EgTimeZoneConverter converterStart=null;
	EgTimeZoneConverter converterEnd = null;

	String comFormat="";
    String allTypeUniqueUsrSummary = (String)session.getAttribute("allTypeUniqueUsrSummary");
	String allTypeUniqueUsrSummaryArr[] = null;
     if(allTypeUniqueUsrSummary!=null){
		 allTypeUniqueUsrSummaryArr = allTypeUniqueUsrSummary.split(":");
	 }

	EgUserRole userRole      = thisuser.getUserRole();
	boolean hasAllComponentAccess= userRole.hasAllComponentAccess();
	//added by chandrasekhar
	List userCompList=new LinkedList();
	boolean hasVMs = false;
	if(!hasAllComponentAccess)
	{
		userCompList = getComponentsForUserNotAccessAllComponents(thisuser);
		List a_userVMs_temp = thisuser.getAlluserDesktopVms();
		if(a_userVMs_temp!=null && a_userVMs_temp.size() > 0)
		{
			hasVMs = true;
		}
	}
	String s_tit= "";
	String s_tit1= "";
	List lst = new LinkedList();
	List lst_dat = new LinkedList();
	Hashtable sen = new Hashtable();
	Hashtable ht = new Hashtable();
	Vector vec = new Vector();
	Hashtable ht1 = new Hashtable();
	List lst_dat1 = new LinkedList();
	Hashtable sen1 = new Hashtable();
	Vector vec2 = new Vector();
	Vector vec1 = new Vector();
	Vector vec3 = new Vector();
	List lst_dat2 = new LinkedList();
	Vector v_val1 = new Vector();
	//ended here
	List siteNames = new LinkedList();
	siteNames.addAll(compUtil.getUserSites());
	siteNames.addAll(compUtil.getUserServices(true));
	EgMappingInfo intlmap = new EgMappingInfo(thisuser.getLanguage());
	String reportType=request.getParameter("er_reportType");
	String er_RmDispName = request.getParameter("er_RmDispName");
	String rtype = request.getParameter("er_gtype");
	String subtype = request.getParameter("er_trgttype");
	String er_option =request.getParameter("er_option");
	String erservice = request.getParameter("erservice");
	String clientIp=request.getParameter("clientIp");
		if((er_RmDispName == null || er_RmDispName.equals("null")) && !rtype.equals("null") && rtype.equals("Citrix") && !subtype.equals("null") && subtype.equals("Application Report"))
		{
			er_RmDispName="Application Activity";
		}
	
		
	EgTablesInfo tablesInfo = new EgTablesInfo("manager");
	EgSpecsInfo specsInfo = new EgSpecsInfo("manager");
	EgTesterInfo testInfo = new EgTesterInfo("manager");
	EgTestInfo tokInfo = new EgTestInfo("manager");
	EgDbInfo dbInfo = new EgDbInfo("manager");
	EgReportInfo reportInfo=new EgReportInfo("manager");
	EgDiscInfoHelper  discInfoHelper=new EgDiscInfoHelper();
	String colSeparator = testInfo.getDDSeparator1();
	String rowSeparator = testInfo.getDDSeparator2();
	String server = "";
	String user = "";
	String Farmserver = "";
	String view_name = "";
	com.egurkha.ini.IniUI ui = (com.egurkha.ini.IniUI)com.egurkha.ini.IniUI.getInstance();
	String installDir = EgInstallInfo.getInstallDir();
	Hashtable Hasservice=new Hashtable();
	Vector v_repdata = (Vector)session.getAttribute("Rep_data");
	HashMap  summarySessionVc =(HashMap) session.getAttribute("summarySessionVc");
	String showFrom=request.getParameter("showFrom");
	if(showFrom==null || showFrom.length()==0)
	{
		showFrom = "Outside view";
	}
	String INI_SUBJECT = "CITRIX_USER_REPORT";
	if(showFrom.equalsIgnoreCase("Inside view"))
	{
		INI_SUBJECT = "CITRIX_USER_REPORT_INSIDE";
	}
	if(summarySessionVc == null)
	{
		summarySessionVc = (HashMap)request.getAttribute("summarySessionVc");
	}
	
	Hashtable ht_Data = (Hashtable)session.getAttribute("TopNReportData");
	if(ht_Data == null)
	{
		ht_Data = (Hashtable)request.getAttribute("TopNReportData");
	}
	Hashtable Rep_data1 = (Hashtable) session.getAttribute("Farm_data");


	if((rtype!=null && rtype.equals("Citrix") && subtype!=null && subtype.equals("Consolidated Report") && erservice!=null && erservice.equalsIgnoreCase("Service Health"))|| (Rep_data1 == null || Rep_data1.equals("")))
	{
		Rep_data1 = (Hashtable)request.getAttribute("Form_Data");
	}
	Hashtable avg_data = (Hashtable) session.getAttribute("SummaryData");		
	if(Rep_data1!=null)
		getDataChange(Rep_data1, "zone");			// For Bug Id : 10813
	Hashtable Application_data = (Hashtable)session.getAttribute("htdat");
	Hashtable Session_data = (Hashtable)session.getAttribute("sessionData");
	if(avg_data == null)
	{
		avg_data = (Hashtable)request.getAttribute("SummaryData");
	}
	if(Session_data == null)
	{
		Session_data = (Hashtable)request.getAttribute("Report_data_ForSession");
	}
	if(Application_data == null)
	{
		Application_data = (Hashtable)request.getAttribute("htdat");
	}
	ArrayList apptop= (ArrayList)session.getAttribute("appForPrint");

	if(apptop== null && "true".equals(request.getParameter("throughSchedule")))
	{
		apptop =  (ArrayList)request.getAttribute("appForPrint");
	}
	ArrayList alistallMeasuresDisp=(ArrayList)request.getAttribute("alistallMeasuresDisp1");
	String st_apptopdata=  (String)session.getAttribute("titleapp");
	Hashtable htableMinMaxAvgPer =(Hashtable)request.getAttribute("htableMinMaxAvgPer1");
	Hashtable htableTargetHost =(Hashtable)request.getAttribute("htableTargetHost1");
	Hashtable htableSummaryAvgDisp=(Hashtable)request.getAttribute("htableSummaryAvgDisp1");
	int er_sortby=-1;
	int orderBy=0;
	if(request.getParameter("er_sortby")!=null && !request.getParameter("er_sortby").equalsIgnoreCase("null")){
		String tempStr = request.getParameter("er_sortby");
		if (tempStr.equalsIgnoreCase("Avg"))
			er_sortby=3;
		else if (tempStr.equalsIgnoreCase("max"))
			er_sortby=2;
		else if (tempStr.equalsIgnoreCase("min"))
			er_sortby=1;
	}

	if(subtype!=null && subtype.equalsIgnoreCase("Application Report"))
	{
		
		orderBy=1;
		try{
		String tmpStr = request.getParameter("er_sortby");
		if(tmpStr!=null && !tmpStr.equals(""))
			{
			er_sortby=Integer.parseInt(tmpStr);
			}
		}
		catch(Exception e){
			e.printStackTrace();
		}
	}
		//er_sortby=request.getParameter("er_sortby");
		try{
	if(request.getParameter("orderBy")!=null && !request.getParameter("orderBy").equalsIgnoreCase("null"))
		orderBy=Integer.parseInt(request.getParameter("orderBy"));
		}
		catch(Exception e){
			e.printStackTrace();
		}

	if(er_sortby==-1)
		er_sortby=0;

	ErSort.order=orderBy;
	ErSort.index=er_sortby;
	String s_comptype = request.getParameter("avg");
	String titforsession = (String)session.getAttribute("title");
	Vector Session_data1 = (Vector)session.getAttribute("sessionData1");
	if(Session_data1 == null)
	{
		Session_data1 = (Vector)request.getAttribute("Report_data1");
	}
	ArrayList arrses_data = (ArrayList)session.getAttribute("sessionDatatop");
	if(arrses_data == null)
	{
		 arrses_data = (ArrayList)request.getAttribute("Report_data2");
	}
	ArrayList dataHash = (ArrayList) session.getAttribute("Event_data");//from ErCtxEventReporter for total alert
	if(dataHash == null)
	{
		dataHash = (ArrayList)request.getAttribute("RESULTPROC");
	}
	Vector a_list=(Vector)session.getAttribute("NO_ALERTS");//from ErCtxEventReporter.jsp for all alerts
	if(a_list ==null)
	{
		a_list=(Vector)request.getAttribute("ALERTS");
	}
	ArrayList Hash_repdata = (ArrayList) session.getAttribute("hash_data");
	ArrayList topAppsDataForFarm = (ArrayList)session.getAttribute("userTopAppsFarm");
	ArrayList topAppsDataForServer = (ArrayList)session.getAttribute("userTopAppsServ");
	ArrayList  perServerDispMaxAvgPer = (ArrayList)session.getAttribute("userMaxAvgPer");
	ArrayList disconuser=(ArrayList)request.getAttribute("disconuserdeal");
	if(Hash_repdata == null)
	{
		Hash_repdata = (ArrayList) request.getAttribute("Report_data");
	}
	if(perServerDispMaxAvgPer == null)
	{
		   perServerDispMaxAvgPer = (ArrayList) request.getAttribute("perServerDispMaxAvgPer");
	}
	if(topAppsDataForFarm == null)
	{
		topAppsDataForFarm = (ArrayList) request.getAttribute("topAppsDataForFarm");
	}
	if(topAppsDataForServer == null)
	{
		topAppsDataForServer = (ArrayList) request.getAttribute("topAppsDataForServer");
	}
	if(disconuser == null)
	{
		disconuser=(ArrayList)request.getAttribute("disconnectuser");
	}
	Vector userReSum = (Vector)session.getAttribute("userReSummary");
	if(userReSum == null)
	{
		userReSum = (Vector)request.getAttribute("userReSummary");
	}
	ArrayList Repserver_data = null;
	if(Repserver_data == null)
	{
		Repserver_data = (ArrayList)request.getAttribute("Repserver_data");
	}

	HashMap powerMap=(HashMap)session.getAttribute("powerinfoMap");
	HashMap esxDataMapType=(HashMap)session.getAttribute("guestMap");
	HashMap osinfoMapType=(HashMap)session.getAttribute("osinfoMap");

	int maxInfo = erh.getMaxInfos("INFOS","MaxInfos");
	HashMap Report_data= new HashMap();
	Vector Report_data1= new Vector();
	Hashtable Repserver_hash = new Hashtable();
	String startDate="";
	String endDate="";
	long msecsPerHour = (long) 1000 * 60 * 60;

	String timefrom = request.getParameter("timefrom");
	String timeto = request.getParameter("timeto");
	String minfrom = request.getParameter("minfrom");
	String minto = request.getParameter("minto");
	String r_type = request.getParameter("er_rtype");
	String viewReport = (String)session.getAttribute("view");
	if(viewReport == null)
	{
		viewReport = request.getParameter("vw");
	}
	view_name=getViewName(viewReport,intlmp);
	Hashtable h_data = new Hashtable();
	Vector time = new Vector();
	Vector print_data = new Vector();
	ArrayList arr_session = new ArrayList();
	Hashtable avgAcrosServerFinal=new Hashtable();
	h_data = (Hashtable)session.getAttribute("Report_data");
	time = (Vector)session.getAttribute("time");

	String ctype = request.getParameter("er_comptype");
	String ercontype =request.getParameter("ercontype");
	String Strexcwe = request.getParameter("er_excwe");
	String typeisend= request.getParameter("typeisend");
	String chec= request.getParameter("er_check");

	if(erservice==null)
		erservice="";
	if(chec!=null && chec.equalsIgnoreCase("CtxZone"))
		avgAcrosServerFinal=(Hashtable)session.getAttribute("ctxavg");
	else if(subtype!=null && subtype.equalsIgnoreCase("Farm Report"))
		avgAcrosServerFinal=(Hashtable)session.getAttribute("avgdata");
	else
		avgAcrosServerFinal=(Hashtable)session.getAttribute("avg");
	if(Strexcwe!=null)
		Strexcwe=Strexcwe.trim();

	String dispStartDate = null;
	String dispEndDate = null;
	String uiFile = "eg_ui.ini";
	String s_iniFile_dir = EgInstallInfo.getInstallDir()+ "/manager/config/";
	IniFile egUI = new IniFile(s_iniFile_dir + uiFile);
	String currentDateFormat = strUserDateFormat;
	String thinzone="";
	
	String fontStyleDbl = "";
	String fontStyleDblSingl = "";
	String pdfPrint = request.getParameter("pdfPrint");
	if((dbInfo.doubleByteEnabled || !thisuser.getLanguage().equals("en_US")) && !(pdfPrint !=null && pdfPrint.equalsIgnoreCase("yes")))
	{
		fontStyleDbl = " multi_font";
		fontStyleDblSingl = "multi_font";
	}
	else
	{
		fontStyleDbl = "";
		fontStyleDblSingl = "";
	}
	fontStyleDbl = " multi_font";
		fontStyleDblSingl = "multi_font";
	String strWeb_sHelth =request.getParameter("select_report");
	String show_Transaction = request.getParameter("er_showTransaction");
	String strVmComp = reportInfo.getValue("MISC","VMWareComponent");
		ArrayList aListVmComponentType = new ArrayList();
		if(strVmComp!=null && strVmComp.length()>0)
		{
			StringTokenizer stToken = new StringTokenizer(strVmComp,",");
			while (stToken.hasMoreTokens())
			{
				String str = stToken.nextToken();
				str = str.trim();
				aListVmComponentType.add(str);
			}
		}
	ArrayList aListSupportedComponentType = reportInfo.getComponentsList("APPLICATION_REPORT",false);
	ArrayList aListAlltype = new ArrayList();

	for(int kk=0;kk<aListSupportedComponentType.size();kk++)
	{
		aListAlltype.add("All "+aListSupportedComponentType.get(kk));
	}
//
		String er_site = request.getParameter("er_site");
		String headerKeyName="";
			if(er_option!=null && er_option.equalsIgnoreCase("Segment"))
			{
			headerKeyName=intlmp.getTextDescription("reporter.common."+er_option)+" : "+er_site;
			}
			else if(er_option!=null && er_option.equalsIgnoreCase("Service"))
			{
			headerKeyName=intlmp.getTextDescription("reporter.common."+er_option)+" : "+er_site;
			}
			else if(er_option!=null && er_option.equalsIgnoreCase("Group"))
			{
			headerKeyName=intlmp.getTextDescription("reporter.common."+er_option)+" : "+er_site;
			}
			else if(er_option!=null && er_option.equalsIgnoreCase("Component"))
			{
				if(request.getParameter("er_compType")!=null){
					String compServr=request.getParameter("er_compType");
					if(compServr != null){
						compServr=intlmp.getComponentTypeDescription(compServr);
					}
					headerKeyName=intlmap.getTextDescription("reporter.common.Component Type")+" : "+compServr;
				}
				else if(request.getParameter("er_select_server")!=null){
					String compServr=request.getParameter("er_select_server");
					if(!compServr.equalsIgnoreCase("All Types")){
						compServr=intlmp.getComponentTypeDescription(compServr);
					}
					else
					{
						compServr = intlmp.getTextDescription("reporter.common."+compServr);
					}
					headerKeyName=intlmp.getTextDescription("reporter.common."+er_option)+" : "+compServr;
				}
				else
					headerKeyName=intlmp.getTextDescription("reporter.common."+er_option);
			}
			else
			{
				if(request.getParameter("select_farm")!=null && request.getParameter("select_farm").equalsIgnoreCase("--Default--"))
				{
					headerKeyName=intlmp.getTextDescription("reporter.common.Zone")+" : "+intlmp.getTextDescription("reporter.common."+request.getParameter("select_farm"));
				}
				else
				{
					headerKeyName=intlmp.getTextDescription("reporter.common.Zone")+" : "+request.getParameter("select_farm");
				}
			}
%>

<!Doctype html>
<head>
<%
	if(pdfPrint !=null && pdfPrint.equalsIgnoreCase("yes"))
	{
%>

<title>&nbsp; <egui:intnl text="reporter.common.Reporter" />
&nbsp; &nbsp;-PDR- &nbsp;</title>
<%
	}
	else
	{
%>
	<title>eG Reporter</title>
<%
	}
%>

<meta name="Author" content="">
<meta  charset="UTF-8">

	<link rel="stylesheet" type="text/css" href="../../final/styles/eGLightThemeIcons.css" />
	<link rel="stylesheet" type="text/css" href="../../final/reporter/styles/printpagestyle.css" />
<script language="JavaScript1.2"
	src="../reporter/scripts/er_imagesLite.js"></script>
<script language="javascript" src="../reporter/scripts/jsrsClient.js"></script>
<script language="javascript" src="../reporter/scripts/select.js"></script>

<script language="javascript">
	var remoteURL = "/final/servlet/com.eg.ErRemoteScriptingServlet";
	var noItemText = "Not Applicable";
	var focusItem = null;
</script>
</head>

<body marginwidth="20" marginheight="20" bgcolor="#FFFFFF">
<%
	String strLogCls = "printHeaderBoxLogo";
	if(pdfPrint !=null && pdfPrint.equalsIgnoreCase("yes"))
	{
		strLogCls = "printHeaderBoxLogo";
	}
	else
		strLogCls = "printPdfHeaderBoxLogo";
	if(pdfPrint !=null && pdfPrint.equalsIgnoreCase("yes"))
	{
%>
		<div class="<%=strLogCls%>" style="padding:10px"><img src="<%=imageName%>" border="0" /></div>
<%
	}
	else
	{
%>
		<div class="<%=strLogCls%>"><img src="<%=imageName%>" border="0" /></div>
<%
	}

	String subrtype=request.getParameter("subrtype");
	throughSchedule=request.getParameter("throughSchedule");
	if(throughSchedule!=null && throughSchedule.equalsIgnoreCase("true"))
	{
		subrtype=request.getParameter("er_subrtype");
	}
	else if(subrtype==null)
	{
		subrtype=request.getParameter("er_subrtype");
	}

	if(er_RmDispName!=null && er_RmDispName.length()>0) 
	{
		titleToDisplay = er_RmDispName.trim();
	} 
	else 
	{
		if(r_type!=null && r_type.equalsIgnoreCase("Event"))//event analysis
		{
			titleToDisplay =  intlmap.getTextDescription("reporter.common.TOP EVENTS");
		} else {
			if (subtype.equalsIgnoreCase("Farm Report") || subtype.equalsIgnoreCase("Consolidated Report"))
			{
				String check=request.getParameter("er_check");
				if (check!=null && check.equalsIgnoreCase("CtxZone")) //thinclient zone report 
				{
					thinzone="Thin Client ";
					titleToDisplay =  intlmap.getTextDescription("reporter.consolidated.Thin Client Reports")+" - " + intlmap.getTextDescription("reporter.common.Zone");
				}else if((ercontype !=null && "consolidated".equalsIgnoreCase(ercontype)) && (strWeb_sHelth !=null && strWeb_sHelth.equalsIgnoreCase("ServicesHealth")))
				{
					titleToDisplay =  intlmap.getTextDescription("reporter.consolidated.Consolidated Reports")+" - " + intlmap.getTextDescription("reporter.consolidated.Services Health");
				}else if((ercontype !=null && "consolidated".equalsIgnoreCase(ercontype)) && (strWeb_sHelth !=null && strWeb_sHelth.equalsIgnoreCase("WebTransactions")))
				{
					lst.add(intlmp.getTextDescription("reporter.thin.Consolidated Reports")+" - "+intlmp.getTextDescription("reporter.common.WebTransaction"));
	
					titleToDisplay =  intlmap.getTextDescription("reporter.consolidated.Consolidated Reports")+" - " + intlmap.getTextDescription("reporter.common.WebTransaction");
				}else //consolidated zone report
				{
					lst.add(intlmp.getTextDescription("reporter.thin.Consolidated Reports")+" - "+intlmp.getTextDescription("reporter.common.Zone"));
					titleToDisplay =  intlmap.getTextDescription("reporter.consolidated.Consolidated Reports")+" - " + intlmap.getTextDescription("reporter.common.Zone");
				}
			}
			else if (subtype.equalsIgnoreCase("Server Report")) //consolidated server report
			{
				if(request.getParameter("er_type")!=null && request.getParameter("er_type").equalsIgnoreCase("Yes"))
				{
					titleToDisplay =  intlmap.getTextDescription("reporter.consoliadted.Virtual Server Reports");
				}else{
					lst.add(intlmp.getTextDescription("reporter.thin.Consolidated Reports")+" - "+subtype);
					titleToDisplay =  intlmap.getTextDescription("reporter.consolidated.Consolidated Reports")+" - " + intlmap.getTextDescription("reporter.common."+subtype);
				}
			}
			else //citrix report
			{
				String temp_st="";
				if(rtype!=null && rtype.equalsIgnoreCase("Citrix"))
					temp_st="Thin Client";
				else
					temp_st=rtype;
				if(subtype!=null && subtype.equals("User Report"))
				{
					lst.add(intlmp.getTextDescription("reporter.thin.THIN CLIENT REPORTS")+" - "+intlmp.getTextDescription("reporter.common."+subtype));
					titleToDisplay = intlmp.getTextDescription("reporter.thin.THIN CLIENT REPORTS")+" - " +intlmap.getTextDescription("reporter.common.Reports - User");
				}else{
					lst.add(intlmp.getTextDescription("reporter.common."+temp_st)+intlmp.getTextDescription("reporter.common.Reports - Session Report"));
					titleToDisplay =  intlmp.getTextDescription("reporter.common."+temp_st)+" "+intlmp.getTextDescription("reporter.common.Reports - Session Report");
				}
			}
		}
	}
%>

	<div class="printHeaderBox" >
		<div class="printHeaderBoxTitle"><%= titleToDisplay %></div>


<%
	if((Hash_repdata !=null && !Hash_repdata.isEmpty()) ||
		(v_repdata!=null && !v_repdata.isEmpty()) || (ht_Data !=null && !ht_Data.isEmpty()) ||
		(Rep_data1!=null && !Rep_data1.isEmpty()) || (h_data!=null && !h_data.isEmpty()) ||
		(apptop!=null && !apptop.isEmpty()) || (Session_data!=null && !Session_data.isEmpty()) || 
		(Session_data1!=null && !Session_data1.isEmpty()) ||
		(Repserver_data!=null &&!Repserver_data.isEmpty()) ||
		(dataHash!=null && !dataHash.isEmpty()) ||
		(Application_data!=null && !Application_data.isEmpty()) ||
		(arrses_data!=null && !arrses_data.isEmpty()) ||
		(topAppsDataForFarm!=null && !topAppsDataForFarm.isEmpty()) )
	{
		if(pdfPrint !=null && pdfPrint.equalsIgnoreCase("yes"))
		{
%>
			<div class="printHeaderBoxPrintIcon" style="float:left"><img class="iconPrinter mouse" src="data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" border="0"  onClick="javascript:print()" alt='<egui:intnl text="reporter.common.PRINT"/>' title='<egui:intnl text="reporter.common.PRINT"/>'/></div>
<%
		}

	}
	else
	{
		if(pdfPrint !=null && pdfPrint.equalsIgnoreCase("yes"))
		{

%>
			<div class="printHeaderBoxPrintIcon" style="float:left"><img class="iconPrinter mouse"   src="data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" border="0"  onClick="javascript:print()" alt='<egui:intnl text="reporter.common.PRINT"/>' title='<egui:intnl text="reporter.common.PRINT"/>'/></div>
<%
		}
	}
%>
	</div>
<%
	String start_date=erd.s_stdate;
	String end_date=erd.s_enddate;
	if(start_date!=null && end_date!=null)
	{
		if(erd.s_startmin !=null && !erd.s_startmin.equalsIgnoreCase("null"))
		{
			dispStartDate=start_date.trim()+" "+erd.s_sthr+":"+erd.s_startmin;
		}
		else
		{
			dispStartDate=start_date.trim()+" "+erd.s_sthr+":"+"00";
		}

		if(erd.s_endmin !=null && !erd.s_endmin.equalsIgnoreCase("null"))
		{
			dispEndDate=end_date.trim()+" "+erd.s_endhr+":"+erd.s_endmin;
		}
		else
		{
			dispEndDate=end_date.trim()+" "+erd.s_endhr+":"+"00";
		}
	}
	converterStart = new EgTimeZoneConverter(dispStartDate,thisuser);
	String st_Time = converterStart.getDateTime();
	converterEnd = new EgTimeZoneConverter(dispEndDate,thisuser);
	String en_Time = converterEnd.getDateTime();
	String optionProcess = request.getParameter("opt");

	
	//conslidated Server report 
	if(rtype.equals("Citrix") && subtype.equals("Server Report"))
	{
		server = request.getParameter("select_server");

		String Days = reportInfo.getExcludeWeekend("SERVER_REPORT");
		//server = EgURLDecoder.decode(server,"UTF-8");
		s_tit = intlmp.getTextDescription("reporter.common."+subtype)+" "+intlmp.getTextDescription("reporter.common.for")+"  ";

%>

	<div class="printOuterBoxNoBorder"> 
				<div class="printSelectionFields"><%=subtype%>&nbsp;<egui:intnl text="reporter.common.for" /> 
				 - <span class="bold">
<%
		if(server.indexOf("NULL:")>-1)
		{
%> 
						<%=server.substring(0,server.lastIndexOf("NULL:"))%><egui:intnl type='<%=server.substring(server.lastIndexOf(":")+1)%>' /> <%
		}
		else
		{
			 s_tit+= server.substring(0,server.lastIndexOf(":"));
%> 
						<%= server.substring(0,server.lastIndexOf(":")) %>:<egui:intnl type='<%=server.substring(server.lastIndexOf(":")+1)%>' /> <%
		}
		lst.add(s_tit);
%> 
				</span></div>
<%
if(Strexcwe!=null&&Strexcwe.equalsIgnoreCase("Yes"))
		{
%>
				<div class="printSelectionFields"><egui:intnl text="reporter.common.Exclude WeekEnds" /> - <span class="bold"><%=Days%></span></div>
<%
		}
%>

				<div class="printSelectionFields">Timeline - <span class="bold"><%=st_Time%>&nbsp;<egui:intnl text="reporter.common.hrs" /> to <%=en_Time%>&nbsp;<egui:intnl text="reporter.common.hrs" /></span></div>

				<div class="printSelectionFields"><egui:intnl text="reporter.common.Time Period" /> - <span class="bold"><%=timefrom+":"+minfrom%>&nbsp;<egui:intnl text="reporter.common.to" />&nbsp;<%=timeto+":"+minto%></span></div>
	</div>

	





<%
	Vector dvec = new Vector();
	String stimefmt =  getString("Start Date",st_Time,intlmp);
	String etimefmt =  getString("End Date",en_Time,intlmp);
	dvec.add('"'+stimefmt+'"');
	dvec.add('"'+etimefmt+'"');
	lst.add(dvec);

	lst.add('"'+intlmp.getTextDescription("reporter.common.Time period")+":"+intlmp.getTextDescription("reporter.common.From")+" "+timefrom+":"+minfrom+intlmp.getTextDescription("reporter.common.hrs")+" "+intlmp.getTextDescription("reporter.common.To")+" "+timeto+":"+minto+intlmp.getTextDescription("reporter.common.hrs")+'"');
		
		String per_value="";
		if(Repserver_data!=null && Repserver_data.size()>0)
		{
			Repserver_hash = (Hashtable)Repserver_data.get(0);
			String virtualServer=request.getParameter("virtualServer");
			String selectedGuest=request.getParameter("select_guest");
			String display = reportInfo.getDisplay("SERVER_REPORT");
			//Conditon to check null values in avg ,max ,min		
			Hashtable respHash=new Hashtable();
			String strtemp11="";
			int arrSize11=0;
			int nullValueCheck1=0;
			List lst_data1 = new LinkedList();
			for(int k=0;k<Repserver_data.size();k++)
			{
				respHash = (Hashtable)Repserver_data.get(k);
				if (!respHash.isEmpty())
				{
					StringTokenizer st_dis1=new StringTokenizer(display,",");
					while (st_dis1.hasMoreTokens())
					{
						strtemp11=(String)respHash.get(st_dis1.nextToken());
						lst_data1.add(strtemp11);
					}
				}
			
			}
			arrSize11=lst_data1.size();
			for(int i=0;i<arrSize11;i++)
			{
				String tempArr=(String)lst_data1.get(i);
				if(tempArr.equals("-"))
					nullValueCheck1++;
			}

			

			if(virtualServer!=null && virtualServer.equals("Yes"))
				display =reportInfo.getDisplay("VIRTUAL_GUEST_SERVER");

			if(selectedGuest!=null && !selectedGuest.equals("") && !selectedGuest.equals("-1") )	{
			 if(selectedGuest.indexOf("|plus|")>-1)
			{
				selectedGuest=StringUtils.replace(selectedGuest,"|plus|","+");
			}
			if(selectedGuest.indexOf("|amp|")>-1)
			{
					selectedGuest=StringUtils.replace(selectedGuest,"|amp|","&");
			}
			if (selectedGuest.indexOf("|pct|")>-1)
			{
				selectedGuest=StringUtils.replace(selectedGuest,"|pct|","%");
			}
			if (selectedGuest.indexOf("|hash|")>-1)
			{
				selectedGuest=StringUtils.replace(selectedGuest,"|hash|","#");
			}
			}
			if(nullValueCheck1!=arrSize11)
			{
			if(Repserver_hash!=null&&Repserver_hash.size()>0)
			{
				StringTokenizer st_display=new StringTokenizer(display,",");
%>
<div class="printOuterBox">
	
<%
				//added by sakthi for virtual machine
				if(request.getParameter("select_guest")!=null && !request.getParameter("select_guest").equals("") && !request.getParameter("select_guest").equalsIgnoreCase("NULL")&&!request.getParameter("select_guest").equals("-1"))
				{
%>
		<div class="printOuterBoxHeader" ><egui:intnl text="reporter.consolidated.Virtual machine report for" />&nbsp;<%=selectedGuest%>&nbsp; <egui:intnl text="reporter.consolidated.on" />
<%
				}
				else//server report
				{
			s_tit1=intlmp.getTextDescription("reporter.consolidated.Server Report for")+" : ";
%>
		
		<div class="printOuterBoxHeader"><egui:intnl text="reporter.consolidated.Server Report for" />&nbsp;-&nbsp;
<%
				}
%>
<!--  <font face="CODE2000">   -->
<%
				if(server.indexOf(":NULL")>-1)
				{
%>
						<span class="bold"><%=server.substring(0,server.indexOf(":NULL"))%>:<egui:intnl type='<%=server.substring(server.indexOf("NULL:")+5)%>' /></span></div>
<%
				}
				else
				{
			 s_tit1+= server.substring(0,server.lastIndexOf(":"));
%>
					<span class="bold"><%=server.substring(0,server.lastIndexOf(":"))%>:<egui:intnl type='<%=server.substring(server.lastIndexOf(":")+1)%>' /></span></div>
<%
				}//class="printOuterBoxHeader"
%> 
	
	
	<div class="newTable">
	<table align="center" width="100%" cellspacing="0" cellpadding="0" >
	<thead>
		<tr>
		<th align="left" width="90%" ><egui:intnl text="reporter.common.Measures" />(<egui:intnl text="reporter.common.Unit" />)</th>
<%
					vec1.add(intlmp.getTextDescription("reporter.common.Measures")+"("+intlmp.getTextDescription("reporter.common.Unit")+")");
				
				while(st_display.hasMoreTokens())
				{
					String strdisplay=st_display.nextToken();
					vec1.add(intlmp.getTextDescription("reporter.common."+strdisplay));
%>
		<th width="7%" nowrap><egui:intnl text='<%="reporter.common."+strdisplay%>'/></th>
<%
				}
%>
		</tr>
	</thead>
	<tbody>
	 <!-- problem  1   -->
<%
				for(int f=0;f<Repserver_data.size();f++)
				{
					Repserver_hash =(Hashtable)Repserver_data.get(f);
					String average="";
					String percentile="";
					String max="";
					String measure="";
					String qryString="";
					if (!Repserver_hash.isEmpty())
					{
						StringTokenizer st_dis=new StringTokenizer(display,",");
						measure = (String)Repserver_hash.get("measure");
						lst_dat1.add(measure);
%>
		<tr><td align="left"><%=measure%></td>
<%
						while (st_dis.hasMoreTokens())
						{
							String strtemp=(String)Repserver_hash.get(st_dis.nextToken());
							lst_dat1.add(strtemp);
%>
		<td align="center"><%=strtemp%></td>
<%
						}
%>
	</tr>
<%
					}
				}
%>
	</tbody>
</table>
</div>
</div>
<%
				}

			}
			else
			{
%>
<table width='100%' height='100%'>
	<tr>
		<td align='center' valign='middle'><img src='/images/Light/nomeasures_custom.png' /></td>
	</tr>
</table>
<%
				lst.add(intlmp.getTextDescription("reporter.common.No measures available for the current selection"));			
			}
		}
		else
		{
%>
<table width='100%' height='100%'>
	<tr>
		<td align='center' valign='middle'><img src='/images/Light/nomeasures_custom.png' /></td>
	</tr>
</table>
<%
		lst.add(intlmp.getTextDescription("reporter.common.No measures available for the current selection"));
		}
%>
<!---------------Thin client Application Activity Report-------->		
<%
			ht.put(vec1,lst_dat1);
			ht1.put(s_tit1,ht);
			lst.add(ht1);
			session.setAttribute("ScheduleCSVData",lst);
	}
	else if(rtype.equals("Citrix") && subtype.equals("User Report")) //ThinClient User Report
	{
		String Days = reportInfo.getExcludeWeekend(INI_SUBJECT);
		boolean showAllUsers = false;
		boolean showDuration = false;
		boolean showMeasure = false;
		boolean onlyThisUser = false;
		boolean getMoreUsers = false;
		ArrayList subjects=null;
		int sess =0;
		String avg = "";
		String maximum  ="";
		String s_duration="";
		String idleTime="";
		String activeTime="";
		String msmttime="";
		String LoginTime;
		String dispLoginTime="";
		String s_farmserver = request.getParameter("select_farm");
		String client_Version=request.getParameter("client_Version");
		String s_compType=request.getParameter("er_compType");
		String discontest="";
		IniFile inifile=null;
		inifile = new IniFile(EgInstallInfo.getInstallDir()+"/manager/config/eg_format.ini");

		if(s_compType!=null && s_compType.equals("Terminal_server"))
			discontest=inifile.getValue("FORMAT","TermDisconnectsTest:New_disconnects");
		else if(s_compType!=null && s_compType.equals("Citrix_server"))
			discontest=inifile.getValue("FORMAT","CtxDisconnectsTest:New_disconnects");
		else if(s_compType!=null && s_compType.equals("Citrix_XcXenApp_server"))
			discontest=inifile.getValue("FORMAT","CtxXcXADisconnTest:New_disconnects");
		boolean likeAllUsers = false;
		Hashtable avgPerForMeasures = new Hashtable();
		Hashtable fromReport = new Hashtable();
		if(userReSum!=null && userReSum.size() > 0)
		{
			showAllUsers = ((Boolean)userReSum.get(0)).booleanValue();
			showDuration = ((Boolean)userReSum.get(1)).booleanValue();
			showMeasure = ((Boolean)userReSum.get(2)).booleanValue();
			sess = ((Integer)userReSum.get(3)).intValue();
			onlyThisUser = ((Boolean)userReSum.get(4)).booleanValue();
			likeAllUsers = ((Boolean)userReSum.get(5)).booleanValue();
			if(showDuration)
			{
				avg = (String)userReSum.get(6);
				maximum = (String)userReSum.get(7);
			}
		}
		user = request.getParameter("er_user");
		user = erUtils.specialCharDecode(user);
		if(user == null || user.equals(""))
			user = request.getParameter("er_tuser");
		if(user!=null && user.indexOf("\\")==-1)
		{
			user = StringUtils.replace(user,"%5C","\\");
		}
		if(user!=null && user.indexOf("+")>-1)
		{
			user = StringUtils.replace(user,"+"," ");
		}
%>  
<div class="printOuterBoxNoBorder">
			<div class="printSelectionFields"><egui:intnl text="reporter.common.Thin Client" />&nbsp; <%=subtype%> -
<%
		if(showAllUsers)
		{
					lst.add(intlmp.getTextDescription("reporter.common.Thin Client")+" "+subtype +" All");
%>
			<span class="bold"> <%=intlmp.getTextDescription("reporter.common.All")%></span>
<%
		}
		else if(user!=null)
		{
				lst.add(intlmp.getTextDescription("reporter.common.Thin Client")+" "+subtype +" " +user);
%>
					<span class="bold"> <%=user%></span>
<%
		}
%>
				</div>
<%
		if(Strexcwe!=null&&Strexcwe.equalsIgnoreCase("Yes"))
		{
			lst.add(intlmp.getTextDescription("reporter.common.Exclude weekends")+":"+Days+'"');
%>
			<div class="printSelectionFields"><egui:intnl text="reporter.common.Exclude WeekEnds" /> - <span class="bold"><egui:intnl text="<%=Days%>" /></span></div>
<%
		}

	lst.add('"'+intlmp.getTextDescription("reporter.common.Time period")+":"+intlmp.getTextDescription("reporter.common.From")+" "+timefrom+":"+minfrom+intlmp.getTextDescription("reporter.common.hrs")+" "+intlmp.getTextDescription("reporter.common.To")+" "+getString(timeto,minto,intlmp)+'"');

	Vector dvec = new Vector();
	String stimefmt = getString("Start Date",st_Time,intlmp);
	String etimefmt = getString("End Date",en_Time,intlmp);
	dvec.add('"'+stimefmt+'"');
	dvec.add('"'+etimefmt+'"');
	lst.add(dvec);
%>
			<div class="printSelectionFields">Timeline - <span class="bold"><%=st_Time%>&nbsp;<egui:intnl text="reporter.common.hrs" /> to <%=en_Time%>&nbsp;<egui:intnl text="reporter.common.hrs" /></span></div>

			<div class="printSelectionFields" style="float:left">Time Period - <span class="bold"><%=timefrom+":"+minfrom+" "%>&nbsp;<egui:intnl text="reporter.common.hrs" /> to <%=timeto+":"+minto%>&nbsp;<egui:intnl text="reporter.common.hrs" /></span></div>
</div>

<%
		if(s_compType!=null && s_compType.equalsIgnoreCase("Horizon_Pod"))
		{
			JSONObject pod_resultMap = (JSONObject)session.getAttribute("USER_SESSION_DETAILS_POD");
			if(pod_resultMap==null)
			{
				pod_resultMap = new JSONObject();
			}
			String res_status = (String)pod_resultMap.get("NO_DATA");
			if(res_status!=null && res_status.equalsIgnoreCase("No"))
			{
				sen = new Hashtable();
				ht = new Hashtable();
				vec = new Vector();
				lst_dat = new LinkedList();
				s_tit = "Overview by Desktop Pools";

				JSONObject summaryTableColumns = (JSONObject)pod_resultMap.get("summaryTableColumns");
				JSONArray dataList = (JSONArray)pod_resultMap.get("SummaryDataList");
				JSONObject mainTableColumns = (JSONObject)pod_resultMap.get("mainTableColumns");
				JSONArray mainTableData = (JSONArray)pod_resultMap.get("mainTableData");
				Iterator itrs = summaryTableColumns.keySet().iterator();
				ArrayList subCol = new ArrayList();
				JSONObject dataTitleObj = (JSONObject)dataList.get(0);
				Set headItrSet = dataTitleObj.keySet();
%> 
				<table align="center" width="100%" cellspacing="0" cellpadding="0" class="printTable" border="0">
					<tr>
						<td align="center" class="printTableHeader" colspan="<%=headItrSet.size()%>">Overview by Desktop Pools</td>
					</tr>
					<tr>
<%
				
				while(itrs.hasNext())
				{
					String rowSpan = "2";
					String colSpan = "1";
					String colKey = (String)itrs.next();
					Object colObj = summaryTableColumns.get(colKey);
					String dispStr = colKey;
					if(colObj instanceof JSONArray)
					{
						rowSpan = "1";
						JSONArray JAry = (JSONArray)colObj;
						subCol.add(JAry);
						colSpan = JAry.size()+"";
						for(int vu=0;vu<JAry.size();vu++)
						{
							String JStr = (String)JAry.get(vu);
							if(JStr.indexOf("#")>-1)
							{
								JStr = JStr.substring(JStr.indexOf("#")+1);
							}
							vec.add(dispStr+"-"+JStr);
						}
					}
					else
					{
						dispStr = (String)colObj;
						vec.add(dispStr);
					}
%>
						<td rowspan ="<%=rowSpan%>" colspan="<%=colSpan%>" class="printTableHeader"><%=dispStr%></td>
<%
				}
%>
					</tr>
<%
				if(subCol.size()>0)
				{
%>
					<tr>
<%
					for(int u=0;u<subCol.size();u++)
					{
						JSONArray sub = (JSONArray)subCol.get(u);
						String colSpan = sub.size()+"";
						for(int v=0;v<sub.size();v++)
						{
							String dispStr = (String)sub.get(v);
							if(dispStr.indexOf("#")>-1)
							{
								dispStr = dispStr.substring(dispStr.indexOf("#")+1);
							}
%>			
						<td class="printTableHeader2"><%=dispStr%></td>
<%
						}
					}
%>
					</tr>
<%
				}
				for(int u=0;u<dataList.size();u++)
				{
					JSONObject dataObj = (JSONObject)dataList.get(u);
					itrs = dataObj.keySet().iterator();
%>
					<tr>
<%
					while(itrs.hasNext())
					{
						String colKey = (String)itrs.next();
						String dataStr = (String)dataObj.get(colKey);
						lst_dat.add(dataStr);
%>
						<td><%=dataStr%></td>
<%
					}
%>
					</tr>
<%
				}
%>
				</table>
				<br/>
<%
				
				itrs = mainTableColumns.keySet().iterator();
				subCol = new ArrayList();
				dataTitleObj = (JSONObject)mainTableData.get(0);
				headItrSet = dataTitleObj.keySet();
				
				sen.put(vec,lst_dat);
				ht.put(s_tit,sen);
				lst.add(ht);
				
				sen = new Hashtable();
				ht = new Hashtable();
				vec = new Vector();
				lst_dat = new LinkedList();
				s_tit = "User Session details";
%>
				<table align="center" width="100%" cellspacing="0" cellpadding="0" class="printTable" border="0">
					<tr>
						<td align="center" class="printTableHeader" colspan="<%=headItrSet.size()%>">User Session details</td>
					</tr>
					<tr>
<%
				
				while(itrs.hasNext())
				{
					String rowSpan = "2";
					String colSpan = "1";
					String colKey = (String)itrs.next();
					Object colObj = mainTableColumns.get(colKey);
					String dispStr = colKey;
					if(colObj instanceof JSONArray)
					{
						rowSpan = "1";
						JSONArray JAry = (JSONArray)colObj;
						subCol.add(JAry);
						colSpan = JAry.size()+"";
						for(int vu=0;vu<JAry.size();vu++)
						{
							String JStr = (String)JAry.get(vu);
							if(JStr.indexOf("#")>-1)
							{
								JStr = JStr.substring(JStr.indexOf("#")+1);
							}
							vec.add(dispStr+"-"+JStr);
						}
					}
					else
					{
						dispStr = (String)colObj;
						vec.add(dispStr);
					}
%>
						<td rowspan ="<%=rowSpan%>" colspan="<%=colSpan%>" class="printTableHeader"><%=dispStr%></td>

<%
				}
%>
					</tr>
<%
				if(subCol.size()>0)
				{
%>
					<tr>
<%
					for(int u=0;u<subCol.size();u++)
					{
						JSONArray sub = (JSONArray)subCol.get(u);
						String colSpan = sub.size()+"";
						for(int v=0;v<sub.size();v++)
						{
							String dispStr = (String)sub.get(v);
							if(dispStr.indexOf("#")>-1)
							{
								dispStr = dispStr.substring(dispStr.indexOf("#")+1);
							}
%>			
						<td class="printTableHeader2"><%=dispStr%></td>
<%
						}
					}
%>
					</tr>
<%
				}

				for(int u=0;u<mainTableData.size();u++)
				{
					JSONObject dataObj = (JSONObject)mainTableData.get(u);
					itrs = dataObj.keySet().iterator();
%>
					<tr>
<%
					while(itrs.hasNext())
					{
						String colKey = (String)itrs.next();
						String dataStr = (String)dataObj.get(colKey);
						lst_dat.add(dataStr);
%>
						<td><%=dataStr%></td>
<%
					}
%>
					</tr>
<%
				}
%>
				</table>
<%
				sen.put(vec,lst_dat);
				ht.put(s_tit,sen);
				lst.add(ht);
				System.out.println("lst____________ "+lst);
			
			}
			else
			{
%>
		<table width='100%' height='100%'>
			<tr>
				<td align='center' valign='middle'><img src='/images/Light/nomeasures_custom.png' /></td>
			</tr>
		</table>
<%
		lst.add(intlmp.getTextDescription("reporter.common.No measures available for the current selection"));
			
			}
		}
		else if(topAppsDataForFarm ==null || topAppsDataForFarm.isEmpty() || topAppsDataForFarm.size()== 0)
		{
			if(Hash_repdata!=null && Hash_repdata.size()>0)
			{
				Vector v_users = new Vector();
				for(int j=0; j < sess; j++)
				{
					try
					{
						Object v = (Object)Hash_repdata.get(j);
						if(v instanceof Hashtable)
						{
							avgPerForMeasures = (Hashtable)Hash_repdata.get(j);
							continue;
						}
						else if(v instanceof HashMap)
						{
							Report_data = (HashMap)Hash_repdata.get(j);
						}
					}
					catch(Exception e)
					{
						System.out.println("EXCEPTION IN USER :"+e);
					}
				}
%>

<div class="printOuterBox">

<%
				if(!showAllUsers && (showDuration || showMeasure)  && !isSummary)
				{
						s_tit = intlmp.getTextDescription("reporter.common.SUMMARY FOR USER")+" - "+user;

%>
			<div class="printOuterBoxHeader"><egui:intnl
			text="reporter.thin.SUMMARY FOR USER" /> - <%=user%></div>
<%
				}
				if(showDuration && !showAllUsers && !isSummary)
				{
					vec.add(intlmp.getTextDescription("reporter.thin.Measures"));
					vec.add(intlmp.getTextDescription("reporter.thin.Values"));

					lst_dat.add(intlmp.getTextDescription("reporter.common.Total number of sessions completed")+" ("+intlmp.getTextDescription("reporter.thin.Number")+")");

					Integer sessobj = new Integer(sess);
					lst_dat.add(((sess-1)+""));
					
					lst_dat.add(intlmp.getTextDescription("reporter.thin.Average duration")+" ("+intlmp.getTextDescription("reporter.common.Mins")+")");
					lst_dat.add(avg);

					lst_dat.add(intlmp.getTextDescription("reporter.common.Maximum duration")+" ("+intlmp.getTextDescription("reporter.common.Mins")+")");
					lst_dat.add(maximum);

%>
<div class="newTable" >
	<table align="left" cellspacing="0" cellpadding="0" width="100%">
	<tbody>
	<tr>

		<td align="left" width="50%"><egui:intnl text="reporter.common.Sessions completed" /> (<egui:intnl text="reporter.common.Number" />)</td> 
		<td align="center" width="50%"><%=sess-1%></td>
	</tr>
	<tr>
		<td align="left" width="60%"><egui:intnl text="reporter.common.Average duration" /> (<egui:intnl text="reporter.common.Mins" />)</td> <td align="center" width="40%"><%=avg%></td>
	</tr>
	<tr>
		<td align="left" width="60%"><egui:intnl text="reporter.common.Maximum duration" /> (<egui:intnl text="reporter.common.Mins" />)</td> <td width="40%" align="center" nowrap><%=maximum%></td>
	</tr>
<%
				
				showMeasure = true;
				if(showMeasure && !showAllUsers && !isSummary)
				{
					if(avgPerForMeasures!=null && avgPerForMeasures.size() > 0)
					{
						String skey="";
						Iterator itr = avgPerForMeasures.keySet().iterator();
						subjects=(ArrayList)reportInfo.getVariables(INI_SUBJECT);
						for (int m=0;m<subjects.size();m++)
						{
							skey=(String)subjects.get(m);
							if (skey.indexOf(s_compType)>-1)
								skey=skey.substring(skey.indexOf(s_compType)+s_compType.length()+1);
							else
								continue;

							String sum_data = (String)avgPerForMeasures.get(skey);
							if(sum_data == null){
								StringTokenizer st_sum = new StringTokenizer(skey,":");
								String dispMear="";
								String tst="";
								String measr="";
								int cntt=0;
								String tmpKey="";
								while(st_sum.hasMoreTokens())
								{
									tst= (String)st_sum.nextToken();
									measr= (String)st_sum.nextToken();
									if(cntt == 0){
										if(measr != null && measr.indexOf("#") > -1){
											dispMear=measr.substring(measr.indexOf("#")+1);
											measr=measr.substring(0,measr.indexOf("#"));
										}else{
											dispMear=measr;
										}
									}
									tmpKey=tst+":"+measr+"#"+dispMear;
									if(avgPerForMeasures != null && avgPerForMeasures.containsKey(tmpKey)){
										sum_data=(String)avgPerForMeasures.get(tmpKey);
										break;
									}
									cntt++;
								}
							}
							String firstmes = "";
							String secondmes = "";
							StringTokenizer st_m = new StringTokenizer(sum_data,"#");
							while(st_m.hasMoreTokens())
							{
								firstmes = (String)st_m.nextToken();
								StringTokenizer st_tok = new StringTokenizer(firstmes,"@");
								String displaymes = st_tok.nextToken();
								String displayval = st_tok.nextToken();
								lst_dat.add(intlmp.getTextDescription("reporter.common."+displaymes));
								lst_dat.add(displayval);
%>
	<tr>
		<td align="left" wrap width="60%"><%=displaymes%></td>
		<td align="center" nowrap width="40%"><%=displayval%></td>
	</tr>
<%
							}
						}
					}
				}
%>
	</tbody>
	</table>
	</div>
	<br/>

<%

				}
				if(lst_dat!=null && !lst_dat.isEmpty())
				{
				
					
					sen.put(vec,lst_dat);
					ht=new Hashtable();
					ht.put(s_tit,sen);
					lst.add(ht);

						
					
					session.setAttribute("ScheduleCSVData",lst);
					sen = new Hashtable();
					ht = new Hashtable();
					vec = new Vector();
					lst_dat = new LinkedList();
					s_tit = "";
				}
				String client_details = "";
				boolean isVm = false;
				ArrayList aListClientDetails_ColName = new ArrayList();
				ArrayList aListClientDetails = new ArrayList();
				String strCompTypeDetailsVal = "";
				String geoColumn = reportInfo.getValue(INI_SUBJECT,"GeoColumnDetails_"+s_compType);
				ArrayList geoColumnList = com.egurkha.util.StringUtils.egTokenizer(geoColumn, ",",false,false,true);
				if(s_compType!=null)
				{
					client_details = reportInfo.getValue(INI_SUBJECT,"ClientDetails");
					
					String Vdiclient_details = reportInfo.getValue(INI_SUBJECT,"VdiClientDetails");
					if(client_details!=null && client_details.length()>0)
					{
						StringTokenizer stToken = new StringTokenizer(client_details,",");
						while (stToken.hasMoreTokens())
						{
							String strVal = stToken.nextToken();
							if(strVal!=null && strVal.startsWith(s_compType))
							{
								strCompTypeDetailsVal = strVal;
								break;
							}
						}
					}
					if(Vdiclient_details!=null && Vdiclient_details.length()>0)
					{
						StringTokenizer stToken = new StringTokenizer(Vdiclient_details,",");
						while (stToken.hasMoreTokens())
						{
							String strVal = stToken.nextToken();
							if(strVal!=null && strVal.startsWith(s_compType))
							{
								strCompTypeDetailsVal = strVal;
								isVm = true;
								break;
							}
						}
					}
				}
				if(strCompTypeDetailsVal!=null && strCompTypeDetailsVal.length()>0)
				{
					StringTokenizer stToken_1 = new StringTokenizer(strCompTypeDetailsVal,":");
					stToken_1.nextToken();//Component Type Token
					if(isVm)
						stToken_1.nextToken();//TestName Token
					while (stToken_1.hasMoreTokens())
					{
						String strVal = stToken_1.nextToken();
						String strColName = strVal;
						if(strVal!=null && strVal.indexOf("#")>-1)
						{
							strVal = strVal.substring(strVal.indexOf("#")+1);
							strColName = strColName.substring(0,strColName.indexOf("#"));
						}
						aListClientDetails_ColName.add(strColName);
						aListClientDetails.add(strVal);
					}
				}
				if(showDuration || showAllUsers  || likeAllUsers)
				{
				/*	if(showAllUsers || likeAllUsers)
					{
%>
	<table align="center" width="100%" cellspacing="0" cellpadding="0">
<%
					}
					else
					{
%>
<table align="center" width="100%" cellspacing="0" cellpadding="0">
<%
					}*/

					String totalspan=(String)session.getAttribute("headingspan");
					int in = 0;
					if(totalspan != null)
					{
						if(s_compType!=null && aListVmComponentType.contains(s_compType))
						{
							in = Integer.parseInt(totalspan);
							in = in+1;
							totalspan = Integer.toString(in);
						}
					}
				/*	if(totalspan == null)
					{
						totalspan=(String)request.getAttribute("headingspan");
					//	totalspan=(String)request.getAttribute("totalspanControlProcess");
					}*/
					if(totalspan == null)
					{
						subjects=(ArrayList)reportInfo.getVariables(INI_SUBJECT);
						if(showAllUsers)
						totalspan=(getColspanCount(subjects,INI_SUBJECT,s_compType)+5)+"";
						else
						totalspan=(getColspanCount(subjects,INI_SUBJECT,s_compType)+4)+"";
						if(s_compType!=null && aListVmComponentType.contains(s_compType))
						{
							in = Integer.parseInt(totalspan);
							in = in + 1;
							totalspan = Integer.toString(in);
						}
					}
					int sizeClient = 0;
					if(Report_data!=null && (Report_data.containsKey("Client_IP_Address")|| Report_data.containsKey("Client_name")))
					{
						if(aListClientDetails!=null && aListClientDetails.size()>0)
							sizeClient =aListClientDetails.size();
						in = Integer.parseInt(totalspan);
						in = in + sizeClient;
						totalspan = Integer.toString(in);
					}
					
					if(( er_showResourceUsage!=null && er_showResourceUsage.equalsIgnoreCase("No")))
						{
						
						if(showAllUsers)
							{
							totalspan="9";
							if(clientIp!=null && clientIp.equals("Yes"))
							{
								if(Report_data!=null && (Report_data.containsKey("Client_IP_Address")|| Report_data.containsKey("Client_name")))
								{
									totalspan=(8+sizeClient)+"";
								}
							}
							}
						else
							{
							totalspan="8";
								if(clientIp!=null && clientIp.equals("Yes"))
							{
								if(Report_data!=null && (Report_data.containsKey("Client_IP_Address")|| Report_data.containsKey("Client_name")))
								{
									totalspan=(7+sizeClient)+"";
								}
							}
							}

						}
						String strShowAppNames = reportInfo.getValue(INI_SUBJECT,"ShowApplicationDeatils");
						boolean showAppNames = false;
						if(strShowAppNames!=null && (strShowAppNames.equalsIgnoreCase("Yes") || strShowAppNames.equalsIgnoreCase("True")))
						{
							if(!isSummary && (er_showResourceUsage!=null && er_showResourceUsage.equalsIgnoreCase("Yes")))
							{
								in = Integer.parseInt(totalspan);
								in = in + 1;
								totalspan = Integer.toString(in);
								showAppNames = true;
							}
				
						}
//String totalspan="9";
%>
<%
					// If problem will arise na we look it in totalspan
					if(!showAllUsers && !likeAllUsers)
					{
					s_tit1 = intlmp.getTextDescription("reporter.common.Session details for User")+" - "+user;
%>
		<div class="printOuterBoxHeader"><egui:intnl text="reporter.thin.SESSION DETAILS FOR USER" /> - <%=user%></div>
<%
					}
					else
					{
						if(likeAllUsers)
						{
							s_tit1 = intlmp.getTextDescription("reporter.common.Session details for User")+" - "+user;
%>
		<div class="printOuterBoxHeader"><egui:intnl text="reporter.common.SESSION DETAILS FOR" /> - <%=user%> <egui:intnl text="reporter.common.USERS" /></div>
<%
						}
						else
						{
							s_tit1 = intlmp.getTextDescription("reporter.common.Session details for  User3")+" - "+intlmp.getTextDescription("reporter.common.All Users");
%>
				<div class="printOuterBoxHeader"><egui:intnl text="reporter.common.SESSION DETAILS FOR" /> - <egui:intnl text="reporter.common.ALL USERS" /></div>
<%
						}
					}
%>
<div class="newTable">
<table align="center" width="100%" cellspacing="0" cellpadding="0">
	<thead>
	<tr>
<%
					ArrayList a_measunit = new ArrayList(); // get measures unit name and no of column separator
					if(showAllUsers || likeAllUsers)
					{
						vec1.add(intlmp.getTextDescription("reporter.common.User"));
%>
		<th  align="center" nowrap width="10%"><egui:intnl text="reporter.common.User" /></th>
<%
					}
					if(isSummary)
					{
						%>
		<th align="center" nowrap width="10%"><egui:intnl text="reporter.common.Total Number of Sessions" /></th>
						<%						
						vec1.add(intlmp.getTextDescription("reporter.common.Total Number of Sessions"));
						if(client_Version != null && !client_Version.equalsIgnoreCase("")){
							for(int m=0;m<aListClientDetails.size();m++)
							{
						%>
		<th align="center" nowrap width="10%"><%=intlmp.getTextDescription("reporter.common."+(String)aListClientDetails.get(m))%></th>
						<%
								vec1.add(intlmp.getTextDescription("reporter.common."+(String)aListClientDetails.get(m)));
							}
						}
					}
					if(!isSummary)
					{
						if(clientIp!=null && clientIp.equals("Yes"))
						{
							if(Report_data!=null && (Report_data.containsKey("Client_IP_Address")|| Report_data.containsKey("Client_name")))
							{
								if(aListClientDetails !=null && aListClientDetails.size()>0)
								{
									for(int m=0;m<aListClientDetails.size();m++)
									{
										vec1.add(intlmp.getTextDescription("reporter.common."+aListClientDetails.get(m)));
									}
								}
							}
						}
						vec1.add(intlmp.getTextDescription("reporter.common.Session Start Time(Local time on server)"));
						vec1.add(intlmp.getTextDescription("reporter.common.Logout/Disconnect Time(Time on Mgmt)"));
						//
				vec1.add(intlmp.getTextDescription("reporter.common.Session Duration")+" ("+intlmp.getTextDescription("reporter.common.Mins")+")");
				vec1.add(intlmp.getTextDescription("reporter.common.Idle Time")+" ("+intlmp.getTextDescription("reporter.common.Mins")+")");
				vec1.add(intlmp.getTextDescription("reporter.common.Active Time")+" ("+intlmp.getTextDescription("reporter.common.Mins")+")");
				if(clientIp!=null && clientIp.equals("Yes"))
				{
					if(geoColumnList != null && geoColumnList.size() >0 ){
						if(Report_data!=null && Report_data.containsKey("CITY")){
							for(int m=0;m<geoColumnList.size();m++){
								vec1.add(intlmp.getTextDescription("reporter.common."+(String)geoColumnList.get(m)));
							}
						}
					}
				}
						//


					vec1.add(intlmp.getTextDescription("reporter.common.Server"));
					if(clientIp!=null && clientIp.equals("Yes"))
					  {
					if(Report_data!=null && (Report_data.containsKey("Client_IP_Address")|| Report_data.containsKey("Client_name")))
						{
								if(aListClientDetails !=null && aListClientDetails.size()>0)
								{
									for(int m=0;m<aListClientDetails.size();m++)
									{
%>
		<th align="center"> <div style="width: 80px; word-wrap: break-word; overflow-x:auto;"><%=intlmp.getTextDescription("reporter.common."+aListClientDetails.get(m))%></div></th>
<%
									}
								}
						}
					  }
					}
					else
					{
						vec1.add(intlmp.getTextDescription("reporter.common.Session Duration")+" ("+intlmp.getTextDescription("reporter.common.Mins")+")");
						vec1.add(intlmp.getTextDescription("reporter.common.Idle Time")+" ("+intlmp.getTextDescription("reporter.common.Mins")+")");
						vec1.add(intlmp.getTextDescription("reporter.common.Active Time")+" ("+intlmp.getTextDescription("reporter.common.Mins")+")");
				
					}
					if(!isSummary)
					{

%>

		<th align="center"> <div style="width: 80px; word-wrap: break-word; overflow-x:auto;"><egui:intnl text="reporter.common. Session Start Time "/></div></th>
		<th align="center"><div style="width: 80px; word-wrap: break-word; overflow-x:auto;"><egui:intnl text="reporter.common.Logout / Disconnect Time"/></div></th>
		
<%
					}
%>	<th align="center" ><div style="width: 80px; word-wrap: break-word; overflow-x:auto;"><egui:intnl text="reporter.common.Session Duration" /></div></th>
<th align="center" ><div style="width: 80px; word-wrap: break-word; overflow-x:auto;"><egui:intnl text="reporter.common. Idle Time "/></div></th>
<th align="center" ><div style="width: 80px; word-wrap: break-word; overflow-x:auto;"><egui:intnl text="reporter.common. Active Time "/> </div></th>
<%
		if(!isSummary && !hasVMs)
					{
	%>
		<!--<th align="center" nowrap width="10%"><egui:intnl text="reporter.common.Server" /></th>-->
		<th align="center" nowrap width="10%"><egui:intnl text="reporter.common.Component" /></th>
<%
					}
			if(clientIp!=null && clientIp.equals("Yes"))
				{
					if(geoColumnList != null && geoColumnList.size() >0 ){
						if(Report_data!=null && Report_data.containsKey("CITY")){
							for(int m=0;m<geoColumnList.size();m++){
								String str1=(String)geoColumnList.get(m);
					%>
							<th align="center" ><div style="width: 80px; word-wrap: break-word; overflow-x:auto;"><%=str1%></div></th>
					<%
							}
						}
					}
					}
	if(s_compType!=null && aListVmComponentType.contains(s_compType) && (!isSummary))
	{
		/*if(( er_showResourceUsage!=null && er_showResourceUsage.equalsIgnoreCase("Yes")))
		{*/
		vec1.add(intlmp.getTextDescription("reporter.common.Desktop Name"));
	%>
		<th align="center" wrap width="10%"><egui:intnl text="reporter.common.Desktop Name"/></th>
	<%
		//}
	}
	//
							vec1.add(intlmp.getTextDescription("reporter.common.Session Start-up Duration")+" ("+intlmp.getTextDescription("reporter.common.Sec")+")");
	//
	%>
	<th align="center" ><div style="width: 80px; word-wrap: break-word; overflow-x:auto;"><egui:intnl text="reporter.common.Session Start-up Duration" /></div></th>

		
<%
	if(showAppNames)
	{
		vec1.add(intlmp.getTextDescription("reporter.common.Applications"));
%>
		<th align="center" wrap width="10%"><egui:intnl text="reporter.common.Applications" /></th>
<%
	}
					if(perServerDispMaxAvgPer!=null && perServerDispMaxAvgPer.size() > 0)
					{
						Hashtable pServerData = (Hashtable)perServerDispMaxAvgPer.get(0);
						if(pServerData!=null && pServerData.size() > 0)
						{
							Enumeration p_keys = pServerData.keys();
							while(p_keys.hasMoreElements())
							{
								String key = (String)p_keys.nextElement();
								Hashtable value = (Hashtable)pServerData.get(key);
					//			Enumeration n_keys = value.keys();
								Hashtable ht_colspan=(Hashtable)session.getAttribute("colspan");
								if(ht_colspan == null)
								{
									ht_colspan=(Hashtable)request.getAttribute("colspan");
								}
								//This code Added For PD4ML Schedule & BackGround
								if(ht_colspan == null || ht_colspan.isEmpty())
								{
									Hashtable colspanCode = new Hashtable();
									if(value!=null && value.size() > 0)
									{
										Iterator itr=value.keySet().iterator();
										while(itr.hasNext())
										{
											String userNam=(String)itr.next();
											try
											{
												Vector ns = (Vector)value.get(userNam);
												colspanCode.put(userNam,Integer.toString(ns.size()));
											}
											catch(ClassCastException e)
											{
												String data = (String)value.get(userNam);
												colspanCode.put(userNam,Integer.toString(data.length()));
											}
										}
									}
									ht_colspan = colspanCode;
								}
								subjects=(ArrayList)reportInfo.getVariables(INI_SUBJECT);
								for(int count_dis=0; count_dis<subjects.size(); count_dis++)
								{
									String var=(String)subjects.get(count_dis);
									if(var.indexOf(s_compType)<0)
										continue;

									StringTokenizer colon_st=new StringTokenizer(var,":");
									String type=colon_st.nextToken();
									String test=colon_st.nextToken();
									String hashvar=colon_st.nextToken();

									StringTokenizer temp_st=new StringTokenizer(hashvar,"#");
									String measure=temp_st.nextToken();
									String temp_disp=temp_st.nextToken();

									String unitmeasure=tablesInfo.getUnitForMeasure(test,measure);
									String cspan=(String)ht_colspan.get(temp_disp);
									a_measunit.add(unitmeasure+"="+cspan);
%>
		<th align="center" wrap colspan="<%=cspan%>" width="10%"><egui:intnl text='<%="reporter.common."+temp_disp%>' /></th>
<%
								}
								break;
							}
						}
					}
%>
	</tr>

		<!-- separate measures from unit.add separate row start-->
	<tr>
<%
					if((showAllUsers || likeAllUsers) && !isSummary)
					{
%>
		<th align="center" class="subHeader" width="10%">&nbsp;</th>
		
<%
					}
			%>
			<th align="center" class="subHeader" width="10%">&nbsp;</th>
			
			<%
					if(!isSummary && !hasVMs)
					{
%>
		
		<th align="center" class="subHeader" width="10%">&nbsp;</th>
	<!--	<td align="center" class="printTableHeader2" width="10%">&nbsp;</td> -->
<%
					}
					if(isSummary&& showAllUsers)
					{
%>
		<th align="center" class="subHeader" width="10%">&nbsp;</th>  
<%
					}
					if(isSummary && client_Version != null && !client_Version.equalsIgnoreCase("")){
						for(int m=0;m<aListClientDetails.size();m++)
						{
					%>
		<th align="center" class="subHeader" width="10%">&nbsp;</th>  
					<%
						}
					}
				
	if(!isSummary && clientIp!=null && clientIp.equals("Yes"))
	{
				if(Report_data!=null && (Report_data.containsKey("Client_IP_Address")|| Report_data.containsKey("Client_name")))
				{
					if(aListClientDetails !=null && aListClientDetails.size()>0)
					{
						for(int m=0;m<aListClientDetails.size();m++)
						{
%>
		<th align="center" class="subHeader" width="10%">&nbsp;</th>
<%
						}
					}
				}
	}
	

	if(s_compType!=null && aListVmComponentType.contains(s_compType))
	{
		if(!isSummary && ( er_showResourceUsage!=null && er_showResourceUsage.equalsIgnoreCase("yes")))
		{
%>
		<th align="center" class="subHeader" width="10%">&nbsp;</th>
<%
		}
	}
	if(isSummary && !showAllUsers && likeAllUsers )
	{
%>
		
		<th align="center" class="subHeader" width="10%">&nbsp;</th>
<%
	}
%>
	<th align="center" class="subHeader" width="10%">(<egui:intnl text="reporter.common.Mins" />)</th>
	<th align="center" class="subHeader" width="10%">(<egui:intnl text="reporter.common.Mins" />)</th>
	<th align="center" class="subHeader" width="10%">(<egui:intnl text="reporter.common.Mins" />)</th>
		<%

				if(!isSummary)
					{
					%>
		<th align="center" class="subHeader" width="10%">&nbsp;</th>
					<%
					}
				if(clientIp!=null && clientIp.equals("Yes"))
				{
					if(geoColumnList != null && geoColumnList.size() >0 ){
						if(Report_data!=null && Report_data.containsKey("CITY")){
							for(int m=0;m<geoColumnList.size();m++){
					%>
							<th align="center" class="subHeader" width="10%">&nbsp;</th>
					<%
							}
						}
					}
					}
					%>
		
		<th align="center" class="subHeader" width="10%">(<egui:intnl text="reporter.common.Sec" />)</th>

<%
	if(showAppNames)
	{
%>
		<th align="center" class="subHeader" width="10%">&nbsp;</th>
<%
	}
					for(int u=0; u < a_measunit.size(); u++)
					{
						String measureUnit=(String)a_measunit.get(u);
						StringTokenizer unitValue=new StringTokenizer(measureUnit,"=");
						int tokensCount=unitValue.countTokens();
						String measUnitDisp = "";
						String countDisp ="1";
						if(tokensCount>1)
						{
							measUnitDisp = unitValue.nextToken();
							countDisp = unitValue.nextToken();
							measUnitDisp = "("+measUnitDisp+")";
						}
%>
		<th colspan="<%=countDisp%>" class="subHeader" nowrap align="center" width="10%"><%=measUnitDisp%></th>
<%
					}
%>
	</tr>
		<!-- end -->
		<%
		if(( er_showResourceUsage!=null && er_showResourceUsage.equalsIgnoreCase("Yes")))
		{
		%>
	<tr>
<%
					if(perServerDispMaxAvgPer!=null && perServerDispMaxAvgPer.size() > 0)
					{
						if(showAllUsers || likeAllUsers)
						{
%>
		<th align="center" nowrap width="10%" class="subHeader">&nbsp;</th>
<%
						}
					}
		if(!hasVMs)
		{
%>
<th align="center" nowrap width="10%" class="subHeader">&nbsp;</th>
<%
		}
%>
<th align="center" nowrap width="10%" class="subHeader">&nbsp;</th>
<%
					if(!isSummary)
					{
%>
		
		
		<th align="center" nowrap width="10%" class="subHeader">&nbsp;</th>
		<th align="center" nowrap width="10%" class="subHeader">&nbsp;</th>
		<th align="center" nowrap width="10%" class="subHeader">&nbsp;</th>
		<th align="center" nowrap width="10%" class="subHeader">&nbsp;</th>
		<th align="center" nowrap width="10%" class="subHeader">&nbsp;</th>

<%
					}
					if(isSummary)
					{
						%>
					<th align="center" nowrap width="10%" class="subHeader">&nbsp;</th>
					<th align="center" nowrap width="10%" class="subHeader">&nbsp;</th>
					<th align="center" nowrap width="10%" class="subHeader">&nbsp;</th>
						<%
					if(client_Version != null && !client_Version.equalsIgnoreCase("")){
						for(int m=0;m<aListClientDetails.size();m++)
						{
					%>
					<th align="center" class="subHeader" width="10%">&nbsp;</th>  
					<%
						}
					}
					}
	

		if(clientIp!=null && clientIp.equals("Yes") && client_Version == null)
			{
		if(Report_data!=null && (Report_data.containsKey("Client_IP_Address")|| Report_data.containsKey("Client_name")))
		{
				if(aListClientDetails !=null && aListClientDetails.size()>0)
				{
					for(int m=0;m<aListClientDetails.size();m++)
					{
%>
		<th align="center" class="subHeader" width="10%">&nbsp;</th>
<%
					}
				}
		}
			}
	if(showAppNames)
	{
%>
<th align="center" class="subHeader" width="10%">&nbsp;</th>
<%
	}
				if(clientIp!=null && clientIp.equals("Yes"))
				{
					if(geoColumnList != null && geoColumnList.size() >0 ){
						if(Report_data!=null && Report_data.containsKey("CITY")){
							for(int m=0;m<geoColumnList.size();m++){
					%>
							<th align="center" class="subHeader" width="10%">&nbsp;</th>
					<%
							}
						}
					}
				}

					if(s_compType!=null && aListVmComponentType.contains(s_compType))
					{
						if(!isSummary && ( er_showResourceUsage!=null && er_showResourceUsage.equalsIgnoreCase("Yes")))
						{
%>
		<th align="center" nowrap width="10%" class="subHeader">&nbsp;</th>
<%
						}
					}
					if(perServerDispMaxAvgPer!=null && perServerDispMaxAvgPer.size() > 0)
					{
						Hashtable pServerData = (Hashtable)perServerDispMaxAvgPer.get(0);
						if(pServerData!=null && pServerData.size() > 0)
						{
							Enumeration p_keys = pServerData.keys();
							while(p_keys.hasMoreElements())
							{
								String key = (String)p_keys.nextElement();
								Hashtable value = (Hashtable)pServerData.get(key);
								if(value!=null && value.size() > 0)
								{
									subjects=(ArrayList)reportInfo.getVariables(INI_SUBJECT);
									for(int count_dis=0; count_dis<subjects.size(); count_dis++)
									{
										String var=(String)subjects.get(count_dis);
										if(var.indexOf(s_compType)<0)
											continue;
										StringTokenizer temp_st=new StringTokenizer(var,"#");
										String strTest = temp_st.nextToken();
										if(strTest!=null && strTest.lastIndexOf(":")>-1)
										{
											//strTest = strTest.substring(strTest.lastIndexOf(":")+1);
											strTest = strTest.substring(strTest.indexOf(":")+1,strTest.lastIndexOf(":"));
										}
										String temp_disp=temp_st.nextToken();
										if(temp_disp != null && temp_disp.indexOf(":") > -1)
											temp_disp=temp_disp.substring(0,temp_disp.indexOf(":"));
										Vector v_data = (Vector)value.get(temp_disp);
										if(v_data!=null && v_data.size() > 0)
										{
											for(int vd=0; vd < v_data.size(); vd++)
											{
												String val = (String)v_data.get(vd);
												StringTokenizer st_v = new StringTokenizer(val,"$");
												while(st_v.hasMoreTokens())
												{
													String measure = (String)st_v.nextToken();
													String computed = (String)st_v.nextToken();
													String computedVal = (String)st_v.nextToken();
													if(measure!=null && measure.indexOf("#")>-1)
													{
														measure = measure.substring(measure.indexOf("#")+1,measure.length());
													}
													String unitmeasure=tablesInfo.getUnitForMeasure(strTest,measure);
													if(unitmeasure!=null && unitmeasure.length()>0)
														unitmeasure = "("+unitmeasure+")";
													vec1.add(intlmp.getTextDescription("reporter.thin."+temp_disp)+unitmeasure+"-"+"("+computed+")");
%>
		<th align="center" nowrap width="10%" class="subHeader"><egui:intnl text='<%="reporter.common."+computed%>' /></th>
<%
												}
											}
										}
									}
								}
								break;
							}
						}
					}
%>
	</tr>
<%
		}
%>
		</thead>
	<tbody>

<%
					ErCtxUserReportBean.logToTmpFile("INFO"," ","ErPrintDataReport ::::: <<< data size>>>>>>"+Hash_repdata.size());
					int totalColumn = -1;
					for(int j=0;j<Hash_repdata.size();j++)
					{
						Object v1 = (Object)Hash_repdata.get(j);
						if(v1 instanceof Hashtable)
							continue;
						Report_data = (HashMap)Hash_repdata.get(j);
						if(showAllUsers || likeAllUsers)
						{
							user = (String)Report_data.get("user");
							lst_dat1.add(user);
						}
						server = (String)Report_data.get("trgt_host");
						if(server==null)
							server="";
						LoginTime = (String)Report_data.get("login_time");
						s_duration = (String)Report_data.get("duration");
						idleTime = (String)Report_data.get("idleTime");
						activeTime = (String)Report_data.get("activeTime");
						//
						String logon_duration = (String)Report_data.get("logon_duration");
						String logon_duration_splitup = (String)Report_data.get("logon_duration_splitup");
						//
						String clientIpAddress=(String)Report_data.get("Client_IP_Address");
						String temp_server=server;
						if(server.endsWith(":NULL"))
						{
							temp_server = server.substring(0,server.indexOf(":"));
						}
						msmttime = (String)Report_data.get("msmttime");
						if(msmttime!=null && !msmttime.equals(""))
						{
							if(msmttime.indexOf(":000")>0)
								msmttime=msmttime.substring(0,msmttime.indexOf(":000"));
						}
						msmttime = DateUtil.changeDateFormat(msmttime,"dd-MM-yyyy HH:mm:ss",currentDateFormat+" HH:mm:ss");
						converterStart = new EgTimeZoneConverter(msmttime,thisuser);
						msmttime = converterStart.getDateTime();

						dispLoginTime=LoginTime;
						if(LoginTime!=null)
						{
							dispLoginTime = DateUtil.changeDateFormat(LoginTime,"MM/dd/yyyy HH:mm:ss",currentDateFormat+" HH:mm:ss");
							try
							{
								converterStart = new EgTimeZoneConverter(dispLoginTime,thisuser);
								dispLoginTime = converterStart.getDateTime();
							}
							catch(Exception e)
							{
								/*These Lines are commented because of the Exception due to Am Pm format in the parameter.
								Do Check for future Changes - Monish

								converterStart = new EgTimeZoneConverter(dispLoginTime,thisuser);
								dispLoginTime = converterStart.getDateTime();*/
							}
						}
%>
	<tr>
<%
						String logintimedisp=LoginTime.substring(0,LoginTime.indexOf(" "));
						//logintimedisp = DateUtil.changeDateFormat(logintimedisp.trim(),"MM/dd/yyyy",currentDateFormat);
						String toFormAsKey = "";
						if(showAllUsers || likeAllUsers)
						{
							toFormAsKey = user + "$";
%>
		<td align="left" > <div style="width: 80px; word-wrap: break-word; overflow-x:auto;"><%=user%></div></td>
<%
						}
						if(isSummary)
						{
							String val="";
							if(summarySessionVc!=null)
							{
								val=(String)summarySessionVc.get(user);
							}else
								val=sess+"";
							lst_dat1.add(val);
%>
		<td align="left" > <div style="width: 80px; word-wrap: break-word; overflow-x:auto;"><%=val%></div></td>
<%					
						if(client_Version != null && !client_Version.equalsIgnoreCase("")){
							for(int m=0;m<aListClientDetails.size();m++)
							{
								String strCol = (String)aListClientDetails.get(m);
								String strVal = (String)Report_data.get(strCol);
						%>
		<td align="left" > <div style="width: 80px; word-wrap: break-word; overflow-x:auto;"><%=strVal%></div></td>
						<%
							}
						}
						}
						if(!isSummary && clientIp!=null && clientIp.equals("Yes"))
						{
							if(Report_data!=null && (Report_data.containsKey("Client_IP_Address")|| Report_data.containsKey("Client_name")))
							{
								if(aListClientDetails !=null && aListClientDetails.size()>0)
								{
									for(int m=0;m<aListClientDetails.size();m++)
									{
										lst_dat1.add('"'+(String)Report_data.get((String)aListClientDetails.get(m))+'"');
%>
		<td align="left"> <div style="width: 100px; word-wrap: break-word; overflow-x:auto;"><%=Report_data.get(aListClientDetails.get(m))%></div></td>
<%
									}
								}
							}
						}
					double d_duration = Math.round(Double.parseDouble(s_duration));
					String st_duration = String.valueOf(d_duration);
					if(st_duration!=null & st_duration.indexOf(".") > -1)
					{
						st_duration  = st_duration.substring(0,st_duration.indexOf("."));
					}
					toFormAsKey = toFormAsKey + LoginTime + "$" + server + "$" + st_duration;
					String deskNameData = null;
					if(perServerDispMaxAvgPer!=null && perServerDispMaxAvgPer.size() > 0)
					{
						Hashtable pServerDataSample = (Hashtable)perServerDispMaxAvgPer.get(0);
						if(pServerDataSample!=null&&pServerDataSample.size() > 0)
						{
							Hashtable p_val = (Hashtable)pServerDataSample.get(toFormAsKey);
							String deskName = (String)p_val.get("DeskTopName");
							if(deskName!=null && deskName.lastIndexOf("_")>-1)
							{
								deskNameData = deskName.substring(deskName.lastIndexOf("_")+1,deskName.length());
							}
							if(deskNameData==null || deskNameData.equals("")|| deskNameData.equals("-"))
							{
								deskNameData = (String)Report_data.get("guestname");
								if(deskNameData==null)
								{
									deskNameData = "-";
								}
							}
						}
					}
					if(!isSummary)
					{
						lst_dat1.add('"'+dispLoginTime+'"');
						lst_dat1.add('"'+msmttime+'"');
%>
		<td align="left" width="13%" wrap><%=dispLoginTime%></td>
		<td align="left" width="13%" wrap><%=msmttime%></td>
<%
					}

			lst_dat1.add(s_duration);
			lst_dat1.add(idleTime);
			lst_dat1.add(activeTime);
%>
		<td width="10%" align="center" nowrap><%=s_duration%></td>
		<td width="10%" align="center" nowrap><%=idleTime%></td>
		<td width="10%" align="center" nowrap><%=activeTime%></td>
<%

				if(!isSummary)
				{
					lst_dat1.add(temp_server);
					if(!hasVMs)
					{
%>
						<td align="left"> <div style="width: 104px; word-wrap: break-word; overflow-x:auto;"><%=temp_server%></div></td>
<%
					}
				}
				if(clientIp!=null && clientIp.equals("Yes"))
				{
					if(geoColumnList != null && geoColumnList.size() >0 ){
						if(Report_data!=null && Report_data.containsKey("CITY")){
							for(int m=0;m<geoColumnList.size();m++){
								String str1=(String)geoColumnList.get(m);
								String strVal1=(String)Report_data.get(str1);
								lst_dat1.add(strVal1);
					%>
							<td align="left"> <div style="width: 104px; word-wrap: break-word; overflow-x:auto;"><%=strVal1%></div></td>
					<%
							}
						}
					}
				}
					if(s_compType!=null && aListVmComponentType.contains(s_compType) && (!isSummary))
					{
					  if(( er_showResourceUsage!=null && er_showResourceUsage.equalsIgnoreCase("Yes")))
					  {
						if(deskNameData==null || deskNameData.equals(""))
						{
							deskNameData = "-";
%>
		<td align="center"> <div style="width: 80px; word-wrap: break-word; overflow-x:auto;"><%=deskNameData%></div></td>
<%
							lst_dat1.add(deskNameData);
						}
						else
						{
%>
		<td align="left"> <div style="width: 80px; word-wrap: break-word; overflow-x:auto;"><%=deskNameData%></div></td>
<%
							lst_dat1.add(deskNameData);
						}
					  }
					}

lst_dat1.add(logon_duration);	
%>
		<td width="8%" align="center" nowrap><%=logon_duration%></td>
<%

			if(showAppNames)
			{
				ArrayList aListData = (ArrayList)Report_data.get("AppsName");
				String strAppNames = "";
				String strAppNamesDisp = "";
				if(aListData!=null && aListData.size()>0)
				{
					for (int i=0;i<aListData.size();i++)
					{
						strAppNames+=aListData.get(i)+",";
						strAppNamesDisp+=aListData.get(i)+"<BR>";
					}
					if(strAppNames!=null && strAppNames.endsWith(","))
						strAppNames = strAppNames.substring(0,strAppNames.length()-1);
					if(strAppNames == null || strAppNames.length()==0)
					{
						strAppNames = "-";
						lst_dat1.add("-");
					}else
					{
						lst_dat1.add("\""+strAppNames+"\"");
					}
%>
					<td width="20%" align="left" wrap><%=strAppNamesDisp%></td>
<%
				}
				else
				{
					lst_dat1.add("-");
%>
					<td width="20%" align="left" wrap>-</td>
<%
				}
			}
						if(perServerDispMaxAvgPer!=null && perServerDispMaxAvgPer.size() > 0)
						{
							Hashtable pServerData = (Hashtable)perServerDispMaxAvgPer.get(0);
							Hashtable ser_dur = (Hashtable)perServerDispMaxAvgPer.get(1);
							String appDisp = "";
							if(pServerData!=null && pServerData.size() > 0)
							{
								Hashtable p_value = (Hashtable)pServerData.get(toFormAsKey);
								if(p_value!=null && p_value.size() >0)
								{
									subjects=(ArrayList)reportInfo.getVariables(INI_SUBJECT);
									boolean connectionInde=false;
									for(int count_dis=0; count_dis<subjects.size(); count_dis++)
									{
										String var=(String)subjects.get(count_dis);
										if(var.indexOf(s_compType)<0)
											continue;
										StringTokenizer temp_st=new StringTokenizer(var,"#");
										String strTestname_ = temp_st.nextToken();
										connectionInde =false;
										if(strTestname_!=null && strTestname_.equalsIgnoreCase(s_compType+":CtxXcXAUserTest:Connection_strength"))
											connectionInde = true;

										String temp_disp=temp_st.nextToken();
										if(temp_disp != null && temp_disp.indexOf(":")> -1)
											temp_disp=temp_disp.substring(0,temp_disp.indexOf(":"));
										String dbName = "";
										String dispName = "";
										Vector p_val = (Vector)p_value.get(temp_disp);//p_key);
										if(p_val!=null && p_val.size() >0)
										{
											for(int pv=0; pv < p_val.size(); pv++)
											{
												String value = (String)p_val.get(pv);
												StringTokenizer st_v = new StringTokenizer(value,"$");
												String computedVal = "-";
												while(st_v.hasMoreTokens())
												{
													String measure = (String)st_v.nextToken();
													StringTokenizer st_m = new StringTokenizer(measure,"#");
													dispName = (String)st_m.nextToken();
													dbName = (String)st_m.nextToken();
													String computed = (String)st_v.nextToken();
													computedVal = (String)st_v.nextToken();
												}
												if(computedVal!=null && computedVal.equals("-"))
												{
													lst_dat1.add(computedVal);
%>
		<td nowrap align="center" width="10%"><%=computedVal%></td>
<%
												}
												else
												{
													if(connectionInde)
													{
														try{
															double d = Double.parseDouble(computedVal);
															d = Math.floor(d);
															computedVal = getConnectionQulityString(d);
														}catch(Exception e){}
													}

													lst_dat1.add(computedVal);
%>
		<td nowrap align="center" width="10%"><%=computedVal%></td>
<%
												}
											}
										}
										else
										{
											lst_dat1.add("-");
%>
		<td nowrap align="center" width="10%">-</td>
<%
										}
									}
								}
							}
						}
%>
	</tr>
<%
						JSONObject processObj = null;
						if(totalColumn==-1)
						{
							totalColumn = lst_dat1.size();
						}
						processObj = processSplitUpDetails(logon_duration_splitup,intlmp,totalColumn,lst_dat1);
						if(processObj!=null)
						{
							Iterator itrs = processObj.entrySet().iterator();
							// here sub cols
%>
	<tr>
		<td colspan="<%=totalColumn%>">
			<div style="margin:5px;"> 
				<table width="100%" cellpadding="0" cellspacing="0" border="0px">
					<tbody>
						<tr>
<%
						while(itrs.hasNext())
						{
							Map.Entry entry1 = (Map.Entry)itrs.next();	
							String heading=(String)entry1.getKey();
							JSONObject subData = (JSONObject)entry1.getValue();
							if(subData != null)
							{
%>
							<td width="50%" valign="top" style="border:0px">
								<div style="margin:0px 0px 0px 0px;"><div class="printTableHeader"><%=heading%></div>
								<div>
									<table width="100%" class="printTable" cellpadding="0" cellspacing="0">
							
<%
								Iterator iter = subData.entrySet().iterator();
								while(iter.hasNext())
								{
									Map.Entry entry = (Map.Entry)iter.next();	
									String keyVal=(String)entry.getKey();
%>
										<tr><td><%=keyVal%></td><td><%=subData.get(keyVal)%></td></tr>
<%
								}
%>
									</table>
								</div>
							</td>
<%
							}
						}
%>
						</tr>
					</tbody>
				</table>
			</div>
		</td>
	</tr>
<%
						}
					}
%>
</tbody>
</table>
</div>
</div>
<%
				}

				/*sakthi-start--thin client user-disconnection detail*/
				if(disconuser!=null && disconuser.size()> 0)
				{
					String t_users=request.getParameter("er_user");
					ArrayList a_colum=new ArrayList();
					boolean userselect=false;
					if(t_users==null)
						t_users=request.getParameter("er_tuser");
					//check the give user are there.
					for(int n1=0; n1<disconuser.size();n1=n1+2)
					{
						ArrayList a_measure = (ArrayList)disconuser.get(n1+1);
						if(a_measure!=null && a_measure.size()>0)
						{
							for(int k1=0; k1<a_measure.size();k1++)
							{
								String col_val=(String)a_measure.get(k1);
								if(col_val.indexOf(colSeparator)> -1)
									a_colum= tokInfo.egTokenizer(col_val, colSeparator);
								if(a_colum.contains(t_users))
									userselect=true;
							}
						}
					}
						//
						boolean txtBoxAllusrFound=false;
						if(t_users!=null && t_users.equalsIgnoreCase("*"))
						{
								t_users="-- All --";
								txtBoxAllusrFound=true;
						}
						else if(t_users!=null && t_users.indexOf("*")>-1)
							userselect=true;
						//

					/* selected user or all users*/
					if(t_users!=null && ( userselect || t_users.equals("-- All --")))
					{
%><!-- here i have changed width=76% as 80% -->
<br/>
<div class="printOuterBox">
	<div class="newTable">
<%
						String getdescname=discontest.substring(discontest.lastIndexOf(":")+1);
						if(txtBoxAllusrFound)
						{
							s_tit = intlmp.getTextDescription("reporter.thin."+getdescname+" for User ")+" - "+t_users;
%>
		<div class="printOuterBoxHeader"><egui:intnl text='<%="reporter.thin."+getdescname+" for User " %>' /> - *</div>
<%
						}

						else if(t_users!=null && !t_users.equals("--All--"))
						{
							s_tit = intlmp.getTextDescription("reporter.thin."+getdescname+" for User ")+" - "+t_users;
%>
		<div class="printOuterBoxHeader"><egui:intnl text='<%="reporter.thin."+getdescname+" for User " %>' /> - <%=t_users%></div>
<%
						}
						else
						{
							s_tit = getdescname+" for All Users";
%>
		<div class="printOuterBoxHeader"><%=getdescname%> for All Users</div>
<%

						}
%>
	<table align="center" width="100%" cellspacing="0" cellpadding="0" border="0" class="printTable">
		<thead>
			<tr>
<%
						String col_filed="";
						int col_length=0;
						ArrayList columname=new ArrayList();
						String getcolumname=discontest.substring(discontest.indexOf(":")+1,discontest.lastIndexOf(","));
						StringTokenizer getrowmeas=new StringTokenizer(getcolumname," ");
						int noofcol=getrowmeas.countTokens();
						while(getrowmeas.hasMoreTokens() )
						{
							columname.add(getrowmeas.nextToken());
						}
						columname.add(0,"Measure Time");
						col_length= columname.size();
						for(int s=0;s< columname.size();s++)
						{
							String s_colname=(String)columname.get(s);
							vec.add(intlmp.getTextDescription("reporter.thin."+s_colname));
%>
		<th  class="printTableHeader2" align="center" nowrap width="20%"><egui:intnl text='<%="reporter.thin."+s_colname%>' /></th>
<%
						}
%>
	</tr>
	</thead>
	<tbody>
<%
						ArrayList al_cols = new ArrayList();
						for(int n=0; n<disconuser.size(); n=n+2)
						{
							String msmt_time=(String)disconuser.get(n);
							int m=n;
							String s_starttime=msmt_time.substring(0,10);
							String sthrmin=msmt_time.substring(10,19);
							String logtime=DateUtil.changeDateFormat(s_starttime,"MM/dd/yyyy",currentDateFormat)+" "+sthrmin;
							ArrayList getmeasure = (ArrayList)disconuser.get(n+1);
							boolean morecol=false;
							if(getmeasure!=null && getmeasure.size()>0)
							{
								for(int k=0; k< getmeasure.size();k++)
								{
									String col_value=(String)getmeasure.get(k);
									if(col_value.indexOf(colSeparator) > -1)
										al_cols= tokInfo.egTokenizer(col_value, colSeparator);
									String user1=(String)al_cols.get(0);
									if(t_users!=null && !t_users.equals("-- All --"))
									{
																					// for text box user find..
											if(t_users.indexOf("*")>-1)
											{
												if(t_users.startsWith("*")&&t_users.endsWith("*"))
												{
												String tStr=t_users.substring(1,t_users.length()-1);
													if(user1!=null && user1.indexOf(tStr)==-1)
													{
													continue;
													}
												}
												else if(t_users.startsWith("*"))
												{
													
													int idx=t_users.indexOf("*");
													String tStr=t_users.substring(idx+1);
													if(user1!=null && !user1.endsWith(tStr))
													{
													continue;
													}
												}
												else if(t_users.endsWith("*"))
												{
																								//
													int idx=t_users.indexOf("*");
													String tStr=t_users.substring(0,idx);
													if(user1!=null && !user1.startsWith(tStr))
													{
													continue;
													}
												}
											}
											else if(!t_users.equals(user1))
											continue;
										lst_dat.add('"'+logtime+'"');
%>
	<tr>
		<td align="center" nowrap><%=logtime%></td>
<%
									}
									else if(n==m)
									{
										lst_dat.add('"'+logtime+'"');
%>
	<tr>
		<td align="center" nowrap><%=logtime%></td>
<%
										if(getmeasure.size()>1)
										{
											if(morecol)
											{
												for(int s=1;s< columname.size();s++)
												{
													lst_dat.add(" ");
%>
		<td align="center">&nbsp;</td>
<%
												}
%>
	</tr>
<%
											}
										}
									}
									if(t_users!=null && t_users.equals("-- All --"))
									{
										if(morecol)
										{
											if(getmeasure.size()>1)
											{
													lst_dat.add('"'+logtime+'"');

%>
	<tr>
		<td align="center" nowrap><%=logtime%></td>
<%
											}
										}
									}

									for(int y=0;y<al_cols.size();y++)
									{
										String trvalue=(String)al_cols.get(y);
										lst_dat.add(trvalue); 
%>
		<td align="center" nowrap><%=trvalue%></td>
<%
									}
									m=m+1;
									morecol=true;
%>
	</tr>
<%
								}
							}
						}
%>
</tbody>
</table>
</div>
</div>
	
<%
					}
				}
				/*sakthi--end*/
			}
			else
			{
%>
<table width='100%' height='100%'>
	<tr>
		<td align='center' valign='middle'><img src='/images/Light/nomeasures_custom.png' /></td>
	</tr>
</table>

<%
		lst.add(intlmp.getTextDescription("reporter.common.No measures available for the current selection"));
			}
		}
		else
		{
			if(er_option==null)
			{
				er_option = "Zone";
			}
			if(topAppsDataForFarm!=null && topAppsDataForFarm.size() > 0)
			{
				if(er_option!=null && !er_option.equalsIgnoreCase("Component"))
				{
					s_tit = intlmp.getTextDescription("reporter.common.Summary of")+" "+intlmp.getTextDescription("reporter.common.Top Applications")+" "+intlmp.getTextDescription("reporter.common.in")+" "+s_farmserver+intlmp.getTextDescription("reporter.common.for")+" "+user;
				}
				else
				{
					s_tit = intlmp.getTextDescription("reporter.common.Summary of")+" "+intlmp.getTextDescription("reporter.common.Top Applications")+" "+intlmp.getTextDescription("reporter.common.zone for")+" "+intlmp.getTextDescription("reporter.common."+er_option)+" "+user;
				}
				vec.add(intlmp.getTextDescription("reporter.common.Application"));
				vec.add(intlmp.getTextDescription("reporter.common.% of Time"));	
%>
<!------Thin client Summary of Top Applications--------------->
<div class="printOuterBox">
<div class="newTable">
<table align="center" width="100%" cellspacing="0" cellpadding="0" border="0">
	
<%
		if(er_option!=null && !er_option.equalsIgnoreCase("Component"))
		{
%>
		<div class="printOuterBoxHeader"><egui:intnl text="reporter.common.Summay of" />&nbsp;<egui:intnl text="reporter.common.Top Applications in" />&nbsp;<%=s_farmserver%>&nbsp;<%=intlmp.getTextDescription("reporter.common."+er_option)%> - <%=user%></div>
<%
		}
		else
		{
%>
		<div class="printOuterBoxHeader"><egui:intnl text="reporter.common.Summay of" />&nbsp;<egui:intnl text="reporter.common.Top Applications in" />&nbsp;<egui:intnl text="reporter.common.Component" />&nbsp;<egui:intnl text="reporter.common.for" /> <%=user%></div>
<%
		}
%>
	
	<thead>
	<tr>
		<th align="center"><egui:intnl text="reporter.common.Application" /></th>
		<th align="center"><egui:intnl text="reporter.common.% of Time" /></th>
	</tr>
	</thead>
	<tbody>
<%
				int numTop = topAppsDataForFarm.size();
				for(int n=0; n < numTop; n++)
				{
					HashMap data = (HashMap)topAppsDataForFarm.get(n);
					String appName = (String)data.get("appName");
					String appPer = (String)data.get("appPer");
					lst_dat.add(appName);
					lst_dat.add(appPer);
%>
	<tr>
		<td align="left" width="50%"><%=appName%></td>
		<td align="center" width="50%"><%=appPer%></td>
	</tr>
<%
				}
%>
	</tbody>
</table>
</div>
<%
			}
			if(topAppsDataForServer!=null && topAppsDataForServer.size() > 0 && !topAppsDataForServer.isEmpty())
			{
				s_tit1 = intlmp.getTextDescription("reporter.common.Top")+" "+intlmp.getTextDescription("reporter.common.Applications used by")+" "+user+" "+intlmp.getTextDescription("reporter.common.for each server in")+" "+s_farmserver+intlmp.getTextDescription("reporter.common.zone"); 
				vec1.add(intlmp.getTextDescription("reporter.common.Server"));
				vec1.add(intlmp.getTextDescription("reporter.common.Application"));
				vec1.add(intlmp.getTextDescription("reporter.common.% of Time"));
%>
<br/>
<div class="newTable">
<table align="center" width="100%" cellspacing="0" cellpadding="0" border="0"">
	<tr>
		<div class="printOuterBoxHeader"><egui:intnl text="reporter.common.Top" />&nbsp;<egui:intnl text="reporter.common.Applications used by" />&nbsp;<%=user%> <egui:intnl text="reporter.common.for each server in" /> <%=s_farmserver%> <egui:intnl text="reporter.common.zone" /></div>
	</tr>
	<thead>
	<tr>
		<th align="center"><egui:intnl text="reporter.common.Server" /></th>
		<th align="center"><egui:intnl text="reporter.common.Application" /></th>
		<th align="center"><egui:intnl text="reporter.common.% of Time" /></th>
	</tr>
	</thead>
	<tbody>
	<tr width="100%">
<%
		int numTop = topAppsDataForServer.size();
		for(int n=0; n < numTop; n++)
		{
			HashMap data = (HashMap)topAppsDataForServer.get(n);
			server = (String)data.get("server");
			Vector v_data = (Vector)data.get("data");
			int appCountForServer = v_data.size();
			String rowSpan = String.valueOf(appCountForServer);
			String appName = "";
			String appPer = "";
%>
			<td align="left" width="30%" rowspan='<%=rowSpan%>' style="border-right:1px solid #cdcdcd"><%=server%></td>
<%
			lst_dat1.add(server);
			for(int v=0; v < v_data.size(); v++)
			{
				String appPercent = (String)v_data.get(v);
				StringTokenizer st_a = new StringTokenizer(appPercent,"$");
				appName = (String)st_a.nextToken();
				appPer = (String)st_a.nextToken();
				lst_dat1.add(appName);
				lst_dat1.add(appPer);
				if(v != v_data.size()-1)
				{
					lst_dat1.add(" ");
				}
				if(v==0){
			%>
					<td width="30%" style="border-right:1px solid #cdcdcd"><%=appName%></td>
					<td align="center" width="30%" style="border-right:1px solid #cdcdcd"><%=appPer%></td>

			<%
				}else{
			%>
					<tr>
						<td width="30%" style="border-right:1px solid #cdcdcd"><%=appName%></td>
						<td align="center" width="30%" style="border-right:1px solid #cdcdcd"><%=appPer%></td>
					</tr>
<%
				}
			}
		}
%>
	</tbody>
	</tr>
</table>
</div>
</div>
<%
			}
		}
		if(topAppsDataForFarm!=null && topAppsDataForFarm.size() > 0 || (topAppsDataForServer!=null && topAppsDataForServer.size() > 0 && !topAppsDataForServer.isEmpty()))
		{
		
			
			sen.put(vec,lst_dat);
			ht=new Hashtable();
			ht.put(s_tit,sen);
			lst.add(ht);
			sen = new Hashtable();
			ht = new Hashtable();
			s_tit = "";
			vec = new Vector();
			lst_dat = new LinkedList();
			if(topAppsDataForServer!=null && topAppsDataForServer.size() > 0 && !topAppsDataForServer.isEmpty())
			{

				sen1.put(vec1,lst_dat1);
				ht1=new Hashtable();
				ht1.put(s_tit1,sen1);
				lst.add(ht1);
				sen1 = new Hashtable();
				ht1 = new Hashtable();
				s_tit1 = "";
				vec1 = new Vector();
				lst_dat1 = new LinkedList();

			}
			
			session.setAttribute("ScheduleCSVData",lst);
		}
	if(!(showAllUsers))
	{
			
			sen = new Hashtable();

			sen.put(vec,lst_dat);
			
			ht=new Hashtable();
			ht.put(s_tit,sen);
			
			lst.add(ht);
			s_tit = "";
			sen1.put(vec1,lst_dat1);
			ht1=new Hashtable();
			ht1.put(s_tit1,sen1);
			lst.add(ht1);
			sen1 = new Hashtable();
			ht1 = new Hashtable();


			session.setAttribute("ScheduleCSVData",lst);
		
	}
	else
	{
		
			if(disconuser!=null && disconuser.size()> 0)
			{
				
				
				sen1.put(vec1,lst_dat1);

				ht1=new Hashtable();
				ht1.put(s_tit1,sen1);
				lst.add(ht1);
				sen1 = new Hashtable();
				ht1 = new Hashtable();
				sen.put(vec,lst_dat);
				ht=new Hashtable();
				ht.put(s_tit,sen);
				lst.add(ht);
				s_tit = "";
				
			}
			else
			{
				
				sen1.put(vec1,lst_dat1);
				ht1=new Hashtable();
				ht1.put(s_tit1,sen1);
				lst.add(ht1);
				sen1 = new Hashtable();
				ht1 = new Hashtable();
			}
			session.setAttribute("ScheduleCSVData",lst);
		}
	}
	
	else if("consolidated".equalsIgnoreCase(ercontype) && subrtype!=null && subrtype.equalsIgnoreCase("webtransaction")) //consolidated service webtranscation report
	{
		String Days = reportInfo.getExcludeWeekend("ZONE_REPORT");
%>
<div class="printOuterBoxNoBorder"> 
	<div class="printSelectionFields"><egui:intnl text="reporter.common.Consolidated Report" /> 
		 - <span class="bold"><egui:intnl text="reporter.common.WebTransaction for " />:<%=request.getParameter("er_service")%></span>
			</div>		
<%
		if(Strexcwe!=null&&Strexcwe.equalsIgnoreCase("Yes"))
		{
%>
	<div class="printSelectionFields"><egui:intnl text="reporter.common.Exclude WeekEnds" /> 
		 : <span class="bold"><%=Days%></span>
			</div>
<%
		}
%>
		<div class="printSelectionFields">Timeline - <span class="bold"><%=st_Time%>&nbsp;<egui:intnl text="reporter.common.hrs" /> to <%=en_Time%>&nbsp;<egui:intnl text="reporter.common.hrs" /></span></div>

		<div class="printSelectionFields"><egui:intnl text="reporter.common.Time Period" /> - <span class="bold"><%=timefrom+":"+minfrom%>&nbsp;<egui:intnl text="reporter.common.to" />&nbsp;<%=timeto+":"+minto%></span></div>
			</div>

<%
		Vector dvec = new Vector();
		String stimefmt = getString("Start Date",st_Time,intlmp);
		String etimefmt = getString("End Date",en_Time,intlmp);
		dvec.add('"'+stimefmt+'"');
		dvec.add('"'+etimefmt+'"');
		lst.add(dvec);
		Map ht1Mp=new HashMap();
		String tit1="";
		String tit2="";
		Map ht2Mp=new HashMap();

			lst.add('"'+intlmp.getTextDescription("reporter.common.Time period")+":"+intlmp.getTextDescription("reporter.common.From")+" "+timefrom+":"+minfrom+intlmp.getTextDescription("reporter.common.hrs")+" "+intlmp.getTextDescription("reporter.common.To")+" "+timeto+":"+minto+intlmp.getTextDescription("reporter.common.hrs")+'"');
		if(htableMinMaxAvgPer!=null && htableTargetHost!=null)
		{
			String s_service =request.getParameter("er_service");
			String s_farmserver =request.getParameter("select_report");
			if(htableMinMaxAvgPer.size()>0 && htableTargetHost.size()>0)
			{
				String skey="";
				Vector v_pdfdata=null;
				Enumeration enumTargetHosts = htableTargetHost.keys();
				int sizehtableTargetHost = htableTargetHost.size();
%>

<div class="printOuterBox">
<div class="printOuterBoxHeader"><%=s_farmserver%>&nbsp;<egui:intnl text="reporter.consolidated.Summary for Site" /> - <span class="bold"><%=s_service%></span></div>
<div class="newTable">
<table align="center" width="100%" cellspacing="0" cellpadding="0" border="0" class="printTable">
	<thead>
	<tr>
		<th class="printTableHeader2" rowspan="2" wrap><egui:intnl text="reporter.consolidated.Transaction" /></th>
		<th class="printTableHeader2" colspan="<%=alistallMeasuresDisp.size()%>" wrap align="center"><egui:intnl text="reporter.consolidated.Metrics" />(<egui:intnl text="reporter.consolidated.Avg" />)</th>
	</tr>
	<tr>
<%
	String titl=""+s_farmserver+" Summary for Site - "+s_service;
	vec1.add("Transaction");
	//vec1"
				ArrayList a_measunit = new ArrayList(); // get measures unit name and no of column separator
				for (int k=0; k<alistallMeasuresDisp.size();k++)
				{
					String unitformeasure=tablesInfo.getUnitForMeasure("WebSiteTransactionTest",alistallMeasuresDisp.get(k).toString().substring(0,alistallMeasuresDisp.get(k).toString().indexOf("(")));
					a_measunit.add(unitformeasure+"=1");
					tit1="WebSiteTransactionTest:"+(String)alistallMeasuresDisp.get(k).toString().substring(0,alistallMeasuresDisp.get(k).toString().indexOf("("));
					vec1.add((String)alistallMeasuresDisp.get(k).toString().substring(0,alistallMeasuresDisp.get(k).toString().indexOf("("))+" ("+unitformeasure+")");
%>
		<th class="subHeader" wrap align="center"><egui:intnl measure='<%="WebSiteTransactionTest:"+(String)alistallMeasuresDisp.get(k).toString().substring(0,alistallMeasuresDisp.get(k).toString().indexOf("("))%>' /></th>
<%
				}
				Vector vecTHost = new Vector();
				while(enumTargetHosts.hasMoreElements())
				{
					vecTHost.add((String)enumTargetHosts.nextElement());
				}
				Collections.sort(vecTHost);
%>
	</tr>
	<tr>
		<th class="printTableHeader2" align="center">&nbsp;</th>
<%
				for(int u=0; u < a_measunit.size(); u++)
				{
					String measureUnit=(String)a_measunit.get(u);
					StringTokenizer unitValue=new StringTokenizer(measureUnit,"=");
					int tokensCount=unitValue.countTokens();
					String measUnitDisp = unitValue.nextToken();
					String countDisp = unitValue.nextToken();
%>
		<th colspan="<%=countDisp%>" class="subHeader" nowrap align="center">(<%=measUnitDisp%>)</th>
<%
				}
%>
	</tr>
	</thead>
	<tbody>
	<!-- end -->
<%
				for (int k=0; k<sizehtableTargetHost;k++)
				{
%>
	<tr>
		<td nowrap align="left"><%=(String)vecTHost.get(k)%></td>
<%
					lst_dat1.add((String)vecTHost.get(k));
					for (int i=0;i<alistallMeasuresDisp.size();i++)
					{
						Vector v_info = (Vector) htableSummaryAvgDisp.get((String)vecTHost.get(k));
						Hashtable hs = (Hashtable)v_info.get(i);
						lst_dat1.add((String)hs.get("AVG"));
%>
		<td wrap align="center" ><%=(String)hs.get("AVG")%></td>
<%
					}
%>
	</tr>
<%
				}
%>
</tbody>
</table>


<div class="clearDiv">&nbsp;</div>
<%
			ht.put(vec1,lst_dat1);
			
				if (s_farmserver!=null)
				{
%>
		<div class="printOuterBoxHeader"><egui:intnl text="reporter.consolidated.Consolidated report" /> - <%=s_farmserver%>:<%=s_service%></div>
<%
			tit2="Consolidated report - "+s_farmserver+" : "+s_service;
				}
%>
<table align="center" width="100%" cellspacing="0" cellpadding="0" border="0" class="printTable">
	<thead>
	<tr>
		<th rowspan="3" class="printTableHeader2" align="left"><egui:intnl text="reporter.consolidated.Transactions" /></th>
		<th rowspan="3" class="printTableHeader2" align="left"><egui:intnl text="reporter.consolidated.Servers" /></th>
<%
				a_measunit = new ArrayList();
vec2.add("Transactions");
vec2.add("Servers");
				for (int i=0;i<alistallMeasuresDisp.size();i++)
				{
					String unitformeasure=tablesInfo.getUnitForMeasure("WebSiteTransactionTest",alistallMeasuresDisp.get(i).toString().substring(0,alistallMeasuresDisp.get(i).toString().indexOf("(")));
					a_measunit.add(unitformeasure+"=2");
vec2.add((String)alistallMeasuresDisp.get(i).toString().substring(0,alistallMeasuresDisp.get(i).toString().indexOf("("))+" ("+unitformeasure+") (Max)");
vec2.add((String)alistallMeasuresDisp.get(i).toString().substring(0,alistallMeasuresDisp.get(i).toString().indexOf("("))+" ("+unitformeasure+") (Avg)");
%>
		<th colspan="2" class="printTableHeader2" align="center"><egui:intnl measure='<%="WebSiteTransactionTest:"+(String)alistallMeasuresDisp.get(i).toString().substring(0,alistallMeasuresDisp.get(i).toString().indexOf("("))%>' /></th>
<%
				}
%>
	</tr>
		<!-- separate measures from unit.add separate row start-->
	<tr>
<%
				for(int u=0; u < a_measunit.size(); u++)
				{
					String measureUnit=(String)a_measunit.get(u);
					StringTokenizer unitValue=new StringTokenizer(measureUnit,"=");
					int tokensCount=unitValue.countTokens();
					String measUnitDisp = unitValue.nextToken();
					String countDisp = unitValue.nextToken();
%>
		<th colspan="<%=countDisp%>" class="subHeader" nowrap align="center">(<%=measUnitDisp%>)</th>
<%
				}
%>
	</tr>
	
	<tr>
<%
				for (int i=0;i<alistallMeasuresDisp.size();i++)
				{
%>
		<th align="center" class="subHeader"><egui:intnl text="reporter.common.Max" /></th>
		<th align="center" class="subHeader"><egui:intnl text="reporter.common.Avg" /></th>
<%
				}
%>
	</tr>
	</thead>
	<tbody>
<%
				Enumeration enumTargetHost = htableTargetHost.keys();
				Vector infoVec = new Vector();
				while (enumTargetHost.hasMoreElements())
				{
					infoVec.add((String)enumTargetHost.nextElement());
				}
				Collections.sort(infoVec);
				int flag = 0;
				enumTargetHost = htableTargetHost.keys();
				while (enumTargetHost.hasMoreElements())
				{
					enumTargetHost.nextElement();
					String info = null;
					if (flag < htableTargetHost.size())
						info = (String)infoVec.get(flag);
					flag++;
					ArrayList alistTargetHost =  (ArrayList)htableTargetHost.get(info);
					Collections.sort(alistTargetHost);
					int rowspan = alistTargetHost.size();
%>
	<tr> <!-- problem 4 -->
		<td rowspan="<%=rowspan%>" align="left"><%=info%></td>
<%
					lst_dat2.add(info);
					for (int r=0;r<rowspan;r++)
					{
						String targetHostString = (String)alistTargetHost.get(r);
						String keyMinMaxAvg = info + ":" + targetHostString;
						Vector minMaxAvg = (Vector)htableMinMaxAvgPer.get(keyMinMaxAvg);
						if (r>0)
						{
%>
	
	<tr> <!-- problem 5 -->
<%
						}
						String trgtHostName = (String)alistTargetHost.get(r);
						lst_dat2.add(trgtHostName);
%>
		<td align="left"><%=trgtHostName%></td>
<%
						for (int k=0;k<minMaxAvg.size();k++)
						{
							Hashtable valueHash = (Hashtable)minMaxAvg.get(k);
							int valueSize = valueHash.size();
							String finalMeasure = null;
							for (int m=1;m<=valueSize-1;m++)
							{
								if(m == 1)
								{
									finalMeasure = (String)valueHash.get("MAX");
								}
								else if(m == 2)
								{
									finalMeasure = (String)valueHash.get("AVG");
								}
								lst_dat2.add(finalMeasure);
%>
		<td align="center"><%=finalMeasure%></td>
<%
							}
						}
%>
	</tr>
<%
					}
				}
			Hashtable ht1Map=new Hashtable();
			ht1Map.put(vec2,lst_dat2);
			ht1.put(tit2,ht1Map);			
			ht1.put(tit1,ht);
			lst.add(ht1);				
%>
</tbody>
</table>
</div>
</div>
<%
			}
		}
		session.setAttribute("ScheduleCSVData",lst);
	} //consolidated zone and service health report
//	else if(rtype.equals("Citrix") && subtype.equals("Farm Report") || erservice!=null && subtype.equals("Consolidated Report") && erservice.equalsIgnoreCase("Service Health") && subrtype !=null && !subrtype.equalsIgnoreCase("webtransaction"))
	else if(rtype.equals("Citrix") && subtype.equals("Farm Report") || erservice!=null && subtype.equals("Consolidated Report") && erservice.equalsIgnoreCase("Service Health"))
	{
		String Days = reportInfo.getExcludeWeekend("ZONE_REPORT");
%>

			<!-- <div style="float:left;padding:4px;">
				<div style="float:left;" class="formValue"> -->
				<div class="printOuterBoxNoBorder">
					<div class="printSelectionFields" >
<%
		Farmserver = request.getParameter("select_farm");
		if(subtype!=null && subtype.equals("Consolidated Report") || erservice!=null && !erservice.equalsIgnoreCase("Service Health")&& !subtype.equals("Farm Report"))
		{
						lst.add(intlmp.getTextDescription("reporter.common.Consolidated Report for Services") );

%>
						<egui:intnl text="reporter.consolidated.Consolidated Report for Services" />
<%
		}
		else
		{
								lst.add(intlmp.getTextDescription("reporter.common.Thin Client Zone Report for")+" "+Farmserver );

%>
						&nbsp;<%=thinzone%> <egui:intnl text="reporter.common.Zone Report for" /> - <span class="bold"> <%=Farmserver%>
<%
		}
%>				
				</span>
				</div>
			
<%
if(Strexcwe!=null&&Strexcwe.equalsIgnoreCase("Yes"))
		{
%>
			<!-- <div style="clear:both;float:left;padding:4px;">
				<div style="float:left" class="formLabel"><egui:intnl text="reporter.common.Exclude WeekEnds" /></div>
				<div style="float:left;width:10px" align="center" >:</div>
				<div style="float:left;" class="formValue"><%=Days%></div>
			</div> -->
			<div class="printSelectionFields">
				<egui:intnl text="reporter.common.Exclude WeekEnds" />&nbsp;-&nbsp; 
				<span class="bold"><%=Days%></span>
			</div>
<%
		}
%>
			<div class="printSelectionFields">
				<egui:intnl text="reporter.common.Timeline" />&nbsp;-&nbsp; 
				<span class="bold"><%=st_Time%>&nbsp;to&nbsp;<%=en_Time%></span>
			</div>
			<div class="printSelectionFields">
				<egui:intnl text="reporter.common.Time Period" />&nbsp;-&nbsp; 
				<span class="bold"><%=timefrom+":"+minfrom%>&nbsp;<egui:intnl text="reporter.common.to" /> &nbsp;<%=timeto+":"+minto%></span>
			</div>
		</div>


<div class="printOuterBox">
<div class="newTable">
<%
	Vector dvec = new Vector();
	String stimefmt = getString("Start Date",st_Time,intlmp);
	String etimefmt = getString("End Date",en_Time,intlmp);
	dvec.add('"'+stimefmt+'"');
	dvec.add('"'+etimefmt+'"');
	lst.add(dvec);
	lst.add('"'+intlmp.getTextDescription("reporter.common.Time period")+":"+intlmp.getTextDescription("reporter.common.From")+" "+timefrom+":"+minfrom+intlmp.getTextDescription("reporter.common.hrs")+" "+intlmp.getTextDescription("reporter.common.To")+" "+timeto+":"+minto+intlmp.getTextDescription("reporter.common.hrs")+'"');


		String show =request.getParameter("show");
		if(show!=null && show.equalsIgnoreCase("yes"))
		{
			if("consolidated".equalsIgnoreCase(ercontype) && erservice!=null && erservice.equalsIgnoreCase("Service Health"))
			{
				ArrayList a_measunits =null; new ArrayList();
				if(htableMinMaxAvgPer!=null && htableTargetHost!=null)
				{
					String s_service =request.getParameter("er_service");
					String s_farmserver =request.getParameter("select_report");
					if(htableMinMaxAvgPer.size()>0 && htableTargetHost.size()>0)
					{
						String skey="";
						Vector v_pdfdata=null;
						Enumeration enumTargetHosts = htableTargetHost.keys();
						int sizehtableTargetHost = htableTargetHost.size();
%>
<div class="printOuterBoxHeader" ><egui:intnl text="reporter.consolidated.WebTransactions Summary for Site" /> - <%=s_service%></div>
<table align="center" width="100%" cellspacing="0" cellpadding="0" class="printTable" border="0">
	<thead>
	<tr>
		<th class="printTableHeader2" rowspan="2" wrap align="left"><egui:intnl text="reporter.consolidated.Transaction" /></th> 
		<th class="printTableHeader2" colspan="<%=alistallMeasuresDisp.size()%>" wrap align="center"><egui:intnl text="reporter.consolidated.Metrics" />(<egui:intnl text="reporter.consolidated.Avg" />)</th>
	</tr>
	<tr>
<%
						a_measunits = new ArrayList();
						for (int k=0; k<alistallMeasuresDisp.size();k++)
						{
							String unitformeasure=tablesInfo.getUnitForMeasure("WebSiteTransactionTest",alistallMeasuresDisp.get(k).toString().substring(0,alistallMeasuresDisp.get(k).toString().indexOf("(")));
							a_measunits.add(unitformeasure+"=1");
%>
		<th wrap align="center" class="subHeader"><egui:intnl measure='<%="WebSiteTransactionTest:"+alistallMeasuresDisp.get(k).toString().substring(0,alistallMeasuresDisp.get(k).toString().indexOf("("))%>' /></th>
<%
						}
						Vector vecTHost = new Vector();
						while(enumTargetHosts.hasMoreElements())
						{
							vecTHost.add((String)enumTargetHosts.nextElement());
						}
						Collections.sort(vecTHost);
%>
	</tr>
				<!-- summary - separate measures from unit.add separate row start-->
	<tr>
		<th align="center" class="subHeader">&nbsp;</th>
<%
						for(int u=0; u < a_measunits.size(); u++)
						{
							String measureUnit=(String)a_measunits.get(u);
							StringTokenizer unitValue=new StringTokenizer(measureUnit,"=");
							int tokensCount=unitValue.countTokens();
							String measUnitDisp = unitValue.nextToken();
							String countDisp = unitValue.nextToken();
%>
		<th colspan="<%=countDisp%>" class="subHeader" nowrap align="center">(<%=measUnitDisp%>)</th>
<%
						}
%>
	</tr>
	</thead>
	<tbody>
	<!-- end -->
<%
						for (int k=0; k<sizehtableTargetHost;k++)
						{
%>
	<tr>
		<td nowrap align="Left" class="subHeader"><%=(String)vecTHost.get(k)%></td>
<%
							for (int i=0;i<alistallMeasuresDisp.size();i++)
							{
								Vector v_info = (Vector) htableSummaryAvgDisp.get((String)vecTHost.get(k));
								Hashtable hs = (Hashtable)v_info.get(i);
%>
		<td wrap align="left"><%=(String)hs.get("AVG")%></td>
<%
							}
%>
	</tr>
<%
						}
%>
</tbody></table>
<div class = "clearDiv">&nbsp;</div>
<%
						if (s_farmserver!=null)
						{
%>
		<div class="printOuterBoxHeader" ><egui:intnl text="reporter.consolidated.Consolidated report" /> - <egui:intnl text="reporter.consolidated.WebTransactions" />:<%=s_service%></div>
<%
						}
%>
<table align="center" width="100%" cellspacing="0" cellpadding="0" class="printTable" border="0">

	<thead><tr>
		<th rowspan="3" class="printTableHeader2" align="center"><egui:intnl text="reporter.consolidated.Transactions" /></th>
		<th rowspan="3" class="printTableHeader2" align="center"><egui:intnl text="reporter.consolidated.Servers" /></th>
<%
						a_measunits = new ArrayList();
						for (int i=0;i<alistallMeasuresDisp.size();i++)
						{
							String unitformeasure=tablesInfo.getUnitForMeasure("WebSiteTransactionTest",alistallMeasuresDisp.get(i).toString().substring(0,alistallMeasuresDisp.get(i).toString().indexOf("(")));
							a_measunits.add(unitformeasure+"=2");
%>
		<th colspan="2" class="printTableHeader2" align="center"><egui:intnl measure='<%="WebSiteTransactionTest:"+alistallMeasuresDisp.get(i).toString().substring(0,alistallMeasuresDisp.get(i).toString().indexOf("("))%>' /></th>
<%
						}
%>
	</tr>
					<!-- separate measures from unit.add separate row start-->
	<tr>
<%
						for(int u=0; u < a_measunits.size(); u++)
						{
							String measureUnit=(String)a_measunits.get(u);
							StringTokenizer unitValue=new StringTokenizer(measureUnit,"=");
							int tokensCount=unitValue.countTokens();
							String measUnitDisp = unitValue.nextToken();
							String countDisp = unitValue.nextToken();
%>
		<th colspan="<%=countDisp%>" class="subHeader" nowrap align="center">(<%=measUnitDisp%>)</th>
<%
						}
%>
	</tr>
					<!-- end -->
	<tr>
<%
						for (int i=0;i<alistallMeasuresDisp.size();i++)
						{
%>
		<th align="center" class="subHeader"><egui:intnl text="reporter.common.Max" /></th>
		<th align="center" class="subHeader"><egui:intnl text="reporter.common.Avg" /></th>
<%
						}
%>
	</thead>
	<tbody>
	</tr>
<%
						Enumeration enumTargetHost = htableTargetHost.keys();
						Vector infoVec = new Vector();
						while (enumTargetHost.hasMoreElements())
						{
							infoVec.add((String)enumTargetHost.nextElement());
						}
						Collections.sort(infoVec);
						int flag = 0;
						enumTargetHost = htableTargetHost.keys();
						while (enumTargetHost.hasMoreElements())
						{
							enumTargetHost.nextElement();
							String info = null;
							if (flag < htableTargetHost.size())
								info = (String)infoVec.get(flag);
							flag++;
							ArrayList alistTargetHost =  (ArrayList)htableTargetHost.get(info);
							Collections.sort(alistTargetHost);
							int rowspan = alistTargetHost.size();
%>
	<tr>
		<td rowspan="<%=rowspan%>" align="center"><%=info%></td>
<%
							for (int r=0;r<rowspan;r++)
							{
								String targetHostString = (String)alistTargetHost.get(r);
								String keyMinMaxAvg = info + ":" + targetHostString;
								Vector minMaxAvg = (Vector)htableMinMaxAvgPer.get(keyMinMaxAvg);
								if (r>0)
								{
%>
	<!-- here doubts-->
	<tr> <!-- problem 10 -->
<%
								}
								String trgtHostName = (String)alistTargetHost.get(r);
%>
		<td align="center"><%=trgtHostName%></td>
<%
								for (int k=0;k<minMaxAvg.size();k++)
								{
									Hashtable valueHash = (Hashtable)minMaxAvg.get(k);
									int valueSize = valueHash.size();
									String finalMeasure = null;
									for (int m=1;m<=valueSize-1;m++)
									{
										if(m == 1)
										{
											finalMeasure = (String)valueHash.get("MAX");
										}
										else if(m == 2)
										{
											finalMeasure = (String)valueHash.get("AVG");
										}
%>
		<td align="center"><%=finalMeasure%></td>
<%
									}
								}
%>
	</tr>
<%
							}
						}
%>
</tbody></table>
<div class = "clearDiv">&nbsp;</div>
			
<%
					}
				}
			}
		}
		if("consolidated".equalsIgnoreCase(ercontype) && erservice!=null && erservice.equalsIgnoreCase("Service Health")|| subtype!=null && subtype.equals("Farm Report") )
		{
			ArrayList sublist1=null;
			Vector v_in = new Vector();
			Vector v_pdfdata=null;//CSV
			TreeMap pdfData=new TreeMap();

			Hashtable ht_avg=(Hashtable)session.getAttribute("Average");
			if(ht_avg == null)
			{
				ht_avg=(Hashtable)request.getAttribute("Average");
			}
			ArrayList sublist=(ArrayList)reportInfo.getVariables("ZONE_REPORT");
			if(erservice!=null && erservice.equalsIgnoreCase("Service Health"))
			{
				sublist1=(ArrayList)reportInfo.getVariables("SERVICES_REPORT");
				sublist.addAll(sublist1);
			}
			String totalcols=request.getParameter("totalcols");
			if (totalcols==null)
				totalcols="20";
			if(Rep_data1!=null)
			{
				if(Rep_data1.size()>0)
				{
					String skey="";
					Iterator itr = (new TreeMap(Rep_data1)).keySet().iterator();
					while (itr.hasNext())
					{
						skey = (String)itr.next();
						String variable1;
						String value1;
						StringTokenizer tok1;
						String type="";
						totalcols=(getColspanCount(sublist,"ZONE_REPORT",skey)+2)+"";
%>
	<!-- <table align="center" width="100%" cellspacing="0" cellpadding="0" class="printTable" border="0">
	<tr> -->
<%
						if(request.getParameter("select_farm").equalsIgnoreCase("Consolidated Report"))
						{
%>
		<div class="printOuterBoxHeader" ><egui:intnl text="reporter.consolidated.Service report" /> - <egui:intnl text='<%=request.getParameter("er_service")%>'/> : <egui:intnl type="<%=skey%>"/></div>
<%
						}
						else
						{
							s_tit1 = intlmp.getTextDescription("reporter.common.Zone report")+" - ";
%>
		<div class="printOuterBoxHeader"  ><egui:intnl text="reporter.consolidated.Zone report" />&nbsp;-&nbsp;<% String strfarm=request.getParameter("select_farm");
							if(strfarm.trim().equalsIgnoreCase("Default"))
							{
%> 
		<egui:intnl text='<%="reporter.common."+strfarm%>' /> : <egui:intnl type="<%=skey%>" /></div>
<%
								s_tit1+=intlmp.getTextDescription("reporter.common."+strfarm)+" : "+intlmp.getComponentTypeDescription(skey);
							}
							else
							{
								s_tit1+=intlmp.getTextDescription("reporter.common."+strfarm)+" : "+ intlmp.getComponentTypeDescription(skey);
%>
		<%=strfarm%> : <egui:intnl type="<%=skey%>" /></div>
<%
							}
						}
						vec2.add(s_tit1);
%>
	
<!-- this one is put for last space-->
				<!-- </table>

				<div class="newTable"><table align="center" width="97%" cellspacing="0" cellpadding="0" id="tableborder"> -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
	<thead> 
	<tr>
		<th align="center"><egui:intnl text="reporter.common.Server" /></th>
<%//newTable
					vec1.add(intlmp.getTextDescription("reporter.common.Server"));
						String s_var = "";
						Vector v_val = new Vector();
						ArrayList a_measunit = new ArrayList(); // get measures unit name and no of column separator
						TreeMap testMeasureMap= new TreeMap(); // get test:measure  unit value like avg,max
						int count=0;
						for(int m=0;m<sublist.size();m++)
						{
							s_var = (String)sublist.get(m);
							String unitmeasure="";
							tok1 = new StringTokenizer(s_var,":");
							String displayname="";
							String test="";
							String displayMeas="";
							String mes="";
							while(tok1.hasMoreTokens())
							{
								type=tok1.nextToken();
								test=tok1.nextToken();
								String val2=tok1.nextToken();
								StringTokenizer meas=new StringTokenizer(val2,"#");
								if(meas.hasMoreTokens() )
									mes=meas.nextToken();
								else
									mes=val2;
								if(meas.hasMoreTokens() )
									displayname=meas.nextToken();
								else
									displayname=val2;
							}
							if (!specsInfo.isTestRelevantForServer(skey,test))
							{
								continue;
							}

							String st_value=reportInfo.getValue("ZONE_REPORT",s_var);
							if(st_value.equalsIgnoreCase(""))
							{
								st_value=reportInfo.getValue("SERVICES_REPORT",s_var);
							}
							if (st_value!=null && st_value.equals(""))
							{
								st_value="Avg";
							}
							if(displayname.indexOf("(")>-1)
							{
								displayMeas=displayname.substring(0,displayname.indexOf("("));
							}
							else
								displayMeas=displayname;

							unitmeasure=tablesInfo.getUnitForMeasure(test,mes);
							StringTokenizer stvals=new StringTokenizer(st_value,",");
							int counttokens=stvals.countTokens();

							if (skey.equals(type) || type.equalsIgnoreCase("Default"))
							{
								v_val.add(st_value);
								if(st_value.indexOf("Avg")>-1 && st_value.indexOf("Pct")>-1 && st_value.indexOf("Max") >-1)
								{
									a_measunit.add(unitmeasure+"="+counttokens);
									testMeasureMap.put(test+":"+displayname,st_value);
%>
		<th colspan="<%=counttokens %>wrap align="center"><egui:intnl measure='<%=test+":"+displayMeas%>' /></th>
<%
								}
								else if((st_value.indexOf("Avg")>-1 && st_value.indexOf("Pct")>-1) || (st_value.indexOf("Avg")>-1 && st_value.indexOf("Max")>-1) || (st_value.indexOf("Max")>-1 && st_value.indexOf("Pct")>-1) )
								{
									a_measunit.add(unitmeasure+"="+counttokens);
									testMeasureMap.put(test+":"+displayname,st_value);
									StringTokenizer s_value=new StringTokenizer(st_value,",");
									String s_value1 = s_value.nextToken();
									String s_value2 = s_value.nextToken();
									String measureUnit=(String)a_measunit.get(count);
									StringTokenizer unitValue=new StringTokenizer(measureUnit,"=");
									String measUnitDisp = unitValue.nextToken();
									String measUnitDisp1 = unitValue.nextToken();
									vec1.add(intlmap.getTextDescription("reporter.consolidated."+displayMeas)+"("+measUnitDisp+")"+"-"+"("+intlmap.getTextDescription("reporter.common."+s_value1)+")");
									vec1.add(intlmap.getTextDescription("reporter.consolidated."+displayMeas)+"("+measUnitDisp+")"+"-"+"("+intlmap.getTextDescription("reporter.common."+s_value2)+")");
%>
		<th colspan="<%=counttokens %>"  wrap align="center"><egui:intnl measure='<%=test+":"+displayMeas%>' /></th>
<%
								}
								else
								{
									a_measunit.add(unitmeasure+"="+counttokens);
									testMeasureMap.put(test+":"+displayname,st_value);
									String measureUnit=(String)a_measunit.get(count);
									StringTokenizer unitValue=new StringTokenizer(measureUnit,"=");
									String measUnitDisp = unitValue.nextToken();
									String measUnitDisp1 = unitValue.nextToken();
									vec1.add(intlmap.getTextDescription("reporter.consolidated."+displayMeas)+"("+measUnitDisp+")"+"-"+"("+intlmap.getTextDescription("reporter.common."+st_value)+")");
%>
		<th colspan="<%=counttokens%>"  wrap align="center"><egui:intnl measure='<%=test+":"+displayMeas%>' /></th>
<%
								}
						count++;
							}
						}
						a_measunit.add("%=1");
						//by vensar
						vec1.add(intlmap.getTextDescription("reporter.common.Health"));
%>
		<th align="center"><egui:intnl text="reporter.common.Health" /></th>
	</tr>
		<!-- separate measures from unit.add separate row start-->
	<tr>
		<th class="subHeader" align="center">&nbsp;</th>
<%
						for(int u=0; u < a_measunit.size(); u++)
						{
							String measureUnit=(String)a_measunit.get(u);
							StringTokenizer unitValue=new StringTokenizer(measureUnit,"=");
							int tokensCount=unitValue.countTokens();
							String measUnitDisp = unitValue.nextToken();
							String countDisp = unitValue.nextToken();
%>
		<th colspan="<%=countDisp%>" nowrap align="center" class="subHeader">(<%=measUnitDisp%>)</th>
<%
						}
%>
	</tr>
		<!-- end -->
	<tr>
		<th class="subHeader" align="center"></th>
<%
						for(int v=0;v<v_val.size();v++)
						{
							String v_value = (String)v_val.get(v);
							if (v_value.equals(""))
							{
								v_value="Avg";
							}
							StringTokenizer st_val=new StringTokenizer(v_value,",");
							while (st_val.hasMoreTokens())
							{
%>
		<th align="center" class="subHeader"><egui:intnl text='<%="reporter.common."+st_val.nextToken() %>' /></th>
<%
							}
						}
%>
		<th class="subHeader" id="er_submit" align="center"></th>
	</tr>
	</thead>
	<!-- add component wise measures values-->	 
	<tbody>
	<tr>
<%
						//start-if summary there add component summary.
						if(avg_data!=null && !avg_data.isEmpty())
						{
							Vector temptable=null;
							String DisplayMeasure="";
							String avgmax="";
							String mes="";
							String measureValue="";
							StringTokenizer token_agmx=null;
							Float sum_avg=null;
							String compType="";
							String testName="";
							int S=0;
							temptable=(Vector)avg_data.get(skey);
							if(temptable!=null && !temptable.isEmpty())
							{
%>
		<td wrap width="10%" height="20" align="left"><egui:intnl text="reporter.common.Summary" /></td>
<%
								lst_dat1.add(intlmp.getTextDescription("reporter.common.Summary"));
								for(int m=0;m<sublist.size();m++)
								{
									String meas_name = (String)sublist.get(m);
									tok1 = new StringTokenizer(meas_name,":");
									while(tok1.hasMoreTokens())
									{
										compType=tok1.nextToken();
										testName=tok1.nextToken();
										String measureName=tok1.nextToken();

										StringTokenizer s_measure=new StringTokenizer(measureName,"#");
										if(s_measure.hasMoreTokens())
											mes=s_measure.nextToken();
										else
											mes=measureName;

										if(s_measure.hasMoreTokens() )
											DisplayMeasure=s_measure.nextToken();
										else
											DisplayMeasure=measureName;
									}
									if(!specsInfo.isTestRelevantForServer(skey,testName))
									{
										continue;
									}
									if(skey.equals(compType) || compType.equalsIgnoreCase("Default"))
									{
										avgmax=(String)testMeasureMap.get(testName+":"+DisplayMeasure);
										if(avgmax==null || avgmax.equals(""))
										{
											continue;
										}

										token_agmx=new StringTokenizer(avgmax,",");
										while(token_agmx.hasMoreTokens())
										{
											String tokenvalue=token_agmx.nextToken();
											if(tokenvalue.equals("Avg"))
											{
												sum_avg=(Float)temptable.get(S);
												S++;
												if(sum_avg==null || sum_avg.floatValue()==-5.0 || sum_avg.floatValue()==-1.0)
												{
%>
		<td align="center">-</td>
<%
									lst_dat1.add("-");
												}else
												{
													lst_dat1.add(dbInfo.formatValue(sum_avg.toString()));
%>
		<td align="center"><%=dbInfo.formatValue(sum_avg.toString())%></td>
<%
												}
											}else
											{
												lst_dat1.add("-");
												sum_avg=(Float)temptable.get(S);
												S++;
%>
		<td align="center">-</td>
<%
											}
										}
									}
								}

								sum_avg=(Float)temptable.get(temptable.size()-1);
								if(sum_avg!=null && sum_avg.floatValue()!=-5.0 && sum_avg.floatValue()!=-1.0)
								{
%>
		<td align="center"><%=dbInfo.formatValue(sum_avg.toString())%></td>
<%
									lst_dat1.add(dbInfo.formatValue(sum_avg.toString()));
								}
								else
								{
%>
		<td align="center">&nbsp;-&nbsp;</td>
<%
									lst_dat1.add("-");
								}
							}
						}//end
%>
	</tr>
<%
						String s_qryString1="";
						Vector v_data=(Vector)Rep_data1.get(skey);

						
						Collections.sort(v_data,new ErSort());
						if (v_data.size()>0)
						{
							for (int k=0; k<v_data.size();k++)
							{
								Vector data=(Vector)v_data.get(k);
%>
	<tr>
<%
								String srvr="";
								for(int i=0;i<data.size();i++)
								{
									String strdata=data.get(i).toString();
									if (strdata.equals("-5.0")|| strdata.equals("-1.0")||strdata.equals("-"))
										strdata="-";
									if(strdata.indexOf(":")>0)
									{
										String s_comp = strdata.substring(0,strdata.lastIndexOf(":"));
										String s_port = strdata.substring(strdata.indexOf(":")+1);
										if(s_port!=null && s_port.startsWith("NULL"))
											s_comp = strdata.substring(0,strdata.indexOf(":"));
%>
		<td align="left"><%=s_comp%></td>
<%
										lst_dat1.add(s_comp);
									}
									else
									{
%>
		<td align="center"><%=dbInfo.formatValue(strdata.toString())%></td>
<%
 									lst_dat1.add(dbInfo.formatValue(strdata));
									}
								}
%>			
	</tr> 
<%
							}
						lst_dat2.add(lst_dat1);
						lst_dat1 = new LinkedList();
						}
					pdfData.put(skey,v_pdfdata);
					vec3.add(vec1);
					vec1 = new Vector();
%>
	</tbody></table>
					
<%
					}
				}
			}
		}
%>
</div>
</div>
<%
		for(int i=0;i<vec2.size();i++)
		{
			sen1.put(vec3.get(i),lst_dat2.get(i));
			s_tit1 = (String)vec2.get(i);
			ht1=new Hashtable();
			ht1.put(s_tit1,sen1);
			lst.add(ht1);
			sen1 = new Hashtable();
			ht1 = new Hashtable();
		}
		session.setAttribute("ScheduleCSVData",lst);
	}
			//THINCLIENT APPLICATION REPORT
	else if(rtype.equals("Citrix") && subtype.equals("Application Report"))
	{
		String Days = reportInfo.getExcludeWeekend("APPLICATION_REPORT");
%>
<div class="printOuterBoxNoBorder">
<!-- <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" style="border-bottom:1px solid #ccc;">
	<tr>
		<td align="left" valign="top" width="50%"> -->
			
		

<%		String s_server1 = request.getParameter("er_server"); 
		String s_application1 = request.getParameter("er_application");
		String s_perserver=request.getParameter("er_perserver");
		String s_farmserver1 = request.getParameter("select_farm");
		if(s_farmserver1!=null && !s_farmserver1.equals("-1"))
		{
					s_tit = intlmap.getTextDescription("reporter.application.Top Application Report for")+" "+headerKeyName;
%>
						<div class="printSelectionFields">
							<egui:intnl text="reporter.common.Top Application Report for "/>&nbsp;
							<span class="bold"><%=headerKeyName%></span>
						</div>
						<!-- <div style="float:left" class="formLabel"><egui:intnl text="reporter.common.Application Activity Report for "/></div><div style="float:left;" class="formValue">&nbsp;<%=headerKeyName%></div>-->
<% 
		}
		else
		{
%>
						<div class="printSelectionFields">
							<egui:intnl text="reporter.common.Top Application Report" />
						</div>
						<!-- <div style="float:left;" class="formValue"><egui:intnl text="reporter.common.Application Activity Report" /></div> -->
<%
		}
%>
			
<%
		if(Strexcwe!=null&&Strexcwe.equalsIgnoreCase("Yes"))
		{
%>
			<div class="printSelectionFields">
				<egui:intnl text="reporter.common.Exclude WeekEnds" /> - 
				<span class="bold"><%=Days%></span>
			</div>
			<!-- <div style="clear:both;float:left;padding:4px;">
				<div style="float:left" class="formLabel"><egui:intnl text="reporter.common.Exclude WeekEnds" /></div>
				<div style="float:left;width:10px" align="center" >:</div>
				<div style="float:left;" class="formValue"><%=Days%></div>
			</div> -->
<%
		}
%>
		<div class="printSelectionFields">
			<egui:intnl text="reporter.common.Timeline" /> - 
			<span class="bold"><%=st_Time%>&nbsp;<egui:intnl text="reporter.common.to" /> &nbsp; <%=en_Time%></span>
		</div>
		<div class="printSelectionFields">
			<egui:intnl text="reporter.common.Time Period" /> - 
			<span class="bold"><%=timefrom+":"+minfrom%>&nbsp;<egui:intnl text="reporter.common.to" /> &nbsp;<%=timeto+":"+minto%></span>
		</div>

</div>
<br/>
<%
	Vector dvec = new Vector();
	String stimefmt = getString("Start Date",st_Time,intlmp);
	String etimefmt = getString("End Date",en_Time,intlmp);
	dvec.add('"'+stimefmt+'"');
	dvec.add('"'+etimefmt+'"');
	lst.add(s_tit);
	lst.add(dvec);

		lst.add('"'+intlmp.getTextDescription("reporter.common.Time period")+":"+intlmp.getTextDescription("reporter.common.From")+" "+timefrom+":"+minfrom+intlmp.getTextDescription("reporter.common.hrs")+" "+intlmp.getTextDescription("reporter.common.To")+" "+timeto+":"+minto+intlmp.getTextDescription("reporter.common.hrs")+'"');

		if(apptop == null || apptop.isEmpty() || apptop.size()==0)
		{
			if(Application_data!=null && Application_data.size() > 0)
			{
	
				Vector value2=new Vector();
				int columnCount=0;//used to find the column count for header colspan
				if (!Application_data.isEmpty())
				{
					Enumeration enum1 = Application_data.keys();
					while(enum1.hasMoreElements())
					{
						String key1 = (String)enum1.nextElement();
						value2=(Vector)Application_data.get(key1);
						columnCount=((Vector)value2.get(0)).size();
						String s_server=request.getParameter("er_server");
						String s_farmserver=request.getParameter("select_farm");
						String s_application=request.getParameter("er_application");
%>
<div class="printOuterBox">

<%
		if ((s_server==null  || s_server.equals("-1") || aListAlltype.contains(s_server) || s_server.equals("")) &&  s_farmserver!=null && !s_farmserver.equals(""))
		{
%>
			<div class="printOuterBoxHeader"><egui:intnl text="reporter.common.Top Application Report for" /> - <egui:intnl type="<%=key1%>" /></div>
				<div class="newTable">
					<table cellspacing="0" border="0" cellpadding="0" width="100%" >
						<thead>
							<tr>
<%
							if(s_perserver!=null && s_perserver.equals("No"))
							{
%>
								<th align="center" nowrap><egui:intnl text="reporter.common.Server" /> / <egui:intnl text="reporter.common.Application" /></th>
<%
							}
							else
							{
%>
								<th align="center" nowrap><egui:intnl text="reporter.common.Application" /></th>
<%
							}
		}
		else if ((s_server!=null || !s_server.equals("-1") || !s_server.equals("")) )
		{
			 s_tit1=intlmap.getTextDescription("reporter.common.Top Application Report for Server")+" - ";
%>
			<div class="printOuterBoxHeader"><egui:intnl text="reporter.common.Top Application Report for Server" /> - 
<%
			if(s_server.indexOf(":")>-1)
			{

				s_tit1+=intlmap.getComponentTypeDescription(request.getParameter("er_compType"));
%> 
				<%=intlmap.getComponentTypeDescription(request.getParameter("er_compType"))%></div>

<%
			}
			else
			{
				s_tit1+=intlmap.getComponentTypeDescription(request.getParameter("er_compType"));
%>
				<%=intlmap.getComponentTypeDescription(request.getParameter("er_compType"))%></div>
<%
			}
%>
			<div class="newTable">
				<table cellspacing="0" border="0" cellpadding="0" width="100%" >
					<thead>
						<tr>
							<th align="center" nowrap><egui:intnl text="reporter.common.Application" /></th>
<%
		}
		else
		{
%>
		<div class="printOuterBoxHeader"><egui:intnl text="reporter.common.Top Application Report for Application" /> - <%=s_application%></div>

		<div class="newTable">
			<table cellspacing="0" border="0" cellpadding="0" width="100%" >
				<thead>
					<tr>

<%
		}
		vec.add(intlmp.getTextDescription("reporter.common.Application"));
%>
		<th align="center" nowrap>% <egui:intnl text="reporter.common.Time in Use" /></th>
<%
		vec.add("% "+intlmp.getTextDescription("reporter.common.Time in Use"));
		if(request.getParameter("er_compType")!=null && !request.getParameter("er_compType").startsWith("Agg_"))
		{
%>
		<th  align="center" nowrap><egui:intnl text="reporter.common.Unique Users" /></th>
<%	
			vec.add(intlmp.getTextDescription("reporter.common.Unique Users"));
		}
						String s_var = "";
						String st_value="";
						String displayname="";
						String mes="";
						Vector v_val = new Vector();
						ArrayList sublist=(ArrayList)reportInfo.getVariables("APPLICATION_REPORT");
						int count=0;
						
						for(int m=0;m<sublist.size();m++)
						{
							s_var = (String)sublist.get(m);
							String val2="";
							if (s_server==null || s_server.equals("-1"))
							{
								if(s_var.startsWith(key1)) 
								{
									StringTokenizer tok2 = new StringTokenizer(s_var,":");
									while(tok2.hasMoreTokens())
									{
										tok2.nextToken();
										tok2.nextToken();
										val2=tok2.nextToken();
										StringTokenizer meas=new StringTokenizer(val2,"#");
 										if(meas.hasMoreTokens() )
											mes=meas.nextToken();
										else
											mes=val2;
										if(meas.hasMoreTokens() )
											displayname=meas.nextToken();
										else
											displayname=val2;
									}
									st_value=reportInfo.getValue("APPLICATION_REPORT",s_var);
									v_val.add(st_value);
								}
							}
							else
							{
								String strCompType = null;
								if(s_server.lastIndexOf(":")>-1)
									strCompType = s_server.substring(s_server.lastIndexOf(":")+1);
								if(s_server.indexOf("All ")>-1)
									strCompType = s_server.substring(s_server.lastIndexOf("All ")+("All ".length()));

								if(strCompType!=null && s_var !=null && !s_var.startsWith(strCompType))
									continue;
								if(s_server.lastIndexOf(":")>-1)
									strCompType = s_server.substring(s_server.lastIndexOf(":")+1);
								if(strCompType!=null && s_var !=null && !s_var.startsWith(strCompType))
									continue;
								StringTokenizer tok2 = new StringTokenizer(s_var,":");
								if(s_var.indexOf(key1)>-1)
								{
									while(tok2.hasMoreTokens())
									{
										tok2.nextToken();
										tok2.nextToken();
										val2=tok2.nextToken();
										StringTokenizer meas=new StringTokenizer(val2,"#");
										if(meas.hasMoreTokens() )
											 mes=meas.nextToken();
										else
											 mes=val2;
										if(meas.hasMoreTokens() )
											displayname=meas.nextToken();
										else
											displayname=val2;
									}
									st_value=reportInfo.getValue("APPLICATION_REPORT",s_var);
									v_val.add(st_value);
								}
							}
							if (st_value.equals(""))
								st_value="Avg";
							StringTokenizer st_val=new StringTokenizer(st_value,",");
							int countTokens=st_val.countTokens();
							if(st_value.indexOf("Avg")>-1 && st_value.indexOf("Pct")>-1 
								&& st_value.indexOf("Max")  >-1 )
							{
							vec.add(intlmp.getTextDescription("reporter.common."+displayname));
%>
		<th colspan="<%=countTokens%>" align="center"><egui:intnl text='<%="reporter.common."+displayname%>' /></th>
<%
							}
							else if((st_value.indexOf("Avg")>-1 && st_value.indexOf("Pct")>-1) 
								|| (st_value.indexOf("Avg")>-1 && st_value.indexOf("Max")>-1) 
								|| (st_value.indexOf("Max")>-1 && st_value.indexOf("Pct")>-1) )
							{
								if(!displayname.equals(""))
								{
							String v_value = (String)v_val.get(count);
							StringTokenizer tokenizer=new StringTokenizer(v_value,",");
							String str1=tokenizer.nextToken();
							String str2=tokenizer.nextToken();
							vec.add(intlmp.getTextDescription("reporter.common."+displayname)+" - "+"("+str1+")");
							vec.add(intlmp.getTextDescription("reporter.common."+displayname)+" - "+"("+str2+")");
%>
		<th colspan="<%=countTokens%>" align="center"><egui:intnl text='<%="reporter.common."+ displayname%>' /></th>
<%
								}
							}
							else
							{
								if(!displayname.equals(""))
								{
							vec.add(intlmp.getTextDescription("reporter.common."+displayname));
							String v_value = (String)v_val.get(count);
							StringTokenizer tokenizer=new StringTokenizer(v_value,",");
							String str1=tokenizer.nextToken();

%>
		<th colspan="<%=countTokens%>" align="center"><egui:intnl text='<%="reporter.common."+displayname%>' /></th>
<%
								}
							}
							displayname="";
						}
						count++;
%>
</tr>

<tr>
<%
	if(request.getParameter("er_compType")!=null && !request.getParameter("er_compType").startsWith("Agg_"))
	{
%>
	
		<th class="subHeader" align="center"></th>
		<%
	}
%>
		<th class="subHeader" align="center"></th>
		<th class="subHeader" align="center"></th>
<%
						int fieldsize=3;
						for(int v=0;v<v_val.size();v++)
						{
							String v_value = (String)v_val.get(v);
							StringTokenizer tokenizer=new StringTokenizer(v_value,",");
							while(tokenizer.hasMoreTokens())
							{
								String str1=tokenizer.nextToken();
%>
		<th class="subHeader" align="center"><egui:intnl text='<%="reporter.common."+str1%>' /></th>
<%
							}
						}
%>
</tr>
</thead>
<%
						
						Collections.sort(value2,new ErSort());
						for (int z=0;z<value2.size();z++)
						{
							Vector v_data=(Vector)value2.get(z);
							for (int i=0;i<v_data.size();i++)
							{
								String strdata=v_data.get(i).toString();
								if (i==1)
								{
									strdata = (strdata == null || strdata.equals("")|| strdata.equals("-5.0")
									|| strdata.equals("-1.0")||strdata.equals("-"))? "-" : erUtils.round(Float.parseFloat(strdata),4);
								}
								else if (i==2)
								{
									strdata = (strdata == null || strdata.equals("")|| strdata.equals("-5.0")
										|| strdata.equals("-1.0")||strdata.equals("-"))? "-" : erUtils.round(Float.parseFloat(strdata),0);
								}
								else if(i>2)
								{
									strdata = (strdata == null || strdata.equals("")|| strdata.equals("-5.0")
									|| strdata.equals("-1.0")||strdata.equals("-"))? "-" : erUtils.round(Float.parseFloat(strdata),2);
								}
								if(strdata.indexOf(":NULL")>-1)
									strdata = strdata.substring(0,strdata.indexOf(":NULL"))+strdata.substring(strdata.indexOf(":NULL")+5);
								if (i==0)
								{
								lst_dat.add(strdata);
%>
	<tbody>
	<tr>
		<td align="left" style="width: 28%; word-wrap: break-word; overflow-x:auto;"><%=strdata%></td>
<%
								}
								else
								{
								lst_dat.add(strdata);
%>
		<td width="9%" align="center"><%=strdata%></td>
<%
								}
							}
						}
%>
	</tr>
	</tbody>
</table>
</div>
</div>
<%					
						sen1.put(vec,lst_dat);
						ht1.put(s_tit1,sen1);
						lst.add(ht1);
						ht1 = new Hashtable();
						sen1 = new Hashtable();
						vec = new Vector();
						lst_dat = new LinkedList();
					}
				}
			}
			else
			{
%>
<table width='100%' height='100%'>
	<tr>
		<td align='center' valign='middle'><img src='/images/Light/nomeasures_custom.png' /></td>
	</tr>
</table>
<%
		lst.add(intlmp.getTextDescription("reporter.common.No measures available for the current selection"));
			}
%>
				
<%
		}
		else if(apptop!=null && apptop.size() > 0)
		{
			String topparam  = (String)session.getAttribute("topparam");
			String s_farmserver=request.getParameter("select_farm");
			String repBy=request.getParameter("er_option");
			String strcompntType=request.getParameter("er_compType");
			String ersite=request.getParameter("er_site");
			if(topparam == null)
			{
				topparam = request.getParameter("er_check");
			}
			if(st_apptopdata == null)
			{
				st_apptopdata = request.getParameter("er_application1");
			}
			String strColSpan = "2";
			if(apptop!=null && apptop.size() > 0)
			{
				//prakash
				int countTop=0;
				for(int topCount=0;topCount<apptop.size();topCount++)
				{
					HashMap aListMap = (HashMap)apptop.get(topCount);
					String strMstCount = (String)aListMap.get("msmt_count");
					double doubleMstCount = Double.parseDouble(strMstCount);
					if(doubleMstCount<0.0)
					{
						countTop++;
					}
				}
				//
				if(topparam!=null&&topparam.equals("true"))
					strColSpan ="1";
%>
<div class="printOuterBox">
		<div class="printOuterBoxHeader" colspan="<%=strColSpan%>">
<%
				String tit=" "+s_farmserver+" zone with accessing ";
				if(repBy != null && repBy.equalsIgnoreCase("Component"))
					tit=" "+intlmap.getComponentTypeDescription(strcompntType)+" component with accessing ";
				else if(repBy != null && repBy.equalsIgnoreCase("Segment"))
					tit=" "+ersite+" segment with accessing ";
				else if(repBy != null && repBy.equalsIgnoreCase("Group"))
					tit=" "+ersite+" group with accessing ";
				else if(repBy != null && repBy.equalsIgnoreCase("service"))
					tit=" "+ersite+" service with accessing ";
				boolean isVmComp=reportInfo.isVmComponent(strcompntType);
				if(topparam!=null&&topparam.equals("true"))
				{
%>
			<egui:intnl text="reporter.common.Users in" />&nbsp;<%=st_apptopdata%>
<%
				}
				else
				{
%>
			<egui:intnl text="reporter.common.Top" />&nbsp;<egui:intnl text="reporter.common.Users in" />&nbsp;<%=tit%>&nbsp;<%=st_apptopdata%>
<%
				}
%>
		</div>
<%
	if(countTop!=apptop.size())
	{
%>
<div class="newTable">
<table align="center" width='100%' cellspacing="0" cellpadding="0" border="0" class="prin tTable">
	<thead>
	<tr>
		<th class="printTableHeader2" align="center"><egui:intnl text="reporter.common.Username" /></th>
<%
				if(isVmComp){
%>
			<th class="printTableHeader2" align="center"><egui:intnl text="reporter.common.Vm Name" /></th>
<%
				}
				if(topparam.equalsIgnoreCase("null"))
				{
%>
		<!-- <th class="printTableHeader2" align="center" width="50%" wrap><egui:intnl text="reporter.common.No of Measurements with access to"/>&nbsp;<%=st_apptopdata.substring(st_apptopdata.indexOf("/")+1,st_apptopdata.length())%></th> -->
		<th class="printTableHeader2" align="center" width="50%" wrap><egui:intnl text="reporter.common.% of Time Accessed to"/>&nbsp;<%=st_apptopdata.substring(st_apptopdata.indexOf("/")+1,st_apptopdata.length())%></th>
<%
				}
%>
	</tr>
	</thead>
	<tbody>
	<tr>
<%
				String tdWidth="50";
				if(isVmComp)
					tdWidth="33";
				int numTop = apptop.size();
				for(int n=0; n< numTop; n++)
				{
					HashMap data = (HashMap)apptop.get(n);
					String username = (String)data.get("user");
					String usercount = (String)data.get("usercount");
					String msmt_count = (String)data.get("msmt_count");
					double timePerMeas = Double.parseDouble(msmt_count);
					if(timePerMeas<0.0)
					{
						continue;
					}
%>
		<td align="center" width="<%=tdWidth%>%"><%=username%></td>
<%
					if(isVmComp){
					String vmname=(String)data.get("vmname");
%>
		<td align="center" width="<%=tdWidth%>%"><%=vmname%></td>
<%
}
					if(topparam.equalsIgnoreCase("null"))
					{
%>
						<!-- <td align="center" width="<%=tdWidth%>%"><%=usercount%></td> -->  
						<td align="center" width="<%=tdWidth%>%"><%=timePerMeas%></td>
<%
					}
%>
	</tr>
<%
				}
%>
	</tbody>
</table>
</div>
<%	
		}
		else
		{
%>
			<table width='100%' height='100%'>
			<tr>
				<td align='center' valign='middle'><img src='/final/images/Light/nomeasures_custom.png' /></td>
			</tr>
			</table>
<%
		}
%>			
</div>
<%
			}
		}else
		{
%>
<table width='100%' height='100%'>
	<tr>
		<td align='center' valign='middle'><img src='/images/Light/nomeasures_custom.png' /></td>
	</tr>
</table>
<%
		lst.add(intlmp.getTextDescription("reporter.common.No measures available for the current selection"));
		}						
		session.setAttribute("ScheduleCSVData",lst);
	}
	else if(r_type !=null && r_type.equalsIgnoreCase("Event")) //OPERATION REPORT - EVENT ANALYSIS
	{
%>

<div class="printOuterBoxNoBorder"> 
		<div class="printSelectionFields"><egui:intnl text="reporter.common.event.Top 10 Events by "/> - <span class="bold"><egui:intnl text='<%=view_name%>' /></span></div>


<%
		String start_day="";
		String end_day="";
		start_day=erd.s_stdate ;
		end_day=erd.s_enddate;

		if(currentDateFormat!=null && !currentDateFormat.equals("dd/MM/yyyy") && DateUtil.isDate(start_day,"MM/dd/yyyy"))
		{
			comFormat = currentDateFormat;
			start_day = DateUtil.changeDateFormat(start_day,"MM/dd/yyyy",comFormat);
		}
		if(currentDateFormat!=null && !currentDateFormat.equals("dd/MM/yyyy") && DateUtil.isDate(end_day,"MM/dd/yyyy"))
		{
			comFormat = currentDateFormat;
			end_day = DateUtil.changeDateFormat(end_day,"MM/dd/yyyy",comFormat);
		}
		converterStart = new EgTimeZoneConverter(start_day+" "+erd.s_sthr+":"+erd.s_startmin,thisuser);
		String st_dateTime = converterStart.getDateTime();
		converterEnd = new EgTimeZoneConverter(end_day+" "+erd.s_endhr+":"+erd.s_endmin,thisuser);
		String en_dateTime = converterEnd.getDateTime();
%>
		
		
		<div class="printSelectionFields"><egui:intnl text="reporter.common.Timeline" /> - <span class="bold"><%=st_dateTime%>&nbsp;<egui:intnl text="reporter.common.hrs" /> <egui:intnl text="reporter.common.to" /> <%=en_dateTime%>&nbsp;<egui:intnl text="reporter.common.hrs" /></span></div>
	</div>
	<div class="printOuterBox">
<%
		boolean rowExists = false;
		boolean colExists = false;
		Set cols;
		HashMap aValue = new HashMap();
		ArrayList eventData = new ArrayList();
		int colCount = 0;
		String total = "";
		if(dataHash!=null && dataHash.size() > 0)
		{
			eventData = (ArrayList)dataHash.get(0);
			if(eventData!=null && eventData.size() > 0)
			{
				Object dt = (Object)eventData.get(0);
				if(dt instanceof String)
				{
					total = (String)eventData.get(0);
				}
				else
				{
					aValue = (HashMap)eventData.get(0);
					if(aValue!=null && aValue.size() > 0)
					{
						cols = aValue.keySet();
						Iterator iter = cols.iterator();
						colCount = aValue.size();
						while(iter.hasNext())
						{
							String col = (String)iter.next();
							if(col!=null && col.length() > 0)
							{
								colExists = true;
							}
							String row = (String)aValue.get(col);
							if(row!=null && row.length() > 0)
							{
								rowExists = true;
								break;
							}
						}
					}
					for(int ed =0; ed < eventData.size(); ed++)
					{
						Object data = (Object)eventData.get(ed);
						if(data instanceof HashMap)
							continue;
						total = (String)eventData.get(ed);
					}
				}
			}
		}
		if(dataHash!=null && dataHash.size() > 0)
		{
			if (rowExists)
			{
%>



<%
				String s_event=request.getParameter("v_event");
				String sub_event=request.getParameter("subevent");
				if(s_event!=null )
				{
					if(s_event.equals("Group") ||s_event.equals("Segment") ||s_event.equals("Service") || s_event.equals("Zone"))
					{
%>
		<div class="printOuterBoxHeader" ><egui:intnl text='<%="reporter.common.event.Top 10 Events for "+s_event%>' /> - <%=sub_event%> </div>
<%
					}
					else if(s_event.equals("Component") && view_name != null)
					{
%>
						<div class="printOuterBoxHeader" ><egui:intnl text="<%="reporter.common.Top 10 Events by "+s_event+" name"%>" /></div>

<%
					}
					else
					{
						if(view_name != null)
						{
%>
		<div class="printOuterBoxHeader" ><egui:intnl text="reporter.common.Top 10 Events by " />&nbsp;<egui:intnl text='<%=view_name%>' /></div>
<%
						}
						else
						{
%>
		<div class="printOuterBoxHeader" ><egui:intnl text="reporter.common.Top 10 Events by Component name" /></div>
<%
						}
					}
				}
				else
				{
%>
		<div class="printOuterBoxHeader" ><egui:intnl text="reporter.common.Top 10 Events by Component name" /></div>
<%
				}
%>

	<table align="center" width='100%' cellspacing="0" cellpadding="0" border="0">
		<tr>
			<td align="center" width="100%" >
				<div class="printOuterBox" style="display:inline-block">
			<%
				if(pdfPrint !=null && pdfPrint.equalsIgnoreCase("yes"))
				{
			%>
					<img src="<%=strManagerURL%>/final/servlet/com.eg.ErCtxServerReportCBar?<%=qString%>&er_width=900"scrolling="no" frameborder="0" align="left" frameborder="0"/>
			<%
				}
				else
				{
			%>
					<img src="<%=strManagerURL%>/final/servlet/com.eg.ErCtxServerReportCBar?<%=qString%>&er_width=978"scrolling="no" frameborder="0" align="left" frameborder="0"/>
			<%
				}
			%>
				</div>
			</td>
		</tr>
	</table>

<%
			}
%>
<div class="clear">&nbsp;</div>

		<div class="printOuterBoxHeader" ><egui:intnl text="reporter.common.Summary of all events" /></div>

		<div class="newTable">


<table width='100%' cellspacing="0" cellpadding="0" border="0" >
	<thead>
	<tr>
<%
			int c=0;
			if(rowExists)
			{
				cols = aValue.keySet();
				Iterator iter = cols.iterator();
				while(iter.hasNext())
				{
					c++;
					String col = ((String)iter.next()).toUpperCase();
					col = getColName(viewReport,c,col);
					col = col.toUpperCase();
					if (col != null && col.trim().equals("TEST"))
					{
						col ="TEST AND METRICS";
						 colCount++;
						%>
		<th align="left" ><egui:intnl text="reporter.operation.event.TEST"/></th>
		<th align="left" ><egui:intnl text="reporter.operation.event.METRICS"/></th>
						<%
					}
					else{
%>
		<th align="left"><egui:intnl type="<%=col%>" /></th>
<%
					}
				}
			}
			else
			{
%>
		<th align="center" valign="middle" height="100%">
			<egui:intnl text="reporter.common.No report available for the current selection" />
		</th>
<%
			}
%>
	</tr>
	</thead>
	<tbody>
<%
			if(rowExists)
			{
				for(int ed =0; ed < eventData.size(); ed++)
				{
					HashMap data = new HashMap();
					Object t_data = (Object)eventData.get(ed);
					if(t_data instanceof String)
						total = (String)eventData.get(ed);
					else if(t_data instanceof HashMap)
						data = (HashMap)eventData.get(ed);

					Set d = data.keySet();
					Iterator i = d.iterator();
%>
	<tr>
<%
					int rl =0;
					int k=0;
					while(i.hasNext())
					{
						String key1="";
						k=k+1;
						String key = (String)i.next();
						key1=getColName(viewReport,k,key);
						String value = (String)data.get(key1);
						if(key1.equalsIgnoreCase("Severity"))
						{
							value = ui.getStateDisplayLabel(value);
						}
						if(rl == data.size()-1)
						{
%>
		<td align="left" wrap> <span class="<%=fontStyleDblSingl%>"><%=value%></span></td>
<%
						}
						else
						{
							if(key1!=null && key1.equalsIgnoreCase("Type"))
							{
%>
		<td align="left" wrap><span class="<%=fontStyleDblSingl%>"><egui:intnl type="<%=value%>" /></span></td>
<%
							}
							else if(key1!=null && key1.equalsIgnoreCase("Test"))
							{
								if(value.indexOf("(")>-1)
								{
									String strtest=value.substring(0,value.indexOf("("));
									String strmeastemp=value.substring(value.indexOf("(")+1);
									String strmeasures=strmeastemp.substring(0,strmeastemp.indexOf(")"));
									String mappingmeasure="";
									if(strmeasures.indexOf(",")>-1)
									{
										StringTokenizer meastoken=new StringTokenizer(strmeasures,",");
										int countMeasure=meastoken.countTokens();
										int incount=0;
										while(meastoken.hasMoreTokens())
										{
											incount++;
											if(countMeasure==incount)
											{
												mappingmeasure+=intlmap.getMeasureDescription(strtest.trim(),meastoken.nextToken().trim());
											}
											else
											{
												mappingmeasure+=intlmap.getMeasureDescription(strtest.trim(),meastoken.nextToken().trim())+",";
											}
										}
									}
									else
									{
										mappingmeasure=intlmap.getMeasureDescription(strtest.trim(),strmeasures.trim());
									}
%>
		<td align="left" wrap><span class="<%=fontStyleDblSingl%>"><egui:intnl test="<%=strtest.trim()%>"/></span></td>
		<td align="left" wrap><span class="<%=fontStyleDblSingl%>"><egui:intnl test="<%=mappingmeasure%>"/></span></td>
<%
								}
								else
								{
%>
		<td align="left" wrap><span class="<%=fontStyleDblSingl%>"><egui:intnl type="<%=value%>" /></span></td>
<%
								}
							}
							else if(key1!=null && key1.equalsIgnoreCase("severity"))
							{
%>
		<td align="left" wrap><span class="<%=fontStyleDblSingl%>"><egui:intnl text='<%="reporter.common."+value%>'/></span></td>
<%
							}
							else
							{
%>
		<td align="left" wrap><span class="<%=fontStyleDblSingl%>"><%=value%></span></td>
<%
							}
						}
						rl++;
					}
				}
				if(colCount == 2)
				{
%>
		<td align="left" wrap><b><egui:intnl text="reporter.common.TOTAL" /></b></td>
		<td align="center" wrap><b><%=total%></b></td>
<%
				}
				else if(colCount == 3)
				{
%>
		<td align="left" wrap><b><egui:intnl text="reporter.common.TOTAL" /></b></td>
		<td align="left" nowrap></td>
		<td align="center" nowrap><b><%=total%></b></td>
<%
				}
				else if(colCount == 4)
				{
%>
		<td align="left" nowrap><b><egui:intnl text="reporter.common.TOTAL" /></b></td>
		<td align="left" nowrap></td>
		<td align="left" nowrap></td>
		<td align="center" nowrap><b><%=total%></b></td>
<%
				}
				else if(colCount == 5)
				{
%>
		<td align="left" nowrap><b><egui:intnl text="reporter.common.TOTAL" /></b></td>
		<td align="left" nowrap></td>
		<td align="left" nowrap></td>
		<td align="left" nowrap></td>
		<td align="center" nowrap><b><%=total%></b></td>
<%
				}
				else if(colCount == 6)
				{
%>
		<td align="left" nowrap><b><egui:intnl text="reporter.common.TOTAL" /></b></td>
		<td align="left" nowrap></td>
		<td align="left" nowrap></td>
		<td align="left" nowrap></td>
		<td align="left" nowrap></td>
		<td align="center" nowrap><b><%=total%></b></td>
<%
				}
%>
		</tr>
		</tbody>
</table>
</div>


<!-- sakthi--added --show alert data to display all alerts for component -->
<%
				if(request.getParameter("showvalue")!=null && request.getParameter("showvalue").equals("Yes"))
				{
%>
<div class="clear">&nbsp;</div>

		<div class="printOuterBoxHeader" ><egui:intnl text="reporter.common.Details of Events" /></div>

		<div class="newTable">


<table class="newimg" align="center" width="100%" cellspacing="0" cellpadding="0" border="0">
<col width="2%"><col width="15%"><col width="8%"><col width="15%"><col width="13%"><col width="7%"><col width="10%"><col width="25%">
	<thead>
	<tr>
		<th align="center" wrap colspan="2" ><egui:intnl text="reporter.common.Start Time" /></th>
		<th align="left" wrap ><egui:intnl text="reporter.common.Duration" /></th>
		<th align="left" wrap ><egui:intnl text="reporter.common.Component" /></th>
		<th align="left" wrap ><egui:intnl text="reporter.common.Component Type" /></th>
		<th align="left" wrap ><egui:intnl text="reporter.common.Service(s)" /></th>
		<th align="left" wrap ><egui:intnl text="reporter.common.Test" /></th>
		<th align="left" wrap ><egui:intnl text="reporter.common.Description" /></th>
	</tr>
	</thead>
	<tbody>
<%
					EgTablesInfo egtblinfo=new EgTablesInfo("manager");
					String desc="";
					Hashtable alertParams = new Hashtable();
					for(int a=0;a<a_list.size();a+=9)
					{
						String compotype=(String)a_list.get(a);
						String strType = compotype;
						String component=(String)a_list.get(a+1);
						String comp_with_port = component;
						String tests=(String)a_list.get(a+2);
						String measure=(String)a_list.get(a+3);
						String s_time=(String)a_list.get(a+4);
						String e_time=(String)a_list.get(a+5);
						String svrty= (String)a_list.get(a+6);
						String info=(String)a_list.get(a+7);
						String service=(String)a_list.get(a+8);
						long l_sttime=Long.parseLong(s_time);
						long l_edtime=Long.parseLong(e_time);
					
						String t_site_name=service;
						t_site_name=(t_site_name==null || t_site_name.trim().length()==0)?"NULL":t_site_name;
						if ((!t_site_name.equals("NULL")) && (!t_site_name.equals("NONE")) && (!siteNames.contains(t_site_name)))
							continue;

						
						//added by chandrasekhar to get real component type..
						String comp_info=discInfoHelper.getCompTypeForHostSystem(compotype,component,tests,hasAllComponentAccess,intlmap,userCompList);
						if(!component.toUpperCase().endsWith(":NULL"))
						{
							component=component;
						}
						else if(component.toUpperCase().endsWith(":NULL"))
						{
							component=component.substring(0,component.indexOf(":"));
						}
						if( service.equalsIgnoreCase("NULL") ||service.equalsIgnoreCase("NONE") )
						{
							service="-";
						}

						String display_Str="";
						display_Str=esmb.getServiceNamesForComponent(resultServiceNamesForComp,strType,comp_with_port,service,siteNames,hasAllComponentAccess);
						String duration="Current";
						String s_edtime="-";
						String test="";
						String discrip="";
						String s_sttime=egDt.egetDateUS(l_sttime);
						String s_starttime=s_sttime.substring(0,10);
						String sthrmin=s_sttime.substring(10,16);
						s_sttime=DateUtil.changeDateFormat(s_starttime,"MM/dd/yyyy",currentDateFormat)+" "+sthrmin;
						converterStart = new EgTimeZoneConverter(s_sttime,thisuser);
						String usr_stTime = converterStart.getDateTime();

						if(l_edtime!=-1)
						{
							s_edtime = egDt.egetDateUS(l_edtime);

							DateTimeTokenizer dtd = new DateTimeTokenizer();
							dtd.setDateFormat(DateTimeTokenizer._YMD);
							dtd.setDateSeparator(DateTimeTokenizer.HYPHEN_SEPARATOR);
							dtd.setTimeFormat(DateTimeTokenizer.HMS);

							duration=dtd.getTimeDifference((l_edtime-l_sttime)/1000);
						}
						alertParams = new Hashtable();
						alertParams.put("$componentType",intlmap.getComponentTypeDescription(compotype));
						alertParams.put("$componentName",Server.getServerNameWithoutPort(component, false));
						String tmpInfo = info;
						if(tmpInfo!=null && tmpInfo.length()>1){
							if(tmpInfo.startsWith("+")){
								tmpInfo = tmpInfo.substring(1);
								alertParams.put("$info",tmpInfo);
							}
							else
								alertParams.put("$info",tmpInfo);
						}
						alertParams.put("appendTag",new Boolean(false));
						desc=egtblinfo.getMeasureAlert(tests+":"+measure,info,alertParams);
						if(desc != null && desc.indexOf("~!~") != -1){
							boolean infoAdded = Boolean.parseBoolean(desc.substring(desc.indexOf("~!~")+3));
							desc = desc.substring(0,desc.indexOf("~!~"));
							if(desc != null && !infoAdded && tmpInfo!=null && tmpInfo.trim().length()>1)
								desc += "{"+tmpInfo+"}";
						}
						desc = StringUtils.split(desc, 42);
						String strtests=intlmap.getTestDescription(tests);
						strtests=StringUtils.split(strtests,13);
						component=StringUtils.split(component,20);
						compotype=intlmap.getComponentTypeDescription(compotype);
						compotype=StringUtils.split(compotype,20);
%>
	<tr>
<%
						if(svrty.equalsIgnoreCase("HIGH"))
						{
%>
		<td align="left"><img src="../images/Light/rcircle.png" border="0" height="16" width="16"></td>
		<td align="center" nowrap><%=usr_stTime%></td>
<%
						}
						else if(svrty.equalsIgnoreCase("INTERMEDIATE"))
						{
%>
		<td align="left"><img src="../images/Light/ocircle.png" border="0" height="16" width="16"></td>
		<td align="center" nowrap><%=usr_stTime%></td>
<%
						}
						else if(svrty.equalsIgnoreCase("LOW"))
						{
%>
		<td align="left"><img src="../images/Light/pcircle.png" border="0" height="16" width="16"></td>
		<td align="center" nowrap><%=usr_stTime%></td>
<%
						}
						else
						{
%>
		<td align="left" width="25%">&nbsp;</td>
		<td align="center" nowrap><%=usr_stTime%></td>
<%
						}
%>

		<td align="center" nowrap><%=duration%></td>
		<td align="left" nowrap><%=component%></td>
		<td align="left" nowrap><egui:intnl type="<%=comp_info%>" /></td>
		<td align="center" nowrap><div style="width:100px;word-wrap: break-word; overflow-x:auto;"><%=display_Str%></div></td>
		<td align="left" nowrap><%=strtests%></td>
		<td align="left" WRAP><%=desc%></td>
	</tr>
<%
					}
%>
</tbody>
</table>
<%
				}
			}
		}
%>
		</div>
<%
		//end operation event analysics report
	}
	else if(r_type !=null && r_type.equals("Session")) //THINCLIENT SEESION REPORT
	{
		String DaysTo = reportInfo.getExcludeWeekend("CITRIX SESSION REPORT");
		String subject ="CITRIX SESSION REPORT";
		ArrayList listCompTypes = new ArrayList();
		listCompTypes = reportInfo.getComponentsList(subject,false);
		String compType=request.getParameter("er_select_server");
		String s_compType=compType;
		ArrayList compTypes = listCompTypes;
%>
<div class="printOuterBoxNoBorder">
	<div class="printSelectionFields">
		<egui:intnl text="reporter.common.Thin Client Session Reports for" /> - 
		<span class="bold"> <%=headerKeyName%></span>
	</div>
<%
		if(Strexcwe!=null&&Strexcwe.equalsIgnoreCase("Yes"))
		{
%>
	<div class="printSelectionFields">
		<egui:intnl text="reporter.common.Exclude WeekEnds" /> - 
		<span class="bold"> <%=DaysTo%></span>
	</div>
<%
		}
%>
	<div class="printSelectionFields">
		<egui:intnl text="reporter.common.Timeline" /> - 
		<span class="bold"> <%=st_Time%>&nbsp;to&nbsp;<%=en_Time%></span>
	</div>

	<div class="printSelectionFields">
		<egui:intnl text="reporter.common.Time Period" /> - 
		<span class="bold"><%=timefrom+":"+minfrom%> &nbsp;<egui:intnl text="reporter.common.to" />&nbsp;<%=timeto+":"+minto%></span>
	</div>

</div>
<%
			String s_farmserver= request.getParameter("select_farm");
			s_tit = intlmp.getTextDescription("reporter.common.Thin Client Session Reports for")+" "+headerKeyName;
			lst.add(s_tit);
	Vector dvec = new Vector();
	String stimefmt = getString("Start Date",st_Time,intlmp);
	String etimefmt = getString("End Date",en_Time,intlmp);
	dvec.add('"'+stimefmt+'"');
	dvec.add('"'+etimefmt+'"');
	lst.add(dvec);

	lst.add('"'+intlmp.getTextDescription("reporter.common.Time period")+":"+intlmp.getTextDescription("reporter.common.From")+" "+timefrom+":"+minfrom+intlmp.getTextDescription("reporter.common.hrs")+" "+intlmp.getTextDescription("reporter.common.To")+" "+timeto+":"+minto+intlmp.getTextDescription("reporter.common.hrs")+'"');

		if(arrses_data !=null && arrses_data.isEmpty())
		{
			if(Session_data1!=null && !Session_data1.isEmpty())
			{
				if( s_compType!=null && !s_compType.equalsIgnoreCase("All Types"))
				{
%>
<div class="printOuterBox">

		<div align="center" class="printOuterBoxHeader">
		<%
					if(s_farmserver!=null && s_farmserver.equalsIgnoreCase("--Default--"))
					{
s_tit=intlmp.getTextDescription("reporter.common.Summary for ")+" "+headerKeyName;
%>
			<egui:intnl text="reporter.common.Summary for " />&nbsp; <%=headerKeyName%>
<%
					}
					else
					{
					s_tit=intlmp.getTextDescription("reporter.common.Summary for ")+" "+headerKeyName;
%>
							<egui:intnl text="reporter.common.Summary for " />  &nbsp;<%=headerKeyName%>
<%
					}
						vec.add(intlmp.getTextDescription("reporter.thin.Measure"));
						vec.add(intlmp.getTextDescription("reporter.thin.Average"));
%>
		</div>
<div class="newTable">
<table align="center" width="70%" cellspacing="0" cellpadding="0" border="0" >
<tbody>
	<tr>
		<td width="50%"><egui:intnl text="reporter.common.Sessions completed" /> (<egui:intnl text="reporter.common.Number" />)</td>
		<td nowrap align="center"><%=(String)Session_data1.get(0)%></td>
	</tr>
	<tr>
		<td width="50%" ><egui:intnl text="reporter.common.Average duration" /> (<egui:intnl text="reporter.common.Mins" />)</td>
		<td nowrap align="center">
<%
						lst_dat.add(intlmp.getTextDescription("reporter.thin.Sessions completed")+"("+intlmp.getTextDescription("reporter.thin.Number")+")");
						lst_dat.add((String)Session_data1.get(0));

						lst_dat.add(intlmp.getTextDescription("reporter.thin.Average duration")+"("+intlmp.getTextDescription("reporter.thin.Mins")+")");
					String avgdu=(String)Session_data1.get(1);
					if(avgdu.equals("")||avgdu==null)
						avgdu="-";
					out.println(avgdu);
					lst_dat.add(avgdu);
%>
		</td>
	</tr>
	<tr>
		<td width="50%"><egui:intnl text="reporter.common.Maximum duration" /> (<egui:intnl text="reporter.common.Mins" />)</td>
		<td nowrap align="center">
<%	
					lst_dat.add(intlmp.getTextDescription("reporter.thin.Maximum duration")+"("+intlmp.getTextDescription("reporter.thin.Mins")+")");
					String avgdu1=(String)Session_data1.get(2);
					if(avgdu1.equals("")||avgdu1==null)
						avgdu1="-";
					out.println(avgdu1);
					lst_dat.add(avgdu1);
%>
		</td>
	</tr>
	<tr>
		<td width="50%" ><egui:intnl text="reporter.thin.Unique users" /></td>
<%
					lst_dat.add(intlmp.getTextDescription("reporter.thin.Unique users"));
					String Strfarmuser = (String)Session_data1.get(3);
					if(Strfarmuser!=null&&Strfarmuser.equals("-"))
					{
%>
		<td nowrap align="center"><%=Strfarmuser%></td>
<%
					  	lst_dat.add(Strfarmuser);
					}
					else
					{
						lst_dat.add(Strfarmuser);
%>
		<td nowrap align="center"><%=Strfarmuser%></td>
<%
					}
%>
	</tr>
	</tbody>
</table>
</div>
<%
				}
			}
			ArrayList keys=new ArrayList();
			if(Session_data!=null&&!Session_data.isEmpty())
			{
				//System.out.println("Stage 1111");

             if( s_compType!=null && s_compType.equalsIgnoreCase("All Types")){%>

  <div class = "newTable">
	<div class="printOuterBoxHeader"> <egui:intnl text="reporter.common.Unique user Summary for " />&nbsp; <%=headerKeyName%></div>
  <table align="center" width="70%" cellspacing="0" cellpadding="0" border="0" class="printTable">
	<!-- <tr> -->
		<!-- <td class="printTableHeader" width="100%" NOWRAP align="center" colspan="2"> -->
		          <%
					s_tit=intlmp.getTextDescription("reporter.common.Summary for ")+" "+headerKeyName;
                  %>
			        <!-- <egui:intnl text="reporter.common.Unique user Summary for " />&nbsp; <%=headerKeyName%> -->
<%
					vec.add(intlmp.getTextDescription("reporter.thin.Measure"));
					vec.add(intlmp.getTextDescription("reporter.thin.Average"));
%>
		<!-- </td>
	</tr> -->
	
    <tr>
	
		<td width="50%"><egui:intnl text="reporter.common.Sessions completed" /> (<egui:intnl text="reporter.common.Number" />)</td>
		<td nowrap align="center"><%=allTypeUniqueUsrSummaryArr[0]%></td>
	
      <%
	  lst_dat.add(intlmp.getTextDescription("reporter.thin.Total   duration")+"("+intlmp.getTextDescription("reporter.thin.Mins")+")");
	  lst_dat.add(allTypeUniqueUsrSummaryArr[0]);
	  %>
   </tr>
   <tr>
		<td width="50%" ><egui:intnl text="reporter.common.Average duration" /> (<egui:intnl text="reporter.common.Mins" />)</td>
		<td nowrap align="center"> <%=allTypeUniqueUsrSummaryArr[1]%></td>
<%
		lst_dat.add(intlmp.getTextDescription("reporter.thin.Average duration")+"("+intlmp.getTextDescription("reporter.thin.Mins")+")");
		lst_dat.add(allTypeUniqueUsrSummaryArr[1]);
%>
		
	</tr>
	<tr>
		<td width="50%"><egui:intnl text="reporter.common.Maximum duration" /> (<egui:intnl text="reporter.common.Mins" />)</td>
		<td nowrap align="center"> <%=allTypeUniqueUsrSummaryArr[2]%></td>
<%	
					lst_dat.add(intlmp.getTextDescription("reporter.thin.Maximum duration")+"("+intlmp.getTextDescription("reporter.thin.Mins")+")");
					
					lst_dat.add(allTypeUniqueUsrSummaryArr[2]);
%>
		
	</tr>
	
	<tr>
		<td width="50%"><egui:intnl text="reporter.common.Unique user" /> (<egui:intnl text="reporter.common.Number" />)</td>
		<td nowrap align="center"><%=allTypeUniqueUsrSummaryArr[3]%></td>
		<%
		lst_dat.add(intlmp.getTextDescription("reporter.thin.Unique users"));
	    lst_dat.add(allTypeUniqueUsrSummaryArr[3]);
		%>
	</tr>

</table>
<br/>
				<%}



				getDataChange(Session_data, "user_Session");		// For Bug Id : 10811
				Iterator it1=Session_data.keySet().iterator();
				while(it1.hasNext())
				{
					String key=(String)it1.next();
					/*if(key.indexOf("Citrix_MF_XP")!=-1 || key.indexOf("Citrix_server")!=-1 || key.indexOf("Terminal_server")!=-1 || key.indexOf("Vmware_vdi_server")!=-1 || key.indexOf("VmVdi_i_server")!=-1)
					{
						String temp=key.substring(key.indexOf("~")+1,key.length());
						if(!keys.contains(temp))
							keys.add(temp);
					}*/
					for(int comcount=0;comcount<compTypes.size();comcount++)
					{
						String strCompType = (String)compTypes.get(comcount);
						if(key.indexOf(strCompType)!=-1)
						{
							String temp=key.substring(key.indexOf("~")+1,key.length());
							if(!keys.contains(temp))
								keys.add(temp);
						}
					}
				}

				for(int compCount=0; compCount<compTypes.size(); compCount++)
				{
					//if(compCount<keys.size() || keys.contains(compTypes[compCount]))
					if((compCount<keys.size() && ((String)compTypes.get(compCount)).equalsIgnoreCase((String)keys.get(compCount))) || keys.contains(((String)compTypes.get(compCount))))
					{
						if (s_farmserver!=null)
						{
%>
<br/>


		<div class="printOuterBoxHeader" ><egui:intnl text="reporter.common.Session details for " />     &nbsp;<%=headerKeyName%>
		<%
			if(!headerKeyName.contains(intlmp.getComponentTypeDescription((String)compTypes.get(compCount)))){
		%>
		: <egui:intnl type='<%=(String)compTypes.get(compCount)%>'/>
		<% 
			}
		%>
		</div>
<%
			s_tit1 = intlmp.getTextDescription("reporter.thin.Session Details For Zone")+" - --"+intlmp.getTextDescription("reporter.common.Default")+"--:"+intlmp.getComponentTypeDescription((String)compTypes.get(compCount));
			vec2.add(s_tit1);

	}
%>
<div class="newTable">
<table align="center" width="100%" cellspacing="0" cellpadding="0" border="0" >
	<thead>
	<tr>
		<th align="center"><egui:intnl text="reporter.common.Server" /></th>
<%
					vec1.add(intlmp.getTextDescription("reporter.common.Server"));
						Vector v_in  = new Vector();
						String variable1 = "";
						String value1;
						StringTokenizer tok1;
						ArrayList variables=reportInfo.getVariables("CITRIX SESSION REPORT");
						String s_var = "";
						String s_measure = "";
						String s_test = "";
						String st_value="";
						String unit="";
						int count_value=0;
						Vector v_val = new Vector();
						ArrayList a_measunit = new ArrayList();
						for(int m=0;m<variables.size();m++)
						{
							s_var =(String) variables.get(m);
							if(s_var.indexOf(((String)compTypes.get(compCount)))==-1)
								continue;
							StringTokenizer tokens=new StringTokenizer(s_var,":");
							while(tokens.hasMoreTokens())
							{
								tokens.nextToken();
								s_test = tokens.nextToken();
								s_measure = tokens.nextToken();
							}
							StringTokenizer meas=new StringTokenizer(s_measure,"#");
							String mes="";
							String displayname="";
							if(meas.hasMoreTokens() )
								mes=meas.nextToken();
							else
								mes=s_measure;
							String units=tablesInfo.getUnitForMeasure(s_test,mes);
							if(meas.hasMoreTokens() )
								displayname=meas.nextToken();
							else
								displayname=s_measure;
							if(displayname.equalsIgnoreCase("Unique users"))
							{
								displayname ="Unique_users";
							}
							else if(displayname.equals("Session duration"))
							{
								displayname ="Session_duration";
							}
							if(displayname!=null && displayname.equalsIgnoreCase("Term Active Sessions"))
							{
								displayname=displayname+"(Number)";
							}
							else if(displayname!=null && displayname.equalsIgnoreCase("Active sessions"))
							{
								displayname=displayname+"(Number)";
							}
							st_value = reportInfo.getValue("CITRIX SESSION REPORT",s_var);
							v_val.add(st_value);
							StringTokenizer st_val=new StringTokenizer(st_value,",");
							int countTokens=st_val.countTokens();
							String unitname="";
							if(displayname.indexOf("(")>-1)
								unitname=displayname.substring(displayname.indexOf("(")+1,displayname.length()-1);
							else
								unitname="-";
							if(displayname.indexOf("(")>-1)
								displayname=displayname.substring(0,displayname.indexOf("("));

							if(st_value.indexOf("Avg")>-1 && st_value.indexOf("Max")>-1&&st_value.indexOf("Pct")>-1)
							{
								a_measunit.add(unitname+"="+countTokens);
%>
		<th colspan="<%=countTokens%>" width="10%" align="center" wrap><egui:intnl text='<%="reporter.session."+displayname%>' /></th>
<%
							}
							else if((st_value.indexOf("Avg")>-1 && st_value.indexOf("Pct")>-1) || (st_value.indexOf("Avg")>-1 && st_value.indexOf("Max")>-1) || (st_value.indexOf("Max")>-1 && st_value.indexOf("Pct")>-1) )
							{
								a_measunit.add(unitname+"="+countTokens);
%>
		<th colspan="<%=countTokens%>" width="10%" align="center" wrap><egui:intnl text='<%="reporter.session."+displayname%>' /></th>
<%
							String v_value = (String)v_val.get(count_value);
							StringTokenizer tokenizer=new StringTokenizer(v_value,",");
							String strvalue=tokenizer.nextToken();
							String strvalue1=tokenizer.nextToken();
							String measureUnit=(String)a_measunit.get(count_value);
							StringTokenizer unitValue=new StringTokenizer(measureUnit,"=");
							int tokensCount=unitValue.countTokens();
							String measUnitDisp = unitValue.nextToken();
							vec1.add(intlmp.getTextDescription("reporter.session."+displayname)+"("+measUnitDisp +")"+" - "+"("+strvalue+")");
							vec1.add(intlmp.getTextDescription("reporter.session."+displayname)+"("+measUnitDisp +")"+" - "+"("+strvalue1+")");
							}
							else if(st_value.indexOf("Count")>-1 ||st_value.indexOf("Avg")>-1 || st_value.indexOf("Max")>-1||st_value.equals("")||st_value.indexOf("Pct")>-1)
							{
								a_measunit.add(unitname+"="+countTokens);
%>
		<th colspan="<%=countTokens%>" width="10%" align="center" wrap><egui:intnl text='<%="reporter.session."+displayname%>' /></th>
<%
							vec1.add(intlmp.getTextDescription("reporter.session."+displayname));
				}
			  count_value++;
		}
								
%>
		<th width="10%" align="center"><egui:intnl text="reporter.common.No of sessions completed" /></th>
	</tr>
	
				<!-- separate measures from unit.add separate row start-->
	<tr>
		<th class="subHeader" align="center">&nbsp;</th>
<%
							vec1.add(intlmp.getTextDescription("reporter.common.No of sessions completed"));
						for(int u=0; u< a_measunit.size(); u++)
						{
							String measureUnit=(String)a_measunit.get(u);
							StringTokenizer unitValue=new StringTokenizer(measureUnit,"=");
							int tokensCount=unitValue.countTokens();
							String measUnitDisp = unitValue.nextToken();
							String countDisp = unitValue.nextToken();
							if(measUnitDisp!=null && measUnitDisp.equals("")|| measUnitDisp.equals("-"))
							{
%>
		<th  colspan="<%=countDisp%>" class="subHeader"  align="center">&nbsp;</th>
<%
							}
							else
							{
%>
		<th colspan="<%=countDisp%>"  class="subHeader" nowrap align="center">(<%=measUnitDisp%>)</th>
<%
							}
						}
%>
		<th class="subHeader" align="center">&nbsp;</th>
	</tr>
					<!-- end -->
	<tr>
		<th class="subHeader" align="center"></th>
<%
						for(int v=0;v<v_val.size();v++)
						{
							String v_value = (String)v_val.get(v);
							String per_value = "";
							if (v_value.equals(""))
								v_value="Avg";
							StringTokenizer tokenizer=new StringTokenizer(v_value,",");
							while (tokenizer.hasMoreTokens())
							{
								String strvalue=tokenizer.nextToken();
								if (strvalue.equalsIgnoreCase("count"))
								{
%>
		<th class="subHeader" align="center"></th>
<%
								}
								else
								{
%>
		<th align="center" class="subHeader" ><egui:intnl text='<%="reporter.common."+strvalue%>' /></th>
<%
								}
							}
						}
%>
		<th class="subHeader" align="center"></th>
	</tr>
	</thead>
	<tbody>
	
<%
						String skey="";
						TreeMap dispHash=new TreeMap(Session_data);
						Iterator itr = dispHash.keySet().iterator();
						while(itr.hasNext())
						{
							skey = (String)itr.next();
							StringTokenizer keyToken=new StringTokenizer(skey,"~");
							int countToken=keyToken.countTokens();
							String tempVar=keyToken.nextToken();
							String dispTempVar = tempVar;
							if(tempVar!=null && tempVar.endsWith(":NULL"))
								dispTempVar = tempVar.substring(0,tempVar.indexOf(":NULL"));
							String za=keyToken.nextToken();
							if(countToken>=2 && !((String)compTypes.get(compCount)).equalsIgnoreCase(za) )
								continue;
							arr_session= (ArrayList)dispHash.get(skey);
%>
	<tr>
		<td nowrap align="left"><%=dispTempVar%></td>
<%	
									lst_dat1.add(dispTempVar);
								for(int i=0;i<arr_session.size();i++)
							{
								lst_dat1.add((String)arr_session.get(i));
%>
		<td nowrap align="center"><%=(String)arr_session.get(i)%></td>
<%
							}
%>
	</tr>
	<!-- added by jaiwin -->
<%
						}
%>
	</tbody>
</table>
</div>
<%

								lst_dat2.add(lst_dat1);//B.Balamurugan
								lst_dat1 = new LinkedList();	
								vec3.add(vec1.clone());
								vec1 = new Vector();
					}
				}
									}
								
			}
			else if(arrses_data!=null && arrses_data.size()>0)
			{
				HashMap ht_table1 = (HashMap)arrses_data.get(0);
				String serverfortop = request.getParameter("select_server");
				String strColspan = "3";
				String reqser=request.getParameter("select_server");
				String reqses=request.getParameter("topsession");
				String requser=request.getParameter("topusers");
				String reqfarm=request.getParameter("select_farm");
				HashMap	htMapTemp = (HashMap)arrses_data.get(0);
				if(htMapTemp!=null && !htMapTemp.containsKey("trgt_host") && !htMapTemp.containsKey("login_time"))
					strColspan = "2";
				else if (htMapTemp!=null && (htMapTemp.containsKey("trgt_host") && htMapTemp.containsKey("login_time")))
					strColspan = "4";

%>
<div class="printOuterBox">

		<div class="printOuterBoxHeader" align="center">
<%

				String top=reportInfo.getTop("CITRIX SESSION REPORT");

				if(reqser!=null&&reqser.equals("no")&&reqses!=null&&reqses.equals("yes"))
				{
%>
			<egui:intnl text="reporter.common.Longest sessions in" /> &nbsp;<%=s_farmserver%>
<%
				}
				else if(reqser!=null&&!reqser.equals("no")&&requser!=null&&requser.equals("no"))
				{
%>
			<egui:intnl text="reporter.common.Longest sessions in" />&nbsp;<%=serverfortop%>
<%
				}
				else if(reqser!=null&&!reqser.equals("no")&&requser!=null&&requser.equals("users"))
				{
%>
			<egui:intnl text="reporter.common.Top   users  in" />&nbsp;<%=serverfortop%>
<%
				}
				else
				{
%>
			<%=titforsession%>
<%
				}
%>
		</div>
<div class="newTable">
<table align="center" width="70%" cellspacing="0" cellpadding="0">
<thead>
	<tr>
<%
				HashMap	ht_map = (HashMap)arrses_data.get(0);
				if(ht_map.containsKey("trgt_host"))
				{
%>
		<th align="center" ><egui:intnl text="reporter.common.Server" /></th>
<%
				}
%>
		<th align="center" nowrap><egui:intnl text="reporter.common.Username" /></th>
<%
				if(ht_map.containsKey("login_time"))
				{
%>
		<th align="center"  nowrap><egui:intnl text="reporter.common.Logintime" /></th>
<%
				}
%>
		<th align="center"  width="10%" wrap><egui:intnl text="reporter.common.Duration of access" /> (<egui:intnl text="reporter.common.Mins" />)</th>
	</tr>
	</thead>
	<tbody>
<%
				HashMap ht_table=null;
				String server1="";
				String LoginTime="";
				String s_duration="";
				String user1="";
				for(int j=0;j<arrses_data.size();j++)
				{
					Object v1 = (Object)arrses_data.get(j);
					if(v1 instanceof Hashtable)
						continue;
					ht_table = (HashMap)arrses_data.get(j);
					server1 = (String)ht_table.get("trgt_host");
					String userTemp=(String)ht_table.get("username");
					if(userTemp.indexOf(":")>0)
						user1 = userTemp.substring(0,userTemp.indexOf(":"));
					else
						user1=userTemp;
					LoginTime = (String)ht_table.get("login_time");
					s_duration = (String)ht_table.get("duration");
					if(server1!=null&&server1.endsWith(":NULL"))
					{
						server1 = server1.substring(0,server1.indexOf(":"));
					}
%>
	<tr>
<%
					if(ht_table.containsKey("trgt_host"))
					{
%>
		<td align="center" width="25%"><%=server1%></td>
<%
					}
%>
		<td align="center" width="25%"><%=user1%></td>
<%
					if(ht_table.containsKey("login_time"))
					{
						String logintimedisp=LoginTime.substring(0,LoginTime.indexOf(" "));
					//logintimedisp=DateUtil.changeDateFormat(logintimedisp.trim(),"MM/dd/yyyy",currentDateFormat);
%>
		<td align="center" width="25%"><%=logintimedisp+" "+LoginTime.substring(LoginTime.indexOf(" "))%></td>
<%
					}
%>
		<td align="center" width="25%"><%=s_duration%></td>
	</tr>
<%
				}
%>
</tbody>
</table>
</div>
</div>
<%
			}
		sen.put(vec,lst_dat);
		ht=new Hashtable();
		ht.put(s_tit,sen);
		lst.add(ht);
				if(vec2!=null && !vec2.isEmpty())
			{
				for(int i=0;i<vec2.size();i++)
				{
					sen1.put(vec3.get(i),lst_dat2.get(i));
					s_tit1 = (String)vec2.get(i);
					ht1=new Hashtable();
					ht1.put(s_tit1,sen1);
					lst.add(ht1);
					sen1 = new Hashtable();
					ht1 = new Hashtable();
				}
			}
		session.setAttribute("ScheduleCSVData",lst);
	}
	else
	{
%>


<%
	//	String test=request.getParameter("er_test");
	//	String measure=request.getParameter("er_measure");
		String sortby=request.getParameter("er_sortby");
	//	String ss_tit = intlmap.getTestDescription(test)+"  :  "+intlmap.getMeasureDescription(test,measure);
		//lst.add('"'+intlmp.getTextDescription("reporter.topn.Top N Reports For  ")+"  "+ss_tit+"   "+intlmp.getTextDescription("reporter.common.Sorted By")+" : "+intlmp.getTextDescription("reporter.common."+sortby));

			lst.add(intlmp.getTextDescription("reporter.common.Sorted By")+" : "+intlmp.getTextDescription("reporter.common."+sortby));

%> 
			<div class="printSelectionFields"><egui:intnl text="reporter.common.Sorted By" /> - <span class="bold"><egui:intnl text='<%="reporter.common."+sortby%>' /></span></div>

<%
if(Strexcwe!=null&&Strexcwe.equalsIgnoreCase("Yes"))
		{
			String Days=reportInfo.getExcludeWeekend("CITRIX SESSION REPORT");
%>
			<div class="printSelectionFields"><egui:intnl text="reporter.common.Exclude WeekEnds" /> - <span class="bold"><%=Days%></span></div>
<%
		}
%>
			<div class="printSelectionFields"><%=intlmp.getTextDescription("reporter.common.Timeline")%> - <span class="bold"><%=st_Time%>&nbsp;<egui:intnl text="reporter.common.hrs" />&nbsp <%=intlmp.getTextDescription("reporter.common.to")%>&nbsp <%=en_Time%>&nbsp;<egui:intnl text="reporter.common.hrs" /></span></div>

			<div class="printSelectionFields"><egui:intnl text="reporter.common.Time Period" />  - <span class="bold"><%=timefrom+":"+minfrom%> &nbsp;<egui:intnl text="reporter.common.to" />&nbsp;<%=timeto+":"+minto%></span> </div>
			
			
		</div>
	<div class="clearDiv">&nbsp;</div>
<%
	Vector dvec = new Vector();
	String stimefmt = getString("Start Date",st_Time,intlmp);
	String etimefmt = getString("End Date",en_Time,intlmp);
	dvec.add('"'+stimefmt+'"');
	dvec.add('"'+etimefmt+'"');
	lst.add(dvec);
		lst.add('"'+intlmp.getTextDescription("reporter.common.Time period")+":"+intlmp.getTextDescription("reporter.common.From")+" "+timefrom+":"+minfrom+intlmp.getTextDescription("reporter.common.hrs")+" "+intlmp.getTextDescription("reporter.common.To")+" "+timeto+":"+minto+intlmp.getTextDescription("reporter.common.hrs")+'"');
		

		if (reportType!=null && reportType.equalsIgnoreCase("data"))
		{

ArrayList hm=(ArrayList)session.getAttribute("QueryStringMap");
if(hm!=null)
{
for(int y=0;y<hm.size();y++)
{
	Object[] objArr = (Object[])hm.get(y);
	String key = (String)objArr[2];
	ht_Data = (Hashtable)objArr[1];
	if(key!=null)
		key = erUtils.specialCharDecode(key);
	String strtitle=key;
	%>
	<div class="newTable">
		<div class="printOuterBoxHeader"><egui:intnl test="<%=key%>" /> </div>
	<table align="center" width="100%" cellspacing="0" cellpadding="0" >
	<!--<tr>
		<td class="printTableHeader" width="100%" NOWRAP align="center" colspan="4"><egui:intnl test="<%=key%>" /> 
		</td>
	</tr>-->
	<%
if(ht_Data!=null && ht_Data.size()>0)
	{
			String skey="";
			Iterator itr = ht_Data.keySet().iterator();
	
%>


	<%
if(ht_Data!=null && ht_Data.size()>0)
	{
	%>
	<thead>
	<tr>
		<th width="70%" nowrap align="left"><egui:intnl text="<%=(String)objArr[5]%>" /></th>
		<th width="10%" nowrap ><egui:intnl text="reporter.common.Min" /></th>
		<th width="10%" nowrap ><egui:intnl text="reporter.common.Max" /></th>
		<th width="10%" nowrap ><egui:intnl text="reporter.common.Avg" /></th>
	</tr>
	</thead>
<%
						s_tit = key;
						vec1.add(intlmap.getTextDescription((String)objArr[5]));
						vec1.add(intlmap.getTextDescription("reporter.common.Min"));
						vec1.add(intlmap.getTextDescription("reporter.common.Max"));
						vec1.add(intlmap.getTextDescription("reporter.common.Avg"));
			while(itr.hasNext())
			{
				skey = (String)itr.next();
				Vector v_tmp = (Vector)ht_Data.get(skey);
				if (v_tmp.size()>0)
				{
					for(int k=0;k<v_tmp.size();k=k+2)
					{
						server=(String)v_tmp.get(k);
						Vector v_val=(Vector)v_tmp.get(k+1);
							lst_dat.add(server);
						for(int i=0; i<v_val.size();i=i+3)
						{
%>
	<tbody>
	<tr>
		<td align="left"><%=server%></td>
<%
							for(int j=i; j<i+3; j++)
							{
%>
			<td align="center"><%=v_val.get(j)%></td>
<%
					lst_dat.add(v_val.get(j));
}
%>
	</tr>
	</tbody>
<%
						}
					}
						ht.put(vec1,lst_dat);
						ht1.put(s_tit,ht);
						lst.add(ht1);
						vec1=new Vector();
						ht = new Hashtable();
						ht1 = new Hashtable();
						lst_dat = new LinkedList();
				}
			}
		}
	}
				else
				{
						lst.add(intlmap.getTextDescription("reporter.common.No measures available for the current selection"));
%>
	<tr>
		<td colspan="4">
			<table class="newimg" width='100%' height='100%'>
				<tr>
					<td align='center' valign='middle'><img src='/images/Light/nomeasures_custom.png' /></td>
				</tr>
			</table>
		</td>
	</tr>
<%
				}
%>
</table>
</div>
</BR>
<%
			session.setAttribute("ScheduleCSVData",lst);
		}
	}
	%>
	<%	}
	else
		{
%>
<%
			String qry = "";
			if(throughSchedule != null && throughSchedule.equalsIgnoreCase("true"))
			{
				qry = "/final/servlet/com.eg.ErRepoLiteC;jsessionid="+ session.getId() +"?optionType=graph&"+ qString +"&er_width=475&er_height=330&savePrint=yes";
			}
			else
			{
				qry = "/final/servlet/com.eg.ErRepoLiteC;jsessionid="+ session.getId() +"?"+ request.getQueryString() +"&optionType=graph&er_width=375&er_height=330";
			}
%>


<table width="100%">

<%

ArrayList hm=(ArrayList)session.getAttribute("QueryStringMap");

if(hm!=null)
{
	int erImgWidth = 460;
	String erTableWid ="100%";
	if(hm.size()<=1){
		erTableWid ="180%";
	}
	for(int y=0;y<hm.size();y++)
	{
		Object[] objArr = (Object[])hm.get(y);
		String key = (String)objArr[2];
		String chartIndex = (String)objArr[4];
		Hashtable val     =	(Hashtable)objArr[1];
		String qryString = (String)objArr[0]+"&chartIndex="+chartIndex;
		qry = "/final/servlet/com.eg.ErRepoLiteC;jsessionid="+ session.getId() +"?optionType=graph&"+ qryString +"&er_width="+erImgWidth+"&er_height=330&savePrint=yes";
		//for TOP-N Analysis Print and pdf Title
		if(key!=null)
			key = erUtils.specialCharDecode(key);
	%>
		<tr>
			<td align="left" width="450"colspan="" valign="top">
			<div class="printOuterBox">
				<div class="printOuterBoxHeader" ><span class=""><%=key%></span></div>
				<div style="height:330px;width:100%;padding:10px"><img src="<%=qry%>" /></div>
			</div>
			</td>

	<%
		y=y+1;
		if(y<hm.size())
		{
			objArr = (Object[])hm.get(y);
			key = (String)objArr[2];
			if(key!=null)
				key = erUtils.specialCharDecode(key);
			chartIndex = (String)objArr[4];
			qryString = (String)objArr[0]+"&chartIndex="+chartIndex;
			Hashtable val1 = (Hashtable)objArr[1];

			qry = "/final/servlet/com.eg.ErRepoLiteC;jsessionid="+ session.getId() +"?optionType=graph&"+ qryString +"&er_width="+erImgWidth+"&er_height=330&savePrint=yes";
	%>
			<td align="left" width="450" colspan="" valign="top" >
			<div class="printOuterBox">
				<div class="printOuterBoxHeader" ><span class=""><%=key%></span>
				<div style="height:330px;width:100%;padding:10px"><img src="<%=qry%>" /></div>
			</td>

	<%
		}
		
	%>
		</tr>
	<%
	}
}
%>

</table>
</div>
<%
		}
	}
%>

<!--</form>-->
<%
if(pdfPrint!=null && pdfPrint.equalsIgnoreCase("yes"))
{%>
	<div class="printFooterText"><%=strPrintFooterText%></div>

<%}
}
catch(Throwable e)
{
	e.printStackTrace();
}
%>
<%!
	public List getComponentsForUserNotAccessAllComponents(User thisuser)
	{
		ErComponentsUtils compUtils = new ErComponentsUtils(thisuser.getLoginID());
		Vector v_CompTemp = compUtils.getAllUserComponents1();
		List tmpList = new ArrayList(compUtils.getTypeModifyComponents(v_CompTemp,2));
		if(tmpList!=null && tmpList.size()>0)
		{
			List userCompList_host=new LinkedList();
			for(int r=0; r<tmpList.size(); r++)
			{
				String s = (String) tmpList.get(r);
				if(s!=null && !s.endsWith(":NULL"))
				{
					StringTokenizer st=new StringTokenizer(s,":");
					String ctype=st.nextToken();
					String cname=st.nextToken();
					if(ctype!=null && cname!=null && ctype.trim().length()>0 && cname.trim().length()>0)
						userCompList_host.add(ctype+":"+cname+":NULL");
				}
			}
			if(userCompList_host!=null && userCompList_host.size()>0)
				tmpList.addAll(userCompList_host);
		}
		return tmpList;
	}
	public int getColspanCount(ArrayList aListVariable,String subject,String strCompType)
	{
		EgReportInfo egReportInfo = new EgReportInfo("manager");
		EgSpecsInfo specsInfo = new EgSpecsInfo("manager");
		int returnVal=0;
		if(aListVariable!=null && aListVariable.size()>0)
		{
			for (int j = 0; j < aListVariable.size(); j++)
			{
				String strMeasureVariable = (String)aListVariable.get(j);
				if(strCompType!=null)
				{
					if(!strMeasureVariable.startsWith(strCompType) && !strMeasureVariable.startsWith("Default"))
						continue;
					else
					{
						StringTokenizer tok1 = new StringTokenizer(strMeasureVariable,":");
						String test="";
						if(tok1.countTokens()>2)
						{
							tok1.nextToken();
							test=tok1.nextToken();
						}
						if (!specsInfo.isTestRelevantForServer(strCompType,test))
						{
							continue;
						}
					}
				}
				String strValue=egReportInfo.getValue(subject,strMeasureVariable);
				if(strValue==null || strValue.equals(""))
					strValue = egReportInfo.getValue("SERVICES_REPORT",strMeasureVariable);
				if(strValue!=null && !strValue.equals(""))
				{
					StringTokenizer strToken = new StringTokenizer(strValue,",");
					returnVal+=strToken.countTokens();
				}
			}
		}
		return returnVal;
	}
	public String getEncodedQueryString(String queryString)
	{
		String qString ="";
		try{
		if(queryString!=null)
		{
			StringTokenizer strtok = new StringTokenizer(queryString,"&");
			while(strtok.hasMoreTokens())
			{
				String parameter = strtok.nextToken();
				int ind = parameter.indexOf("=");
				if (ind < 0)
					continue;
				String reqparam =parameter.substring(0,ind);

				String value = parameter.substring(ind+1);
				if(reqparam!=null&&reqparam.equals("er_timeline"))
				{
					value=com.eg.EgURLEncoder.encode(value, "UTF-8");
				}
				else if(reqparam!=null&&reqparam.equals("er_trgt"))
				{
					value=com.eg.EgURLEncoder.encode(value, "UTF-8");
				}
				else if(reqparam!=null&&reqparam.equals("er_trgttype"))
				{
					value=com.eg.EgURLEncoder.encode(value, "UTF-8");
				}
				else if(reqparam!=null&&reqparam.equals("er_time"))
				{
					value=com.eg.EgURLEncoder.encode(value, "UTF-8");
				}
				else if(reqparam!=null&&reqparam.equals("pdfTime"))
				{
					value=com.eg.EgURLEncoder.encode(value, "UTF-8");
				}
				else if(reqparam!=null&&reqparam.equals("er_priority"))
				{
					value=com.eg.EgURLEncoder.encode(value, "UTF-8");
				}
				else if(reqparam!=null&&reqparam.equals("er_uptimetest"))
				{
					value=com.eg.EgURLEncoder.encode(value, "UTF-8");
				}
				else if(reqparam!=null&&reqparam.equals("limitforbg"))
				{
					value=com.eg.EgURLEncoder.encode(value, "UTF-8");
				}
				else if(reqparam!=null&&reqparam.equals("er_stdate"))
				{
					value=com.eg.EgURLEncoder.encode(value, "UTF-8");
				}
				else if(reqparam!=null&&reqparam.equals("inidate"))
				{
					value=com.eg.EgURLEncoder.encode(value, "UTF-8");
				}
				else if(reqparam!=null&&reqparam.equals("er_enddate"))
				{
					value=com.eg.EgURLEncoder.encode(value, "UTF-8");
				}
				else if(reqparam!=null&&reqparam.equals("startdate"))
				{
					value=com.eg.EgURLEncoder.encode(value, "UTF-8");
				}
				else if(reqparam!=null&&reqparam.equals("enddate"))
				{
					value=com.eg.EgURLEncoder.encode(value, "UTF-8");
				}
				else if(reqparam!=null&&reqparam.equals("er_rtype"))
				{
					value=com.eg.EgURLEncoder.encode(value, "UTF-8");
				}
				else if(reqparam!=null&&reqparam.equals("inidate"))
				{
					value=com.eg.EgURLEncoder.encode(value, "UTF-8");
				}
				else if(reqparam!=null&&reqparam.equals("er_component"))
				{
					value=com.eg.EgURLEncoder.encode(value, "UTF-8");
				}else if(reqparam!=null&&reqparam.equals("subevent"))
				{
					value=com.eg.EgURLEncoder.encode(value, "UTF-8");
				}
				else if(reqparam!=null&&reqparam.equals("compNameList"))
				{
					value=com.eg.EgURLEncoder.encode(value, "UTF-8");
				}
				else if(reqparam!=null&&reqparam.equals("vw"))
				{
					value=com.eg.EgURLEncoder.encode(value, "UTF-8");
				}
				else if(reqparam!=null&&reqparam.equals("insubzone"))
				{
					value=com.eg.EgURLEncoder.encode(value, "UTF-8");
				}
				else if(reqparam!=null&&reqparam.equals("er_usertimeline"))
				{
					value=com.eg.EgURLEncoder.encode(value, "UTF-8");
				}
				else if(reqparam!=null&&reqparam.equals("userTimeline"))
				{
					value=com.eg.EgURLEncoder.encode(value, "UTF-8");
				}
				else if(reqparam!=null&&reqparam.equals("er_template"))
				{
					value=com.eg.EgURLEncoder.encode(value, "UTF-8");
				}
				else if(reqparam!=null&&reqparam.equals("er_userid") || reqparam.equals("eruserid") || reqparam.equals("userID") || reqparam.equals("uid") ||reqparam.equals("er_RmDispName") )
				{
					value=com.eg.EgURLEncoder.encode(value, "UTF-8");					
				}
				else if(reqparam!=null && reqparam.equals("strbg_id"))
				{
					value=com.eg.EgURLEncoder.encode(value, "UTF-8");
				}
				if(reqparam!=null&&(reqparam.equals("er_sthr") || reqparam.equals("chartformat") || reqparam.equals("st_date") || reqparam.equals("Minto") || reqparam.equals("stmin") || reqparam.equals("er_startmin") || reqparam.equals("throughSchedule") || reqparam.equals("scheduleType") || reqparam.equals("er_views") || reqparam.equals("endate") || reqparam.equals("enmin") || reqparam.equals("er_endhr")))
				{
					continue;
				}
				qString += reqparam+"="+value.trim()+"&";
			}
		}
		}catch(Exception e)
		{
			e.printStackTrace();
		}
		return qString;
	}
	public String getViewName(String viewReport, EgMappingInfo intlmp)
	{
		String view_name = "Component Name";
		if(viewReport != null && viewReport.equalsIgnoreCase("compName#compType#testName#severity"))
			view_name = intlmp.getTextDescription("reporter.common.Component Name")+", "+intlmp.getTextDescription("reporter.common.Type")+", "+intlmp.getTextDescription("reporter.common.Test")+" and "+intlmp.getTextDescription("reporter.common.Severity");
		else if(viewReport != null && viewReport.equalsIgnoreCase("compName#compType#testName"))
			view_name = intlmp.getTextDescription("reporter.common.Component Name")+", "+intlmp.getTextDescription("reporter.common.Type")+" and "+intlmp.getTextDescription("reporter.common.Test");
		else if(viewReport != null && viewReport.equalsIgnoreCase("compName#compType#severity"))
			view_name = intlmp.getTextDescription("reporter.common.Component Name")+", "+intlmp.getTextDescription("reporter.common.Type")+" and "+intlmp.getTextDescription("reporter.common.Severity");
		else if(viewReport != null && viewReport.equalsIgnoreCase("compName#testName#severity"))
			view_name = intlmp.getTextDescription("reporter.common.Component Name")+", "+intlmp.getTextDescription("reporter.common.Test")+" and "+intlmp.getTextDescription("reporter.common.Severity");
		else if(viewReport != null && viewReport.equalsIgnoreCase("compType#testName#severity"))
			view_name = intlmp.getTextDescription("reporter.common.Component Type")+", "+intlmp.getTextDescription("reporter.common.Test")+" and "+intlmp.getTextDescription("reporter.common.Severity");
		else if(viewReport != null && viewReport.equalsIgnoreCase("compName#compType"))
			view_name = intlmp.getTextDescription("reporter.common.Component Name")+" and "+intlmp.getTextDescription("reporter.common.Type");
		else if(viewReport != null && viewReport.equalsIgnoreCase("compName#testName"))
			view_name = intlmp.getTextDescription("reporter.common.Component Name")+" and "+intlmp.getTextDescription("reporter.common.Test");
		else if(viewReport != null && viewReport.equalsIgnoreCase("compName#severity"))
			view_name = intlmp.getTextDescription("reporter.common.Component Name")+" and "+intlmp.getTextDescription("reporter.common.Severity");
		else if(viewReport != null && viewReport.equalsIgnoreCase("compType#testName"))
			view_name = intlmp.getTextDescription("reporter.common.Component Type")+" and "+intlmp.getTextDescription("reporter.common.Test");
		else if(viewReport != null && viewReport.equalsIgnoreCase("compType#severity"))
			view_name = intlmp.getTextDescription("reporter.common.Component Type")+" and "+intlmp.getTextDescription("reporter.common.Severity");
		else if(viewReport != null && viewReport.equalsIgnoreCase("testName#severity"))
			view_name = intlmp.getTextDescription("reporter.common.Test")+" and "+intlmp.getTextDescription("reporter.common.Severity");
		else if(viewReport != null && viewReport.equalsIgnoreCase("compName"))
			view_name = intlmp.getTextDescription("reporter.common.Component");
		else if(viewReport != null && viewReport.equalsIgnoreCase("compType"))
			view_name = intlmp.getTextDescription("reporter.common.Component Type");
		else if(viewReport != null && viewReport.equalsIgnoreCase("testName"))
			view_name = intlmp.getTextDescription("reporter.common.Test");
		else if(viewReport != null && viewReport.equalsIgnoreCase("severity"))
			view_name = intlmp.getTextDescription("reporter.common.Severity");
		else
			view_name = intlmp.getTextDescription("reporter.common.Component Name");
		return view_name;
	}
	public String getColName(String viewReport,int k,String key)
	{
		String key1="";
		if(viewReport.equals("compName"))
		{
			if(k==1)
				key1 ="Name";
			if(k==2)
				key1 ="ALERTS";
		}
		if(viewReport.equals("compName#compType"))
		{
			if(k==1)
				key1 ="Type";
			if(k==2)
				key1 ="Name";
			if(k==3)
				key1 ="ALERTS";
		}
		if(viewReport.equals("testName#severity"))
		{
			if(k==1)
				key1 ="Test";
			if(k==2)
				key1 ="Severity";
			if(k==3)
				key1 ="Alerts";
		}
		if(viewReport.equals("compName#testName"))
		{
			if(k==1)
				key1 ="Name";
			if(k==2)
				key1 ="Test";
			if(k==3)
				key1 ="Alerts";
		}
		if(viewReport.equals("compName#severity"))
		{
			if(k==1)
				key1 ="Name";
			if(k==2)
				key1 ="Severity";
			if(k==3)
				key1 ="Alerts";
		}
		if(viewReport.equals("compType#severity"))
		{
			if(k==1)
				key1 ="Type";
			if(k==2)
				key1 ="Severity";
			if(k==3)
				key1 ="Alerts";
		}
		if(viewReport.equals("compName#compType#severity"))
		{
			if(k==1)
				key1 ="Type";
			if(k==2)
				key1 ="Name";
			if(k==3)
				key1 ="Severity";
			if(k==4)
				key1 ="Alerts";
		}
		if(viewReport.equals("compName#compType#testName"))
		{
			if(k==1)
				key1 ="Type";
			if(k==2)
				key1 ="Name";
			if(k==3)
				key1 ="Test";
			if(k==4)
				key1 ="Alerts";
		}
		if(viewReport.equals("compType#testName#severity"))
		{
			if(k==1)
				key1 ="Type";
			if(k==2)
				key1 ="Test";
			if(k==3)
				key1 ="Severity";
			if(k==4)
				key1 ="Alerts";
		}
		if(viewReport.equals("compName#testName#severity"))
		{
			if(k==1)
				key1 ="Name";
			if(k==2)
				key1 ="Test";
			if(k==3)
				key1 ="Severity";
			if(k==4)
				key1 ="Alerts";
		}
		if(viewReport.equals("compName#compType#testName#severity"))
		{
			if(k==1)
				key1 ="Type";
			if(k==2)
				key1 ="Name";
			if(k==3)
				key1 ="Test";
			if(k==4)
				key1 ="Severity";
			if(k==5)
				key1 ="Alerts";
		}
		if(viewReport.equals("compType")|| viewReport.equals("testName")|| viewReport.equals("severity")|| viewReport.equals("compType#testName"))
		{
			key1=key;
		}
		if(viewReport.equals("compType#testName"))
		{
			if(k==1)
				key1="Type";
			if(k==2)
				key1="Test";
			if(k==3)
				key1="Alerts";
		}
		if(key1==null || (key1!=null && key1.equals("")))
			key1=key;
		return key1;
	}

%>

</body>
</html>

<%@ include file="ErRemoveUser.jsp"%>
<%
// karthikeyan 

	 if(titleToDisplay!=null && !titleToDisplay.isEmpty())
	{
	//For Setting the PDf File Name
	String reportFileName=customReplaceAll(titleToDisplay," ","_");
	HashMap paramVal =new HashMap();
	paramVal.put("fileName",reportFileName);
	session.setAttribute("parameters", paramVal);
	}

%>
<%!
	// karthikeyan 
    public  String customReplaceAll(String source,String toReplace,String replacement) {
        int idx = source.lastIndexOf(toReplace);
        if (idx != -1) {
            StringBuffer ret = new StringBuffer(source);
            ret.replace(idx, idx + toReplace.length(), replacement);
            while ((idx = source.lastIndexOf(toReplace, idx - 1)) != -1) {
                ret.replace(idx, idx + toReplace.length(), replacement);
            }
            source = ret.toString();
        }
        return source;
    }
    //
%>
<%!
	private void getDataChange(Hashtable dataMap, String reportType)		// For Bug Id : 10813 and 10811
	{
		Set<String> set = dataMap.keySet();
		List list = new ArrayList(set);
		List filterList = new ArrayList();
		Vector dataVec = null;
		Vector dumm = new Vector();
		dumm.add("dummy");
		for(int i=1;i<15;i++)
			dumm.add(-5.0f);
		if(reportType.equals("zone"))
		{
			for(int v=0;v<list.size();v++)
			{
				String s = (String)list.get(v);
				dataVec = (Vector)dataMap.get(s);	
				//dataVec.add(dumm);
				Iterator itr = dataVec.iterator();
				int serverIndex = 0;
				while(itr.hasNext())
				{
					Vector vct = (Vector)itr.next();
					ArrayList dataList = new ArrayList(vct);				
					int filterCount = 0;
					int dataListCount = dataList.size();
					for(int i=1;i<dataListCount;i++)
					{
						Float data = (Float)dataList.get(i);
						if(data == -5.0)
						{
							filterCount++;
						}
					}
					if((dataListCount-1) == filterCount)
					{					
						itr.remove();
					}
					serverIndex++;
				}										
			}
		}
		else if(reportType.equals("user_Session"))
		{
			for(int v=0;v<list.size();v++)
			{
				String s = (String)list.get(v);
				List dataList = (ArrayList)dataMap.get(s);
				int lstCount = dataList.size();
				int count = 0;
				for(int i=0; i < lstCount;i++)	
				{
					String data = (String)dataList.get(i);
					if(data.equals("-"))
					{
						count++;
					}
				}
				if(lstCount == count)
				{
					dataMap.remove(s);
				}
			}
		}
				
	}

	public String getString(String state, String Time,EgMappingInfo intlmp)
	{
		String retStr = state+" : "+Time+" "+intlmp.getTextDescription("reporter.common.hrs");
		return retStr;
	}
	public JSONObject processSplitUpDetails(String logon_duration_splitup, EgMappingInfo intlmp, int totalColumn,List lst_dat1)
	{
		JSONObject returnObj = null;
		if(logon_duration_splitup==null)
		{
			return returnObj;
		}
		StringTokenizer strTkns = new StringTokenizer(logon_duration_splitup,"#");
		String testName = null;
		if(strTkns.hasMoreTokens())
		{
			testName = strTkns.nextToken();
		}
		if(testName!=null)
		{
			ErUtils erUtils = new ErUtils();
			returnObj = new JSONObject();
			lst_dat1.add("");
			lst_dat1.add("");
			int dummy = 2;
			while(strTkns.hasMoreTokens())
			{
				String splitUpStr = strTkns.nextToken();
				if(splitUpStr.indexOf("$")>-1)
				{
					String heading  = splitUpStr.substring(0,splitUpStr.indexOf("$"));
					lst_dat1.add(intlmp.getTextDescription("reporter.common."+heading)+" (secs)");
					lst_dat1.add("");
					lst_dat1.add("");
					dummy=dummy+3;
				}
			}
			while(dummy<totalColumn)
			{
				lst_dat1.add("");
				dummy++;
			}
			strTkns = new StringTokenizer(logon_duration_splitup,"#");
			ArrayList totalList = new ArrayList();
			int maxVal = 0;
			while(strTkns.hasMoreTokens())
			{
				String splitUpStr = strTkns.nextToken();
				if(splitUpStr.indexOf("$")>-1)
				{
					ArrayList splitUpList = new ArrayList();
					String heading  = splitUpStr.substring(0,splitUpStr.indexOf("$"));
					splitUpStr  = splitUpStr.substring(splitUpStr.indexOf("$")+1);
					StringTokenizer str_Tkns = new StringTokenizer(splitUpStr,",");
					JSONObject valObj = new JSONObject();
					while(str_Tkns.hasMoreTokens())
					{
						String column_val = str_Tkns.nextToken();
						String column = column_val.substring(0,column_val.indexOf("@"));
						String val = column_val.substring(column_val.indexOf("@")+1);
						try 
						{
							val = erUtils.round(Float.parseFloat(val),2);
						}
						catch(Exception e)
						{
							val = "-";
						}
						splitUpList.add(intlmp.getMeasureDescription(testName,column));
						splitUpList.add(val);
						valObj.put(intlmp.getMeasureDescription(testName,column),val);
					}
					totalList.add(splitUpList);
					returnObj.put(intlmp.getTextDescription("reporter.common."+heading)+" (secs)",valObj);
					if(splitUpList.size()>maxVal)
					{
						maxVal = splitUpList.size();
					}
				}
			}
			for(int i=0;i<maxVal;i+=2)
			{
				lst_dat1.add("");
				lst_dat1.add("");
				dummy = 2;
				for(int j=0;j<totalList.size();j++)
				{
					ArrayList splitUpList = (ArrayList)totalList.get(j);
					if(splitUpList.size()>i)
					{
						lst_dat1.add(splitUpList.get(i));
						lst_dat1.add(splitUpList.get(i+1));
					}
					else
					{
						lst_dat1.add("");
						lst_dat1.add("");
					}
					lst_dat1.add("");
					dummy = dummy+3;
				}
				while(dummy<totalColumn)
				{
					lst_dat1.add("");
					dummy++;
				}
			}
		}
		return returnObj;
	}
%>
<%!
	public String getConnectionQulityString(double dd)
	{
		String strReturn ="";
		if(dd>0 && dd==1.0)
			strReturn = "Poor connection";
		else if(dd>0 && dd==2.0)
			strReturn = "Weak connection";
		else if(dd>0 && dd==3.0)
			strReturn = "Strong connection";
		else
			strReturn = "None";
		return strReturn;

	}
%>