<!DOCTYPE html>
<%
/***********************************************************************************************************
*	File name		:	ErMeasureData.jsp
*	Purpose			:	This page Handles a single Line chart Data Display partF
*	Version			:	Reporter 1.0
*	Creation Date	:	29/01/2003 - (dd/mm/yyyy)
*	Author			:	
*	Last Modified	:	19/07/2004 - M.Saravanan - Icon Added
*							22/10/2003 - Karthick Snap shot specific changes
*							13/11/2003 - Gopi Multiple thresholding indication using up and down gifs
*							7/12/05    - Citrix Report Changes
*							01-03-2006 - James Thomas - saveInCSVFormat() javascript function included
*
***********************************************************************************************************/
%>
<%@ taglib prefix="egui" uri="../WEB-INF/eg-taglib.tld" %>
<%@ include file = "ErTracker.jsp"%>
<%@ page import="java.util.*"%>
<%@ page import = "java.text.*" %>
<%@ page import ="com.eg.EgDateInfo"%>
<%@ page import ="com.eg.EgTablesInfo" %>
<%@ page import ="com.eg.EgDbInfo" %>
<%@ page import ="com.eg.EgInstallInfo" %>
<%@ page import ="egurkha.reporter.*"%>
<%@ page import ="com.egurkha.ini.*" %>
<%@ page import ="com.eg.EgReportInfo" %>
<%@ page import ="com.eg.EgMappingInfo" %>
<%@ page import ="java.net.URLEncoder" %>
<%@ page import ="java.net.URLDecoder" %>
<%@ page import ="com.egurkha.util.DateTimeTokenizer" %>
<%@ page import = "com.egurkha.util.DateUtil" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ page import="com.egurkha.util.StringUtils"%>

<%
	String titleToDisplay=request.getParameter("er_RmDispName");
	
try{
	List lst = new LinkedList();
	if (!StringUtils.isNull(titleToDisplay)){ 
		lst.add(titleToDisplay);
	}
	EgMappingInfo intlmap = new EgMappingInfo(thisuser.getLanguage());
	String s_test_mes =" ";
	Vector vec = new Vector();
	List lst_dat = new LinkedList();
	Hashtable sen = new Hashtable();
	Hashtable ht = new Hashtable();
	Hashtable userInfo=null;
	String s_mes_unit = new String();
	String t="";
	String disname="";
	String startDateTime="";
	String endDateTime="";
	String uiFile = "eg_ui.ini";
	String s_iniFile_dir = EgInstallInfo.getInstallDir()+ "/manager/config/";
	com.eg.IniFile egUI = new com.eg.IniFile(s_iniFile_dir + uiFile);
	String currentDateFormat = strUserDateFormat;

	ErUtils utils = new ErUtils();

	EgTimeZoneConverter timeZoneConverterStart = null;
	EgTimeZoneConverter timeZoneConverterEnd = null;
	String startDateForDisplay =null;
	String startHourForDisplay = null;
	String startMinForDisplay = null;
	String endDateForDisplay =null;
	String endHourForDisplay = null;
	String endMinForDisplay = null;
	
	UBean = new ErUserData(urs,false);
	EgDateInfo egDt = new EgDateInfo();
	ErReqData erd = new ErReqData(request);
	EgTablesInfo tablesInfo = new EgTablesInfo("manager");
	IniUI iniui = IniUI.getInstance();
	EgDbInfo Dbdata = new EgDbInfo("manager");
	EgReportInfo reportInfo = new EgReportInfo("manager");
	Hashtable hash_data = (Hashtable)request.getAttribute("reportData");
	Vector v_infos = (Vector) request.getAttribute("infos");
	Vector v_in = (Vector) request.getAttribute("infoname");
	Object vdate = (Object)request.getAttribute("xdates");

	Hashtable v_date = new Hashtable();
	Vector v_dates = new Vector();
	if (vdate instanceof Hashtable)
		v_date = (Hashtable)request.getAttribute("xdates");
	else 
		v_dates = (Vector)request.getAttribute("xdates");

	Vector mhost_v_date = new Vector();
	Vector mhost_v_dates = new Vector();
	Vector mhost = new Vector();
	Vector mhost_data = new Vector();
	Hashtable[] h_data=null;
	int wsize=100;
	Vector datakey = new Vector();

	if (vdate instanceof Hashtable)
	{
		if (v_date!=null)
		{
			Enumeration enu = v_date.keys();
			while(enu.hasMoreElements())
			{
				String datekey = (String)enu.nextElement();
				String str_mhost = datekey;
				if(datekey.lastIndexOf("(")>-1)
					str_mhost = datekey.substring(datekey.lastIndexOf("("),datekey.length());
				if(!mhost.contains(str_mhost))
					mhost.addElement(str_mhost);
				mhost_v_date = (Vector)v_date.get(datekey);
				Collections.sort(mhost_v_date);
				mhost_v_dates.addElement(mhost_v_date.clone());
				mhost_v_date.clear();
			}
			if(mhost.size()>1)
			{
				Hashtable m_h_data = new Hashtable();
				Enumeration en = hash_data.keys();
				while(en.hasMoreElements())
				{
					datakey.add((String)en.nextElement());
				}
				for(int k=0;k<mhost.size();k++)
				{
					m_h_data=new Hashtable();
					String datak = (String)datakey.elementAt(k);
					String kee = datak.substring(datak.lastIndexOf("("),datak.length());
					m_h_data.put(kee,(Hashtable)hash_data.get(datak));
					mhost_data.addElement(m_h_data.clone());
				}

				Vector info = new Vector();
				for(int k=0;k<v_infos.size();k++)
				{
					String infos = (String)v_infos.get(k);
					infos = (infos.substring(0,infos.lastIndexOf("("))).trim();
					if(!info.contains(infos))
						info.add(infos);
				}
				v_infos.clear();
				v_infos = info;
				if(v_infos!=null && v_infos.size()>1)
				{
					mhost_data = new Vector();
					for(int k=0;k<v_infos.size()*mhost.size();k++)
					{
						m_h_data=new Hashtable();
						if (datakey.size() > k){
							String datak = (String)datakey.elementAt(k);
							m_h_data.put(datak,(Hashtable)hash_data.get(datak));
							mhost_data.addElement(m_h_data.clone());
						}
					}
				}
				if(v_infos.size()!=0)
					wsize  = 100/(v_infos.size()+1);
				// upto here
			}
			else if(v_infos!=null && mhost.size()==1)
			{
				h_data = new Hashtable[v_infos.size()];
				for(int i =0;i<v_infos.size();i++)
				{
					h_data[i] = (Hashtable)hash_data.get((String)v_infos.elementAt(i));
				}
				if(v_infos.size()!=0)
					wsize  = 100/(v_infos.size()+1);
				mhost_data.addElement(h_data.clone());
			}
		}
	}
	else
	{
		if(v_infos!=null)
		{
			h_data = new Hashtable[v_infos.size()];
			for(int i =0;i<v_infos.size();i++)
			{
				h_data[i] = (Hashtable)hash_data.get((String)v_infos.elementAt(i));
			}
			if(v_infos.size()!=0)
				wsize  = 100/(v_infos.size()+1);
		}
	}
	String forReport = request.getParameter("er_rtype");
	String Strrange =  request.getParameter("Range");
	String server=request.getParameter("select_server");
	/*if(Strrange!=null&&Strrange.indexOf("-")>-1)
	{
		StringTokenizer strange = new StringTokenizer(Strrange,"-");
		Strrange =strange.nextToken().trim()+"-"+strange.nextToken().trim();
		
	}*/
	if(Strrange!=null&&Strrange.indexOf("-")>-1)
	{
		if(Strrange.indexOf("\\n")>-1)
		{
			String sub = Strrange.substring(0,Strrange.indexOf("\\n"));
			sub+="-"+Strrange.substring(Strrange.lastIndexOf("\\n")+2,Strrange.length());
			Strrange = sub;
		}
		else
		{
			StringTokenizer strange = new StringTokenizer(Strrange,"-");
			Strrange = strange.nextToken().trim()+"-"+strange.nextToken().trim();
		}
	}
	Hashtable Rep_data = null;
	Hashtable ht_avg = null;
	Hashtable cpRange = null;
	Vector appData = null;
	Vector appUserData = null;
	Map  ht_data=null;
	Hashtable RangeServer=null;
	Vector v_data1=null;
	if(forReport!=null && forReport.equals("Farm"))
	{
		Rep_data = (Hashtable)request.getAttribute("Farm_Data");
		RangeServer = (Hashtable)request.getAttribute("ServerRange");
		ht_avg = (Hashtable)request.getAttribute("Average");
		cpRange = (Hashtable)request.getAttribute("compRange");
	}
	else if(forReport!=null && forReport.equals("CtxApplication"))
	{
		appData = (Vector)request.getAttribute("App_data");
		cpRange = (Hashtable)request.getAttribute("compRange");
		appUserData = (Vector)request.getAttribute("appUserData");
	}
	else if(forReport!=null && forReport.equals("Session"))
	{
		ht_data = (Hashtable)request.getAttribute("Report_data");
		v_data1 = (Vector)request.getAttribute("Report_data1");
		cpRange = (Hashtable)request.getAttribute("sessionChartDdata");
		userInfo = (Hashtable)request.getAttribute("userChartData");
	}else if(forReport!=null && forReport.equals("CtxUserActivity"))
	{
		appData = (Vector)request.getAttribute("App_data");
		cpRange = (Hashtable)request.getAttribute("compRange");
		appUserData = (Vector)request.getAttribute("appUserData");
	}
	long value1=0;
	if(erd.s_timeline!=null && !erd.s_timeline.equals("Any"))
	{
		int blankSpaceIndex = erd.s_timeline.indexOf(DateTimeTokenizer.BLANK_SPACE);
		if (blankSpaceIndex > 0)
		{
			SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy HH:mm");
			java.util.Date today = new java.util.Date();
			Calendar temp1 = new GregorianCalendar();
			temp1.setTime(today);
			temp1.add(Calendar.DATE,-1);
			temp1.add(Calendar.HOUR_OF_DAY,0);
			java.util.Date  edate = temp1.getTime();
			long lo_temp =edate.getTime();
			endDateTime = egDt.egetDate(lo_temp);
			endDateTime = DateUtil.changeDateFormat(endDateTime,"dd/MM/yyyy HH:mm","MM/dd/yyyy HH:mm:ss");

			value1 = Integer.parseInt(erd.s_timeline.substring(0, blankSpaceIndex));
			String unit = erd.s_timeline.substring(blankSpaceIndex+1).toLowerCase();
			if (unit.startsWith("h"))
			{//hours
				value1 *= 3600;
			}
			else if (unit.startsWith("d"))
			{//days
				value1 *= (24 * 3600);
			}
			else if (unit.startsWith("w"))
			{//weeks
				value1 *= (7 * 24 * 3600);
			}
		}
	}
	String timeline = String.valueOf(value1);
	String dataFor = request.getParameter("dataFor");
		//
				String er_option =request.getParameter("er_option");
				String er_site = request.getParameter("er_site");
				String headerKeyName="";
					if(er_option!=null && er_option.equalsIgnoreCase("Segment"))
					{
					headerKeyName=er_option+" : "+er_site;
					}
					else if(er_option!=null && er_option.equalsIgnoreCase("Service"))
					{
					headerKeyName=er_option+" : "+er_site;
					}
					else if(er_option!=null && er_option.equalsIgnoreCase("Group"))
					{
					headerKeyName=er_option+" : "+er_site;
					}
					else if(er_option!=null && er_option.equalsIgnoreCase("Component"))
					{
						if(request.getParameter("er_compType")!=null)
						headerKeyName=er_option+" : "+request.getParameter("er_compType");
						else if(request.getParameter("er_select_server")!=null)
						headerKeyName=er_option+" : "+request.getParameter("er_select_server");
						else
						headerKeyName=er_option;
					}
					else
					{
						headerKeyName="Zone"+" : "+request.getParameter("select_farm");
					}
	//
%>
<!Doctype html>
<head>
<title><egui:intnl text="reporter.common.Reporter"/>  -<egui:intnl text="reporter.common.Measure Data"/></title>

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

<!--<link rel="stylesheet" type="text/css" href="/final/styles/eGLightTheme.css" />
<link rel="stylesheet" type="text/css" href="/final/styles/eGLightThemeIcons.css" />-->
	<link rel="stylesheet" type="text/css" href="../../final/reporter/styles/printpagestyle.css" />
	<link rel="stylesheet" type="text/css" href="/final/resources/css/ext-eg.css" />
		<link rel="stylesheet" type="text/css" href="/final/styles/eGLightTheme.css" />
		<link rel="stylesheet" type="text/css" href="/final/styles/eGLightThemeIcons.css" />

<style type="text/css" media="print">
#printbt{ display:none}
</style>

<script language="JavaScript1.2" src="../reporter/scripts/er_reporter.js"></script>
<script language="JavaScript1.2" src="../reporter/scripts/er_images.js"></script>
<script language="JavaScript1.2" src="../scripts/<%=script_src%>"></script>
<script language="JavaScript1.2">

function saveInCSVFormat()
{
	window.location.href="../servlet/egurkha.reporter.SaveInCSVFormat","CSVFormat","width=1012,height=603,left=0,top=105,scrollbars=1,scrollbars=yes,resizable=yes";
}

function closeParendWidow()
{
	if(window.parent.Ext.getCmp('maximizeDataWindowLightBox')!=undefined)
		window.parent.Ext.getCmp('maximizeDataWindowLightBox').doClose();
	else if(window.parent.Ext.getCmp('popupprint')!=undefined)
		window.parent.Ext.getCmp('popupprint').doClose(); 
	else if(window.parent.Ext.getCmp('dataWin')!=undefined)
		window.parent.Ext.getCmp('dataWin').doClose(); 
}


</script>

<script language="JavaScript1.2" src="../reporter/scripts/er_images.js"></script>
<script language="JavaScript1.2" src="../scripts/<%=script_src%>"></script>
<script src="/final/scripts/DD_roundies_0.0.2a-min.js"  type='text/javascript'></script>
<script type="text/javascript" src="../extjs/ext-all.js" ></script>
<script language="JavaScript1.2">
DD_roundies.addRule('.box', 5, true);
</script>
</head>

<!--<body  style="padding:10px;">-->
<body marginwidth="0" marginheight="0" bgcolor="#FFFFFF" style="padding:0px 10px 10px 10px;margin-top:40px">


<!--<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center"  style="border-bottom:1px solid #999;">
	<tr>
		<td style="padding:2px" class="newLineBottom"> -->

				<!--<script>
					var er_history = history.length;
					if (er_history > 1)
					{
						document.write("<td class='cellbgdark'><a href='javascript:history.back();' onMouseOver='back.src=imgon5.src' on MouseOut='back.src=imgoff5.src'><img src='../reporter/icons/back.gif' border='0' alt='<egui:intnl text='reporter.common.BACK'/>' title='<egui:intnl text='reporter.common.BACK'/>' hspace='8' name='back'></a></td>");
						document.write("<td class='cellbgdark' NOWRAP align='left'><a href='javascript:history.forward();' onMouseOver='forward.src=imgon6.src' onMouseOut='forward.src=imgoff6.src'><img src='../reporter/icons/forward.gif' border='0' alt='<egui:intnl text='reporter.common.FORWARD'/>' title='<egui:intnl text='reporter.common.FORWARD'/>' hspace='8' name='forward'></a></td>");
					}
				</script>-->
	<div class="printHeaderBox"  style="padding-right:20px;position:fixed;top:0px;">

<%
	if (!StringUtils.isNull(titleToDisplay))
	{
%>
			<!--<div style="float:left" > <header><%=titleToDisplay%></header></div>-->
			<div class="printHeaderBoxTitle"><%=titleToDisplay%></div>
<%
	}
	else
	{
%>
			<div style="float:left" > <egui:intnl text="reporter.common.REPORTER DATA"/></div>
<%
	}
			String isKpiHealthReport=request.getParameter("isKpiHealthReport");

%>
			<div style="float:right;margin:0px 0px 0px 5px"><img class="mouse" src="/final/images/Light/newPopupWindowClose.png" border="0" onClick="javascript:closeParendWidow();" /></div>

			<div style="float:right;margin:0px 5px 0px 5px;width:2px;height:16px" class="newLineRight"></div> 

			<div style="float:right;margin:0px 5px 0px 5px"><img class="iconCsv mouse" src="data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" border="0" onClick="javascript:saveInCSVFormat();" alt='<egui:intnl text="reporter.common.CSV"/>' title='<egui:intnl text="reporter.common.CSV"/>'/></div>

			<div style="float:right;margin:0px 5px 0px 5px"><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 style="float:left;padding-left:5px"><img class="iconPrinter mouse"  id="prin tbt" src="data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" border="0" onClick="javascript:window.print()" alt='<egui:intnl text="reporter.common.PRINT"/>' title='<egui:intnl text="reporter.common.PRINT"/>'/></div>

			<div  style="float:left"><img id="cvs" class="iconCsv mouse" src="data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" border="0" onClick="javascript:saveInCSVFormat();" alt='<egui:intnl text="reporter.common.CSV"/>' title='<egui:intnl text="reporter.common.CSV"/>'/></div>-->
		<!--</td>
	</tr>
</table>-->
</div>
		<!-- DON'T EVER TOUCH ANY PART OF HTML CODE ABOVE THIS COMMENT -->
<%
	//If MeasureData is Hashtable Object
	if (vdate instanceof Hashtable) //Snapshot DATA,MEASURES Page Data
	{
%>
<!--<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" style="border-bottom:1px solid #ccc;">
	<tr>
		<td align="left" valign="top">-->
	<div class="printOuterBoxNoBorder">
<%
		String s_type = request.getParameter("er_gtype");
		String DispS_type = s_type;
		if(s_type != null && (s_type.equalsIgnoreCase("intersnap") || s_type.equalsIgnoreCase("intrasnap")) ) {
			s_type="Intersnap";
			DispS_type="Snapshot";
			if(isKpiHealthReport != null && isKpiHealthReport.equalsIgnoreCase("true"))
				DispS_type="KPI Report";
		}

		if(s_type!=null&&s_type.equals("Citrix")) //Set Title For Operation and Measure Data Report
		{
			if(forReport!=null && forReport.equalsIgnoreCase("Farm"))
			{
				String type = request.getParameter("er_check");
				if(type!=null && type.equals("operation"))
				{
					lst.add(" Operation Data for "+request.getParameter("select_farm"));
%>
			<!--<div style="clear:both;float:left;padding:4px;">
				<div style="float:left" class="formLabel"><egui:intnl text="reporter.common.Operation Data for"/></div>
				<div style="float:left;width:10px" align="center" >-</div>
				<div style="float:left;" class="formValue"><%= request.getParameter("select_farm")%> </div>
			</div>-->
				<div class="printSelectionFields" ><egui:intnl text="reporter.common.Operation Data for"/>- <span class="bold"><%=	request.getParameter("select_farm")%></span></div>

<%
				}
				else
				{
					lst.add(DispS_type+" Data for "+request.getParameter("select_farm"));
%>
			<!--<div style="clear:both;float:left;padding:4px;">
				<div style="float:left" class="formLabel"><%= DispS_type%>&nbsp;<egui:intnl text="reporter.common.Data for"/></div>
				<div style="float:left;width:10px" align="center" >-</div>
				<div style="float:left;" class="formValue"><%= request.getParameter("select_farm")%></div>
			</div>-->
				<div class="printSelectionFields" ><%= DispS_type%><egui:intnl text="reporter.common.Data for"/>- <span class="bold"><%= request.getParameter("select_farm")%></span></div>

<%
				}
			}
			else
			{
				if(request.getParameter("comeFrom")==null)
				{
					String printTest="";
					if(request.getParameter("select_testmes")!=null)
					{
						if(request.getParameter("er_test").indexOf("Ctx")>-1)
							printTest="Thin Client";
						if(request.getParameter("er_test").indexOf("Term")>-1)
							printTest="Thin Client";
					}
%>
			<!--<div style="clear:both;float:left;padding:4px;">
				<div style="float:left" class="formLabel"><egui:intnl text='<%="reporter.common."+printTest%>'/></div>
				<div style="float:left;width:10px" align="center" >&nbsp;</div>
				<div style="float:left;" class="formValue"><egui:intnl text="reporter.common.Data for"/>-&nbsp;<%= request.getParameter("select_farm")%></div>
			</div>-->
			<div class="printSelectionFields" ><egui:intnl text='<%="reporter.common."+printTest%>'/>- <span class="bold"><egui:intnl text="reporter.common.Data for"/>-&nbsp;<%= request.getParameter("select_farm")%></span></div>
<%
						lst.add(printTest+" Data for "+request.getParameter("select_farm"));
				}
			}
		}
		else
		{
%>
<%
			if("Micro".equalsIgnoreCase(request.getParameter("er_rtype")) && "CitrixUser".equalsIgnoreCase(request.getParameter("er_trgttype")))
			{
				lst.add(DispS_type+" Data for "+request.getParameter("er_component"));				
				String temp_user = request.getParameter("er_user");
				if(temp_user == null) {
					temp_user = request.getParameter("er_tuser");
				}
				String discomp= request.getParameter("er_component");
				if(discomp!=null && discomp.endsWith(":NULL"))
					discomp = discomp.substring(0,discomp.indexOf(":"));
%>
			<!--<div style="clear:both;float:left;padding:4px;">
				<div style="float:left" class="formLabel"><%=DispS_type%>&nbsp;<egui:intnl text="reporter.common.Data for Farm"/></div>
				<div style="float:left;width:10px" align="center" >-</div>
				<div style="float:left;" class="formValue"><%=request.getParameter("select_farm")%></div>
			</div>-->
			<div class="printSelectionFields" ><%=DispS_type%>&nbsp;<egui:intnl text="reporter.common.Data for Farm"/> - <span class="bold"><%=request.getParameter("select_farm")%></span></div>

			<!--<div style="clear:both;float:left;padding:4px;">
				<div style="float:left" class="formLabel"><egui:intnl text="reporter.common.Component"/></div>
				<div style="float:left;width:10px" align="center" >:</div>
				<div style="float:left;" class="formValue"><%=discomp%></div>
			</div>-->
			<div class="printSelectionFields" ><egui:intnl text="reporter.common.Component"/> - <span class="bold"><%=discomp%></span></div>

			<!--<div style="clear:both;float:left;padding:4px;">
				<div style="float:left" class="formLabel"><egui:intnl text="reporter.common.User"/></div>
				<div style="float:left;width:10px" align="center" >:</div>
				<div style="float:left;" class="formValue"><%=temp_user%></div>
			</div>-->
			<div class="printSelectionFields" ><egui:intnl text="reporter.common.User"/>- <span class="bold"><%=temp_user%></span></div>
<%
			}
			else
			{
%>
		<!--	<div style="clear:both;float:left;padding:4px;">
				<div style="float:left" class="formLabel"><%=DispS_type%>&nbsp;<egui:intnl text="reporter.common.Data for"/></div>
				<div style="float:left;width:10px" align="center" >&nbsp;</div>													  -->
			
			   <div class="printSelectionFields" ><%=DispS_type%>&nbsp;<egui:intnl text="reporter.common.Data for"/>-

							
<%			String isOnlyVMAssigned=request.getParameter("isOnlyVMAssigned");
				if(isOnlyVMAssigned==null || isOnlyVMAssigned.equals(""))
					isOnlyVMAssigned="false";	
				if(isOnlyVMAssigned!=null && isOnlyVMAssigned.equalsIgnoreCase("true"))
				{
				String vm=request.getParameter("er_info_list");
%>
			<!--	<div style="float:left;" class="formValue"><%=vm%></div>
			</div>-->
			 <span class="bold"><%=vm%></span></div>
<%
				}
				else
				{
					String strcomp=request.getParameter("er_component");
					String hasMultipleHosts=request.getParameter("hasMultipleHosts");
					String er_hostNames=request.getParameter("er_hostNames");
					String er_rtype=request.getParameter("er_rtype");
					String strdisp="";
					String st_comptype="";
					if(strcomp !=null && strcomp.indexOf(":NULL")>-1)
					{
						strdisp = strcomp.substring(0,strcomp.indexOf(":NULL"))+strcomp.substring(strcomp.indexOf(":NULL")+5);
					}
					if(strcomp !=null && strcomp.indexOf(":")>-1){

						strdisp= strcomp.substring(0,strcomp.indexOf(":"));
						st_comptype = strcomp.substring(strcomp.lastIndexOf(":")+1);
						strdisp = strdisp+":"+intlmap.getComponentTypeDescription(st_comptype);
					}else{
						strdisp = strcomp;
					}	
					if(er_rtype!=null && er_rtype.equals("TCR"))
					{
				%>
							<!--<div style="float:left;" class="formValue"><%=strcomp%></div>
						</div> -->
						 <span class="bold"><%=strcomp%></span></div>
				<%
					}
					else
					{
						if(hasMultipleHosts != null && hasMultipleHosts.equalsIgnoreCase("true") && er_hostNames != null && !er_hostNames.equalsIgnoreCase("")){
							er_hostNames=StringUtils.replace(er_hostNames,"|",", ");
				%>

							<span class="bold"><%=er_hostNames%></span></div>
				<%
						}else{
				%>
							<!--<div style="float:left;" class="formValue"><%=strdisp.substring(0,strdisp.indexOf(":")+1)%>&nbsp;<egui:intnl type='<%= strdisp.substring(strdisp.indexOf(":")+1)%>'/></div>
						</div> -->
							<span class="bold"><%=strdisp.substring(0,strdisp.indexOf(":")+1)%>&nbsp;<egui:intnl type='<%= strdisp.substring(strdisp.indexOf(":")+1)%>'/></span></div>
				<%		
						}
					}
				
	
					lst.add(DispS_type+" Data for "+strdisp.substring(0,strdisp.indexOf(":")+1)+intlmap.getComponentTypeDescription(strdisp.substring(strdisp.indexOf(":")+1)));
				}
			}
		}
%>
		<!--</td>
		<td align="right" valign="top">-->
<%
		String dispStartDate = erd.s_stdate;
		String dispEndDate   = erd.s_enddate;
		String strhrmin  = request.getParameter("startmin");
		String enhrmin   = request.getParameter("endmin");
		String starttimeformat = dispStartDate.trim()+ " " +erd.s_sthr+":"+strhrmin+" "+"Hrs ";
		String endtimeformat   = dispEndDate.trim()+ " " +erd.s_endhr+":"+enhrmin+" Hrs ";
		String convertStartDate="";
		String convertEndDate="";
		
		if(dispStartDate!=null)
		{
			timeZoneConverterStart = new EgTimeZoneConverter(dispStartDate+" "+erd.s_sthr+":"+strhrmin+":00",thisuser);
			convertStartDate = timeZoneConverterStart.getDateTime()+" "+intlmap.getTextDescription("reporter.common.hrs");
		}
		if(dispEndDate!=null)
		{
			timeZoneConverterEnd = new EgTimeZoneConverter(dispEndDate+" "+erd.s_endhr+":"+enhrmin+":"+"00",thisuser);
			convertEndDate = timeZoneConverterEnd.getDateTime()+" "+intlmap.getTextDescription("reporter.common.hrs");
		}
%>
			<!--<div style="float:right;padding:4px;">
				<div style="float:left" class="formLabel"><egui:intnl text="reporter.common.Start Date:"/></div>
				<div style="float:left;width:10px" align="center" >:</div>
				<div style="float:left;" class="formValue"><%=convertStartDate%></div>
			</div>
			<div style="clear:both;float:right;padding:4px;">
				<div style="float:left" class="formLabel"><egui:intnl text="reporter.common.End Date"/></div>
				<div style="float:left;width:10px" align="center">:</div>
				<div style="float:left;" class="formValue"><%=convertEndDate%></div>
			</div>-->
			<div class="printSelectionFields"><%=intlmap.getTextDescription("reporter.common.Timeline")%> - <span class="bold"><%=convertStartDate%>&nbsp;<%=intlmap.getTextDescription("reporter.common.to")%>&nbsp; <%=convertEndDate%></span></div>
<%
		Vector dvec = new Vector();
		dvec.add("\""+"Start Date : "+convertStartDate+"\"");
		dvec.add("\""+"End Date : "+convertEndDate+"\"");
		lst.add(dvec);
%>
		<!--</td>
	</tr>
</table>-->
</div>
<%
		if(request.getParameter("er_dismeas")!=null) //Tilte for PIE Chart Graph Range
		{
%>
<table align="center" width="100%" cellspacing="0" cellpadding="0" border="0">
	<tr>
		<td class="formValue" width="100%" nowrap align ="center">
<%
			if(s_type!=null&&s_type.equals("Citrix"))
			{
				disname  = request.getParameter("er_dismeas");
				if(disname.indexOf("*")>-1)
				{
					disname = disname.replace('*','%');
				}
				if(erd.s_test!=null&&!erd.s_test.equals(""))
					s_test_mes = erd.s_test + "/" +disname;
				else
					s_test_mes = disname;
			}
			else
			{
				if(erd.s_test != null && erd.s_disp_meas != null)
				{
					if (erd.s_test.endsWith("_trend"))
					{
						erd.s_test = erd.s_test.substring(0,erd.s_test.lastIndexOf("_"));
						erd.s_measure = erd.s_measure.substring(0,erd.s_measure.lastIndexOf("_"));
					}
					s_mes_unit = tablesInfo.getUnitForMeasure(erd.s_test,erd.s_disp_meas);
				}
				s_test_mes = intlmap.getTestDescription(erd.s_test) + "/" + intlmap.getMeasureDescription(erd.s_test,erd.s_disp_meas)+ " (" + s_mes_unit + ")";
			}
%>
				<%=s_test_mes%>&nbsp;
		</td>
	</tr>
</table>
<%
		}
		if(request.getParameter("er_disp_meas")!=null && !request.getParameter("er_disp_meas").equals(""))
		{
			String strdispMeas = request.getParameter("er_disp_meas");
			String strTest = request.getParameter("er_test");
			lst.add(intlmap.getTestDescription(strTest) + "/" + intlmap.getMeasureDescription(strTest,strdispMeas));
%>
	<!--<table align="center" width="100%" cellspacing="0" cellpadding="0" border="0">
		<tr>
			<td class="formValue" width="100%" nowrap align ="center">&nbsp;<egui:intnl test="<%=strTest%>"/>/<egui:intnl measure= '<%=strTest+":"+strdispMeas%>'/>&nbsp;</td>
		</tr>
	</table>  -->
	<div class="printOuterBoxHeader" style="margin:0px 10px 0px 10px"><egui:intnl test="<%=strTest%>"/>/<egui:intnl measure= '<%=strTest+":"+strdispMeas%>'/></div>
<%
		}
%>
<%
		h_data = new Hashtable[1];
		if(mhost_v_dates!=null && mhost_v_dates.size()>0)
		{
		for(int q=0; q < mhost_v_dates.size() && q<mhost_data.size(); q++)
		{
			v_dates=(Vector)mhost_v_dates.get(q);
			if(mhost.size()== 1)
			{
				h_data = (Hashtable[])mhost_data.get(q); 
			}
			else if(mhost.size()>1 && v_infos.size()==1)
			{
				for(int k=0;k<mhost.size();k++)
				{
					Hashtable datatemp = (Hashtable)mhost_data.get(k);
					Enumeration e = datatemp.keys();
					while(e.hasMoreElements())
					{
						String datatempkey = (String)e.nextElement();
						if(datatempkey.trim().equals(((String)mhost.get(q)).trim()))
						{
							h_data[0]= (Hashtable)datatemp.get(datatempkey);
						}
					}
				}
			}
			else if(mhost.size()>1 && v_infos.size()>1)
			{
				int sizeOfHash=0;
				h_data = new Hashtable[v_infos.size()];
				for(int k=0; k <v_infos.size()*mhost.size(); k++)
				{
					if (mhost_data.size() > k) {
						Hashtable datatemp = (Hashtable)mhost_data.get(k);
						Enumeration e = datatemp.keys();
						while(e.hasMoreElements())
						{
							String datatempkey = (String)e.nextElement();
							for(int infoCount=0;infoCount<v_infos.size();infoCount++)
							{
								if(q >= mhost.size()) break;
								if(q < mhost.size() && (datatempkey.equals(v_infos.get(infoCount)+" "+((String)mhost.get(q))) || datatempkey.equals(v_infos.get(infoCount)+((String)mhost.get(q)))))
								{
									h_data[infoCount]= (Hashtable)datatemp.get(datatempkey);
									sizeOfHash++;
								}
							}
						}
					}
				}
				if(q >= mhost.size()) break;
			}
%>
	<div class="newTable" style="align:center;margin:0px 10px 10px 10px">
	<table  align="center" width="100%" cellspacing="0" cellpadding="0" border="0">
<%
			String str_disp = new String();
			//Measures Data Code Start
			if(v_dates!=null && v_dates.size()!=0)
			{
				//vin starts
				Vector v_sub_str = new Vector();
				if(erd.s_gtype != null && erd.s_gtype.equalsIgnoreCase("Trend") && v_in != null && v_in.size()>0)
				{
					for(int m=0;m<v_infos.size();m+=2)
					{
						str_disp = (String)v_infos.get(m);
						String sub_str = str_disp.substring(0,str_disp.lastIndexOf("_"));
						v_sub_str.add(sub_str);
					}
				}
				Iterator it = null;
				if(v_sub_str!=null && v_sub_str.size()>0)
					it =  v_sub_str.iterator();

				if(erd.s_gtype != null && erd.s_gtype.equalsIgnoreCase("Trend") && v_in != null && v_in.size()>0)
				{
					while(it.hasNext())
					{
							String sub_str = (String)it.next();
							sub_str = sub_str.substring(sub_str.indexOf("+")+1);
					//vin ends
						lst_dat = new LinkedList();
						vec = new Vector();
						ht = new Hashtable();
							String s_var = "";
							s_var = (String)v_infos.elementAt(0);
							s_var = s_var.substring(s_var.indexOf("+")+1);
							if(mhost.size()>1 && !(s_var.equals("")) && s_var !=  null){

%>
							<!-- SET COLUMN heading for MEASURE DATA start -->
	
	<thead>
	<tr>
		<th class="subHeader" align="center" valign="middle" colspan='9'
		width="<%=wsize%>%" nowrap>&nbsp;<b><%=sub_str%></b></th>
	</tr> 
	</thead>
	
	<thead>
	<tr>
		<th class="printTableHeader2" align="center" width="<%=wsize%>%" nowrap><egui:intnl text="reporter.common.Measurement time"/>&nbsp;<b><%=(String)mhost.get(q)%></b></th>
<%
		vec.add(intlmap.getTextDescription("reporter.common.Measurement time")+(String)mhost.get(q));
		}
			else {
							
%>
	<thead>					<!-- SET COLUMN heading for MEASURE DATA start -->
	<tr>
		<th class="subHeader" align="center" valign="middle" colspan='9' width="<%=wsize%>%" nowrap>&nbsp;<b><%=sub_str%></b></th>
	</tr> 
	</thead>
	<thead>
	<tr>
		<th class="printTableHeader2" align="center" width="<%=wsize%>%" nowrap><b><egui:intnl text="reporter.common.Measurement time"/></b></th>
<%
						vec.add(intlmap.getTextDescription("reporter.common.Measurement time"));
							}
						String s_tmp = new String();
						for(int i=0; i < v_infos.size(); i++)
						{
							s_tmp = (String)v_infos.elementAt(i);
							if(s_tmp.indexOf(sub_str)>-1)
							{
								s_tmp = s_tmp.substring(s_tmp.indexOf("+")+1);
								if(s_tmp!=null && !s_tmp.equals("") && mhost!=null &&	mhost.size()==1)
								{
									if (mhost.contains(s_tmp.trim()))
										s_tmp="DATA";
								}
								if(s_tmp.equals("") || s_tmp==null)
								{
									if (mhost.size()>1) {
									s_tmp = (String)mhost.get(q);
									} else {
										s_tmp="DATA";
									}
								} else if( (s_tmp.length()>10) && ( s_tmp.indexOf("MAX_HI")> -1  || s_tmp.indexOf("MAX_MED") > -1 || s_tmp.indexOf("MAX_LOW")> -1 || s_tmp.indexOf("MIN_HI") > -1 || s_tmp.indexOf("MIN_MED")> -1 || s_tmp.indexOf("MIN_LOW"	) > -1) )
								{
									s_tmp = s_tmp.substring(0,7)+"<br>"+s_tmp.substring(7,s_tmp.length());
								}
								if(erd!=null && erd.s_mtype!=null && erd.s_mtype.equals("minmax"))
								{
									String strLable = s_tmp.substring(s_tmp.length()-3);
									String strInfo = request.getParameter("er_infos");
									if(strInfo!=null && (!strInfo.equals("+") || !strInfo.equalsIgnoreCase("NULL")))
									{
										if(strInfo.indexOf('+')>-1)
											strInfo = strInfo.substring(strInfo.indexOf('+')+1);
									}
									if(strInfo!=null && (!strInfo.equals("+") || !strInfo.equalsIgnoreCase("NULL")))
										s_tmp = strInfo + " ( "+intlmap.getTextDescription("reporter.trend."+strLable)+" ) ";
									else
										s_tmp = intlmap.getTextDescription("reporter.trend."+strLable);
								}

								String str_intlValue = s_tmp;

							//	out.println("<td class=\"printTableHeader2\" wrap align=\"center\" width=\""+wsize+"%\" ><b>"+str_intlValue+"</b></td>");
							out.println("<th style=\"text-align:center\" wrap width=\""+wsize+"%\">"+str_intlValue+"</th>"); 
							}
						}
%>
	</tr>
	</thead>
							<!-- END COLUMN HEADING -->
<%
					String s_check = new String();
					String s_checkdate = new String();
					String s_tmpdata = new String();
					String s_tmpdata1 = new String();
					String s_tmpmin = new String();
					String s_tmpmax = new String();
					boolean minthresh = false;
					boolean maxthresh = false;
					out.println("<!-- SET MEASURE DATA COLUMN VALUES HERE -->");
					for (int kk=0;kk < v_dates.size();kk++)
					{
						s_check = (String)v_dates.elementAt(kk);

					
						if(s_check!=null)
							s_check = s_check.substring(0,s_check.lastIndexOf(":"));

						String formatdisp = DateUtil.changeDateFormat(s_check.substring(0,s_check.indexOf(" ")).trim(),"MM/dd/yyyy",currentDateFormat);

						timeZoneConverterStart = new EgTimeZoneConverter(formatdisp+" "+s_check.substring(s_check.indexOf(" ")),thisuser);

						out.println("<tr>");
						out.println("<td nowrap align=\"center\" >");
						out.println(timeZoneConverterStart.getDateTime()); //Measurement Time
						out.println("</td>");
						lst_dat.add("\""+timeZoneConverterStart.getDateTime()+"\"");

						//NEW CODE FOR SNAPSHOT STARTS
						if(erd.s_gtype !=null && ( (erd.s_gtype.equalsIgnoreCase("intersnap")) || (erd.s_gtype.equalsIgnoreCase("intrasnap") ) ) )
						{
							if(v_infos.size() == 3)
							{
								for(int ii=0; ii < v_infos.size(); ii+=3)
								{
									try
									{
										s_tmpdata = (String) h_data[ii].get((String)v_dates.elementAt(kk));
										s_tmpdata = Dbdata.formatValue(s_tmpdata);
										s_tmpmin  = (String) h_data[ii+1].get((String)v_dates.elementAt(kk));
										s_tmpmin  = Dbdata.formatValue(s_tmpmin);
										s_tmpmax  = (String) h_data[ii+2].get((String)v_dates.elementAt(kk));
										s_tmpmax=Dbdata.formatValue(s_tmpmax);
									}
									catch(Exception e)
									{
										//System.out.println("exception caught srihari :"+e);
										s_tmpdata = null;
										s_tmpmin = null;
										s_tmpmax = null;
									}

									if(s_tmpdata==null) s_tmpdata="-";
									if(s_tmpmin==null)  s_tmpmin="-";
									if(s_tmpmax==null)  s_tmpmax="-";
									try
									{
										if(s_tmpmin != null && ! s_tmpmin.equals("-") )
										{
											if(Float.parseFloat(s_tmpdata) < Float.parseFloat(s_tmpmin))
											{
												minthresh = true;
											}
											else
												minthresh=false;
										}
										if(s_tmpmax !=null && !s_tmpmax.equals("-"))
										{
											if(Float.parseFloat(s_tmpdata) > Float.parseFloat(s_tmpmax))
											{
												maxthresh=true;
											}
											else
												maxthresh=false;
										}
									}
									catch(Exception ex)
									{
										maxthresh = false;
										minthresh = false;
									}
									if(minthresh)
									{
										out.print("<td  nowrap align=\"center\" >");
										out.println("<div style=\"float:left;width:80%;text-align:center\">"+s_tmpdata+"</div><div style=\"float:right\"><img class=\"iconPanelDownArrow\" src=\"/final/images/spacer.gif\" height=\"16px\" align=\"center\"></div>");
									}
									else if(maxthresh)
									{
										out.print("<td nowrap align=\"center\" >");
										out.println("<div style=\"float:left;width:80%;text-align:center\">"+s_tmpdata+"</div><div style=\"float:right\"><img class=\"iconPanelUpArrow\" src=\"/final/images/spacer.gif\" height=\"16px\" align=\"center\"></div>");
									}
									else if(!minthresh && !maxthresh)
									{
										out.print("<td nowrap align=\"center\" >");
										out.println("<div style=\"float:left;width:80%;text-align:center\">"+s_tmpdata+"</div><div style=\"float:right\"><img src=\"/final/images/spacer.gif\" height=\"16px\" align=\"center\"></div>");
									}
									out.println("</td>");
									out.print("<td class=\"printTableHeader2\" nowrap	align=\"center\" >"); out.println(s_tmpmin); 
									out.println("</td>");
									out.print("<td class=\"printTableHeader2\" nowrap align=\"center\" >"); out.println(s_tmpmax); 
									out.println("</td>");
								}
								lst_dat.add(s_tmpdata);
								lst_dat.add(s_tmpmin);
								lst_dat.add(s_tmpmax);
							}
							else
							if(v_infos.size() == 2)
							{
								for(int ii=0;ii<v_infos.size();ii+=2)
								{
									try
									{
										s_tmpdata = (String) h_data[ii].get((String)v_dates.elementAt(kk));
										if(v_infos.contains("MIN Threshold"))
										{
											s_tmpmin = (String)		h_data[ii+1].get((String)v_dates.elementAt(kk));
										}
										if(v_infos.contains("MAX Threshold"))
										{
											s_tmpmax = (String) h_data[ii+1].get((String)v_dates.elementAt(kk));
										}
										if (!v_infos.contains("MIN Threshold") && !v_infos.contains("MAX Threshold") )
										{
											s_tmpdata1 = (String) h_data[ii+1].get((String)v_dates.elementAt(kk));
										}
									}
									catch(Exception e)
									{
										//s_tmpdata=null;
										s_tmpdata1=null;
										s_tmpmin = null;
										s_tmpmax = null;
									}
									if(s_tmpdata==null) s_tmpdata="-";
									if(s_tmpmin==null) s_tmpmin="-";
									if(s_tmpmax==null) s_tmpmax="-";
									if(s_tmpdata1==null) s_tmpdata1="-";

									try
									{
										if(s_tmpmin != null && ! s_tmpmin.equals("-") && !(s_tmpmin.equals("")))
										{
											if(Float.parseFloat(s_tmpdata) < Float.parseFloat(s_tmpmin))
											{
												minthresh = true;
											}
											else
											{
												minthresh=false;
											}
										}
										if(s_tmpmax !=null && !s_tmpmax.equals("-") && !(s_tmpmax.equals("")) )
										{
											if(Float.parseFloat(s_tmpdata) > Float.parseFloat(s_tmpmax))
											{
												maxthresh=true;
											}
											else
											{
												maxthresh=false;
											}
										}
									}
									catch(Exception ex)
									{
										maxthresh = false;
										minthresh = false;
									}

									if(minthresh) //   #DFDF00 - yellow #FF1EFF . #CC00DD magenta 
									{
										out.print("<td nowrap align=\"center\" >");
										out.println("<div style=\"float:left;width:80%;text-align:center\">"+s_tmpdata+"</div><div style=\"float:right\"><img class=\"iconPanelDownArrow\" src=\"/final/images/spacer.gif\" height=\"16px\" align=\"center\"></div>");
										lst_dat.add(s_tmpdata);
									}
									if(maxthresh)
									{
										out.print("<td nowrap align=\"center\" valign=\"middle\">");
										out.println("<div style=\"float:left;width:80%;text-align:center\">"+s_tmpdata+"</div><div style=\"float:right\"><img class=\"iconPanelUpArrow\" src=\"/final/images/spacer.gif\" height=\"16px\" align=\"center\"></div>");
										lst_dat.add(s_tmpdata);
									}
									if(!minthresh && !maxthresh)
									{
										out.print("<td nowrap align=\"center\" >");
										out.println("<div style=\"float:left;width:80%;text-align:center\">"+s_tmpdata+"</div><div style=\"float:right\"><img src=\"/final/images/spacer.gif\" height=\"16px\" align=\"center\"></div>");
										lst_dat.add(s_tmpdata);
										if (!s_tmpdata1.equals(""))
										{
											out.print("<td nowrap align=\"center\" >");
											out.println("<div style=\"float:left;width:80%;text-align:center\">"+s_tmpdata1+"</div><div style=\"float:right\"><img src=\"/final/images/spacer.gif\" height=\"16px\" align=\"center\"></div>");
											lst_dat.add(s_tmpdata1);
										}
									}
									out.println("</td>");

									if(s_tmpmin != null && !(s_tmpmin.equals("-")) && !(s_tmpmin.equals("")))
									{
										out.print("<td nowrap align=\"center\" >"); out.println(s_tmpmin); out.println("</td>");
										lst_dat.add(s_tmpmin);
									}
									if(s_tmpmax != null && !(s_tmpmax.equals("-")) && !(s_tmpmax.equals("")) )
									{
										out.print("<td nowrap align=\"center\" >"); out.println(s_tmpmax); out.println("</td>");
										lst_dat.add(s_tmpmax);
									}
								}
							}
							else
							{
								int incr =0;
								if(v_infos.size() == 4)
									incr =4;
								else if(v_infos.size() == 7)
									incr =7;
								else 
									incr=1;
								boolean maxcheck = false;
								boolean mincheck = false;
								String s_max="",s_min="";

								if(iniui.getStateDisplayLabel("MAX_HI")!= null) {
									s_max = iniui.getStateDisplayLabel("MAX_HI");
								} else {
									s_max="MAX";
								}
								if(iniui.getStateDisplayLabel("MIN_HI")!= null) {
									s_min = iniui.getStateDisplayLabel("MIN_HI");
								} else {
									s_min="MIN";
								}

								String s_infos="";
								StringBuffer sb = new StringBuffer(s_infos);
								for(int i=0;i<v_infos.size();i++) {
									sb.append(v_infos.get(i).toString());
								}
								s_infos = sb.toString();
								if(s_infos.indexOf(s_max) > -1) maxcheck = false;
								if(s_infos.indexOf(s_min) > -1) mincheck = false;
								if(!(maxcheck && mincheck))
								{
									for(int jj=0; jj < v_infos.size(); jj++)
									{
										try
										{
											if(h_data[jj]!=null)
											{
												s_check = (String) h_data[jj].get((String)v_dates.elementAt(kk));
												if (s_check==null || s_check.length()==0) {
													s_check="-";
												} else {
													s_check = Dbdata.formatValue(s_check);
												}
											}else
												s_check="-";

											out.print("<td nowrap align=\"center\" >"); out.println(s_check); out.println("</td>");
											lst_dat.add(s_check);
										}catch(Exception e)
										{
											System.out.println("exception caught srihari :"+e);
											//s_check=null;
										}
										if(s_check==null)
										{
											s_check = "";
										}
									}
								}else
								{
									for(int jj=0; jj < v_infos.size(); jj=jj+incr)
									{
										
										try
										{
											s_check = (String) h_data[jj].get((String)v_dates.elementAt(kk));
											//max mul threshold condn
											if(maxcheck && mincheck)
											{
												String s_max1 = (String)h_data[jj+1].get((String)v_dates.elementAt(kk));
												String s_max2 = (String)h_data[jj+2].get((String)v_dates.elementAt(kk));
												String s_max3 = (String)h_data[jj+3].get((String)v_dates.elementAt(kk));
												try
												{
													if(s_max1!= null && s_max2!= null && s_max3!=null)
													maxthresh = (Float.parseFloat(s_max1)<Float.parseFloat(s_check)) || (Float.parseFloat(s_max2)<Float.parseFloat(s_check)) || (Float.parseFloat(s_max3)<Float.parseFloat(s_check));
												}
												catch(Exception eer)
												{
													maxthresh = false;
												}
												String s_min1 = (String)h_data[jj+4].get((String)v_dates.elementAt(kk));
												String s_min2 = (String)h_data[jj+5].get((String)v_dates.elementAt(kk));
												String s_min3 = (String)h_data[jj+6].get((String)v_dates.elementAt(kk));
												try
												{
													if(s_min1!= null && s_min2!= null && s_min3!=null)
													minthresh = (Float.parseFloat(s_min1)>Float.parseFloat(s_check)) || (Float.parseFloat(s_min2)>Float.parseFloat(s_check)) || (Float.parseFloat(s_min3)>Float.parseFloat(s_check));
												}
												catch(Exception eer)
												{
													minthresh = false;
												}
												out.print("<td nowrap align=\"center\" >");
												if(maxthresh)
												{
													out.println("<div style=\"float:left;width:80%;text-align:center\">"+s_check+"</div><div style=\"float:right\"><img class=\"iconPanelUpArrow\" src=\"/final/images/spacer.gif\" height=\"16px\" align=\"center\"></div>");
													lst_dat.add(s_check);
												}
												else if(minthresh)
												{
													out.println("<div style=\"float:left;width:80%;text-align:center\">"+s_check+"</div><div style=\"float:right\"><img class=\"iconPanelDownArrow\" src=\"/final/images/spacer.gif\" height=\"16px\" align=\"center\"></div>");
													lst_dat.add(s_check);
												}
												else
												{
													out.println("<div style=\"float:left;width:80%;text-align:center\">"+s_check+"</div><div style=\"float:right\"><img src=\"/final/images/spacer.gif\" height=\"16px\" align=\"center\"></div>");
													lst_dat.add(s_check);
												}
												out.println("</td>");

												out.print("<td nowrap align=\"center\"  >");
												out.println(s_max1);
												out.println("</td>");
												lst_dat.add(s_max1);

												out.print("<td nowrap align=\"center\"  >");
												out.println(s_max2);
												out.println("</td>");
												lst_dat.add(s_max2);

												out.print("<td nowrap align=\"center\"  >");
												out.println(s_max3);
												out.println("</td>");
												lst_dat.add(s_max3);

												out.print("<td nowrap align=\"center\"  >");
												out.println(s_min1);
												out.println("</td>");
												lst_dat.add(s_min1);

												out.print("<td nowrap align=\"center\"  >");
												out.println(s_min2);
												out.println("</td>");
												lst_dat.add(s_min2);

												out.print("<td nowrap align=\"center\"  >");
												out.println(s_min3);
												out.println("</td>");
												lst_dat.add(s_min3);
											}//for both condn
											else if(maxcheck)
											{
												String s_max1 = (String)h_data[jj+1].get((String)v_dates.elementAt(kk));
												String s_max2 = (String)h_data[jj+2].get((String)v_dates.elementAt(kk));
												String s_max3 = (String)h_data[jj+3].get((String)v_dates.elementAt(kk));
												try
												{
													if(s_max1!= null && s_max2!= null && s_max3!=null)
													maxthresh = (Float.parseFloat(s_max1)<Float.parseFloat(s_check)) || (Float.parseFloat(s_max2)<Float.parseFloat(s_check)) || (Float.parseFloat(s_max3)<Float.parseFloat(s_check));
												}
												catch(Exception ww)
												{
													maxthresh = false;
												}
												out.print("<td nowrap align=\"center\" >");

												if(maxthresh)
												{
													out.println("<div style=\"float:left;width:80%;text-align:center\">"+s_check+"</div><div style=\"float:right\"><img class=\"iconPanelUpArrow\" src=\"/final/images/spacer.gif\" height=\"16px\" align=\"center\"></div>");
													lst_dat.add(s_check);
												}
												else
												{
													out.println("<div style=\"float:left;width:80%;text-align:center\">"+s_check+"</div><div style=\"float:right\"><img src=\"/final/images/spacer.gif\" height=\"16px\" align=\"center\"></div>");
													lst_dat.add(s_check);
												}
												out.println("</td>");

												out.print("<td nowrap align=\"center\" >");
												out.println(s_max1);
												out.println("</td>");
	
												lst_dat.add(s_max1);
												out.print("<td nowrap align=\"center\" >");
												out.println(s_max2);
												out.println("</td>");

												lst_dat.add(s_max2);
												out.print("<td nowrap align=\"center\" >");
												out.println(s_max3);
												out.println("</td>");
											}
											else if(mincheck)
											{
												String s_min1 = (String)h_data[jj+1].get((String)v_dates.elementAt(kk));
												String s_min2 = (String)h_data[jj+2].get((String)v_dates.elementAt(kk));
												String s_min3 = (String)h_data[jj+3].get((String)v_dates.elementAt(kk));
												try
												{
													if(s_min1!= null && s_min2!= null &&	s_min3!=null)
														minthresh = (Float.parseFloat(s_min1)>Float.parseFloat(s_check)) || (Float.parseFloat(s_min2)>Float.parseFloat(s_check)) || (Float.parseFloat(s_min3)>Float.parseFloat(s_check));
												}
												catch(Exception qq)
												{
													minthresh = false;
												}
												out.print("<td nowrap align=\"center\" >");
												if(minthresh)
												{
													out.println("<div style=\"float:left;width:80%;text-align:center\">"+s_check+"</div><div style=\"float:right\"><img class=\"iconPanelDownArrow\" src=\"/final/images/spacer.gif\" height=\"16px\" align=\"center\"></div>");
													lst_dat.add(s_check);
												}
												else
												{
													out.println("<div style=\"float:left;width:80%;text-align:center\">"+s_check+"</div><div style=\"float:right\"><img src=\"/final/images/spacer.gif\" height=\"16px\" align=\"center\"></div>");
													lst_dat.add(s_check);
												}
												out.println("</td>");

												out.print("<td nowrap align=\"center\" >");
												out.println(s_min1);
												out.println("</td>");
												lst_dat.add(s_min1);

												out.print("<td nowrap align=\"center\" >");
												out.println(s_min2);
												out.println("</td>");
												lst_dat.add(s_min2);

												out.print("<td nowrap align=\"center\" >");
												out.println(s_min3);
												out.println("</td>");
												lst_dat.add(s_min3);
											}
											else if(!(maxcheck && mincheck) && (incr==1))
											{
												if (s_check==null)
													s_check="-";
												out.print("<td nowrap align=\"center\" >");
												out.println(s_check); out.println("</td>");
												lst_dat.add(s_check); 
											}
										}catch(Exception e)
										{
											System.out.println("exception caught srihari :"+e);
											s_check=null;
										}
										if(s_check==null)
										{
											s_check = "";
										}
									}
								}
							}
	out.println("</tr>");
						}//FOR SNAPSHOT SPECIFIC - NEW CODE FOR SNAPSHOT ENDS
						else //FOR OTHER USUAL CASE
						{
							
							for(int jj=0; jj<v_infos.size(); jj++)
							{
								String str_info = (String)v_infos.get(jj);
								if(str_info.indexOf(sub_str)>-1)
								{
									s_test_mes = sub_str;

									out.print("<td nowrap align=\"center\" >");
									try
									{
										s_check = (String) h_data[jj].get((String)v_dates.elementAt(kk));
									}catch(Exception e)
									{
										System.out.println("exception caught srihari :"+e);
										s_check=null;
									}
									if(s_check==null )
									{
										s_check = "-";
									}
									out.println(s_check); out.println("</td>");
									lst_dat.add(s_check);
								}
							}
	out.println("</tr>");
						
						}//else for other cases
					}
					out.println("<!-- END MEASURE DATA-->");

					sen = new Hashtable();
					ht = new Hashtable();
					if(lst_dat!=null && !lst_dat.isEmpty())
					{
						sen.put(vec,lst_dat);
						ht.put(s_test_mes,sen);
						lst.add(ht);
						session.setAttribute("list",lst);
					}
					else
						session.setAttribute("list",lst);


					lst_dat = new LinkedList();
					//vec = new Vector();
					ht = new Hashtable();
					}//my while loop ends
				}//my if loop ends v_in
				else
				{
//repetition starts
					lst_dat = new LinkedList();
					vec = new Vector();
					ht = new Hashtable();
						String s_var = "";
						s_var = (String)v_infos.elementAt(0);
						s_var = s_var.substring(s_var.indexOf("+")+1);
						if(mhost.size()>1 && !(s_var.equals("")) && s_var !=  null){
%>
							<!-- SET COLUMN heading for MEASURE DATA start -->
	<thead>
	<tr>
		<td class="printTableHeader2" align="center" width="<%=wsize%>%" nowrap><egui:intnl text="reporter.common.Measurement time"/>&nbsp;<b><%=(String)mhost.get(q)%></b></td>
<%
							vec.add(intlmap.getTextDescription("reporter.common.Measurement time")+(String)mhost.get(q));
						}
						else {
%>
	
						<!-- SET COLUMN heading for MEASURE DATA start -->
	<thead>
	<tr>
		<th style="text-align:left" width="<%=wsize%>%" nowrap><b><egui:intnl text="reporter.common.Measurement time"/></b></th>
<%
					vec.add(intlmap.getTextDescription("reporter.common.Measurement time"));
						}
					String s_tmp = new String();
					for(int i=0; i < v_infos.size(); i++)
					{
						s_tmp = (String)v_infos.elementAt(i);
						s_tmp = s_tmp.substring(s_tmp.indexOf("+")+1);
						if(s_tmp!=null && !s_tmp.equals("") && mhost!=null && mhost.size()==1)
						{
							if (mhost.contains(s_tmp.trim()))
								s_tmp="DATA";
						}
						if(s_tmp.equals("") || s_tmp==null)
						{
							if (mhost.size()>1) {
								s_tmp = (String)mhost.get(q);
							} else {
								s_tmp="DATA";
							}
						} else if( (s_tmp.length()>10) && ( s_tmp.indexOf("MAX_HI")> -1  || s_tmp.indexOf("MAX_MED") > -1 
																	|| s_tmp.indexOf("MAX_LOW")> -1 || s_tmp.indexOf("MIN_HI") > -1 
																	|| s_tmp.indexOf("MIN_MED")> -1 || s_tmp.indexOf("MIN_LOW") > -1) )
						{
							s_tmp = s_tmp.substring(0,7)+"<br>"+s_tmp.substring(7,s_tmp.length());
						}
						if(erd!=null && erd.s_mtype!=null && erd.s_mtype.equals("minmax"))
						{
							String strLable = s_tmp.substring(s_tmp.length()-3);
							String strInfo = request.getParameter("er_infos");
							if(strInfo!=null && (!strInfo.equals("+") || !strInfo.equalsIgnoreCase("NULL")))
							{
								if(strInfo.indexOf('+')>-1)
									strInfo = strInfo.substring(strInfo.indexOf('+')+1);
							}
							if(strInfo!=null && (!strInfo.equals("+") || !strInfo.equalsIgnoreCase("NULL")))
								s_tmp = strInfo + " ( "+intlmap.getTextDescription("reporter.trend."+strLable)+" ) ";
							else
								s_tmp = intlmap.getTextDescription("reporter.trend."+strLable);
						}
						String str_intlValue = s_tmp;
						//out.println("<th class=\"printTableHeader2\"  wrap align=\"center\" width=\""+wsize+"%\" ><b>"+str_intlValue+"</b></th>");
						out.println("<th style=\"text-align:center\" wrap width=\""+wsize+"%\">"+str_intlValue+"</th>"); 
						vec.add(str_intlValue);
					}
%>
	</tr>
	</thead>
							<!-- END COLUMN HEADING -->
	<tbody>
<%
				String s_check = new String();
				String s_checkdate = new String();
				String s_tmpdata = new String();
				String s_tmpdata1 = new String();
				String s_tmpmin = new String();
				String s_tmpmax = new String();
				boolean minthresh = false;
				boolean maxthresh = false;
				out.println("<!-- SET MEASURE DATA COLUMN VALUES HERE -->");
				out.println("<!--hi-->");
				for (int kk=0;kk < v_dates.size();kk++)
				{
					s_check = (String)v_dates.elementAt(kk);
					if(s_check!=null)
						s_check = s_check.substring(0,s_check.lastIndexOf(":"));

					String formatdisp = DateUtil.changeDateFormat(s_check.substring(0,s_check.indexOf(" ")).trim(),"MM/dd/yyyy",currentDateFormat);
					//System.out.println("==formatdisp===111>>>>>>"+formatdisp);
					//System.out.println("==s_check===111>>>>>>"+s_check);
					//System.out.println("==thisuser===111>>>>>>"+thisuser);
					timeZoneConverterStart = new EgTimeZoneConverter(formatdisp+" "+s_check.substring(s_check.indexOf(" ")),thisuser);
					out.println("<tr>");
					out.println("<td nowrap align=\"left\" >");
					out.println(timeZoneConverterStart.getDateTime()); //Measurement Time
					out.println("</td>");
					lst_dat.add("\""+timeZoneConverterStart.getDateTime()+"\"");

					//NEW CODE FOR SNAPSHOT STARTS
					if(erd.s_gtype !=null && ( (erd.s_gtype.equalsIgnoreCase("intersnap")) || (erd.s_gtype.equalsIgnoreCase("intrasnap") ) ) )
					{
						if(v_infos.size() == 3)
						{
							for(int ii=0; ii < v_infos.size(); ii+=3)
							{
								try
								{
									s_tmpdata = (String) h_data[ii].get((String)v_dates.elementAt(kk));
									s_tmpdata = Dbdata.formatValue(s_tmpdata);
									s_tmpmin  = (String) h_data[ii+1].get((String)v_dates.elementAt(kk));
									s_tmpmin  = Dbdata.formatValue(s_tmpmin);
									s_tmpmax  = (String) h_data[ii+2].get((String)v_dates.elementAt(kk));
									s_tmpmax=Dbdata.formatValue(s_tmpmax);
								}
								catch(Exception e)
								{
									//System.out.println("exception caught srihari :"+e);
									s_tmpdata = null;
									s_tmpmin = null;
									s_tmpmax = null;
								}
								if(s_tmpdata==null) s_tmpdata="-";
								if(s_tmpmin==null)  s_tmpmin="-";
								if(s_tmpmax==null)  s_tmpmax="-";
								try
								{
									if(s_tmpmin != null && ! s_tmpmin.equals("-") )
									{
										if(Float.parseFloat(s_tmpdata) < Float.parseFloat(s_tmpmin))
										{
											minthresh = true;
										}
										else
											minthresh=false;
									}
									if(s_tmpmax !=null && !s_tmpmax.equals("-"))
									{
										if(Float.parseFloat(s_tmpdata) > Float.parseFloat(s_tmpmax))
										{
											maxthresh=true;
										}
										else
											maxthresh=false;
									}
								}
								catch(Exception ex)
								{
									maxthresh = false;
									minthresh = false;
								}

								if(minthresh)
								{
									out.print("<td nowrap align=\"center\" >");
									out.println("<div style=\"float:left;width:80%;text-align:center\">"+s_tmpdata+"</div><div style=\"float:right\"><img class=\"iconPanelDownArrow\" src=\"/final/images/spacer.gif\" height=\"16px\" align=\"center\"></div>");
								}
								else if(maxthresh)
								{
									out.print("<td nowrap align=\"center\" >");
									out.println("<div style=\"float:left;width:80%;text-align:center\">"+s_tmpdata+"</div><div style=\"float:right\"><img class=\"iconPanelUpArrow\" src=\"/final/images/spacer.gif\" height=\"16px\" align=\"center\"></div>");
								}
								else if(!minthresh && !maxthresh)
								{
									out.print("<td nowrap align=\"center\" >");
									out.println("<div style=\"float:left;width:80%;text-align:center\">"+s_tmpdata+"</div><div style=\"float:right\"><img src=\"/final/images/spacer.gif\" height=\"16px\" align=\"center\"></div>");
								}
								out.println("</td>");
								out.print("<td nowrap align=\"center\" >"); out.println(s_tmpmin); 
								out.println("</td>");
								out.print("<td nowrap align=\"center\" >"); out.println(s_tmpmax); 
								out.println("</td>");
							}
							lst_dat.add(s_tmpdata);
							lst_dat.add(s_tmpmin);
							lst_dat.add(s_tmpmax);
						}
						else
						if(v_infos.size() == 2)
						{
							for(int ii=0;ii<v_infos.size();ii+=2)
							{
								try
								{
									s_tmpdata = (String) h_data[ii].get((String)v_dates.elementAt(kk));
									if(v_infos.contains("MIN Threshold"))
									{
										s_tmpmin = (String) h_data[ii+1].get((String)v_dates.elementAt(kk));
									}
									if(v_infos.contains("MAX Threshold"))
									{
										s_tmpmax = (String) h_data[ii+1].get((String)v_dates.elementAt(kk));
									}
									if (!v_infos.contains("MIN Threshold") && !v_infos.contains("MAX Threshold") )
									{
										s_tmpdata1 = (String) h_data[ii+1].get((String)v_dates.elementAt(kk));
									}
								}
								catch(Exception e)
								{
									//s_tmpdata=null;
									s_tmpdata1=null;
									s_tmpmin = null;
									s_tmpmax = null;
								}
								if(s_tmpdata==null) s_tmpdata="-";
								if(s_tmpmin==null) s_tmpmin="-";
								if(s_tmpmax==null) s_tmpmax="-";
								if(s_tmpdata1==null) s_tmpdata1="-";

								try
								{
									if(s_tmpmin != null && ! s_tmpmin.equals("-") && !(s_tmpmin.equals("")))
									{
										if(Float.parseFloat(s_tmpdata) < Float.parseFloat(s_tmpmin))
										{
											minthresh = true;
										}
										else
										{
											minthresh=false;
										}
									}
									if(s_tmpmax !=null && !s_tmpmax.equals("-") && !(s_tmpmax.equals("")) )
									{
										if(Float.parseFloat(s_tmpdata) > Float.parseFloat(s_tmpmax))
										{
											maxthresh=true;
										}
										else
										{
											maxthresh=false;
										}
									}
								}
								catch(Exception ex)
								{
									maxthresh = false;
									minthresh = false;
								}

								if(minthresh) //   #DFDF00 - yellow #FF1EFF . #CC00DD magenta 
								{
									out.print("<td nowrap align=\"center\" >");
									out.println("<div style=\"float:left;width:80%;text-align:center\">"+s_tmpdata+"</div><div style=\"float:right\"><img class=\"iconPanelDownArrow\" src=\"/final/images/spacer.gif\" height=\"16px\" align=\"center\"></div>");
									lst_dat.add(s_tmpdata);
								}
								if(maxthresh)
								{
									out.print("<td nowrap align=\"center\" valign=\"middle\">");
									out.println("<div style=\"float:left;width:80%;text-align:center\">"+s_tmpdata+"</div><div style=\"float:right\"><img class=\"iconPanelUpArrow\" src=\"/final/images/spacer.gif\" height=\"16px\" align=\"center\"></div>");
									lst_dat.add(s_tmpdata);
								}
								if(!minthresh && !maxthresh)
								{
									out.print("<td nowrap align=\"center\" >");
									out.println("<div style=\"float:left;width:80%;text-align:center\">"+s_tmpdata+"</div><div style=\"float:right\"><img class=\"iconPanelDownArrow\" src=\"/final/images/spacer.gif\" height=\"16px\" align=\"center\"></div>");

// 
//<img class="iconPanelDownArrow" src="/final/images/spacer.gif" height="16px" align="center">

									lst_dat.add(s_tmpdata);
									if (!s_tmpdata1.equals(""))
									{
										out.print("<td nowrap align=\"center\" >");
										out.println("<div style=\"float:left;width:80%;text-align:center\">"+s_tmpdata1+"</div><div style=\"float:right\"><img src=\"/final/images/spacer.gif\" height=\"16px\" align=\"center\"></div>");
										lst_dat.add(s_tmpdata1);
									}
								}
								out.println("</td>");

								if(s_tmpmin != null && !(s_tmpmin.equals("-")) && !(s_tmpmin.equals("")))
								{
									out.print("<td nowrap align=\"center\" >"); out.println(s_tmpmin); out.println("</td>");
									lst_dat.add(s_tmpmin);
								}
								if(s_tmpmax != null && !(s_tmpmax.equals("-")) && !(s_tmpmax.equals("")) )
								{
									out.print("<td nowrap align=\"center\" >"); out.println(s_tmpmax); out.println("</td>");
									lst_dat.add(s_tmpmax);
								}
							}
						}
						else
						{
							int incr =0;
							if(v_infos.size() == 4)
								incr =4;
							else if(v_infos.size() == 7)
								incr =7;
							else 
								incr=1;
							boolean maxcheck = false;
							boolean mincheck = false;
							String s_max="",s_min="";

							if(iniui.getStateDisplayLabel("MAX_HI")!= null) {
								s_max = iniui.getStateDisplayLabel("MAX_HI");
							} else {
								s_max="MAX";
							}
							if(iniui.getStateDisplayLabel("MIN_HI")!= null) {
								s_min = iniui.getStateDisplayLabel("MIN_HI");
							} else {
								s_min="MIN";
							}

							String s_infos="";
							StringBuffer sb = new StringBuffer(s_infos);
							for(int i=0;i<v_infos.size();i++) {
								sb.append(v_infos.get(i).toString());
							}
							s_infos = sb.toString();
							if(s_infos.indexOf(s_max) > -1) maxcheck = false;
							if(s_infos.indexOf(s_min) > -1) mincheck = false;
							if(!(maxcheck && mincheck))
							{
								for(int jj=0; jj < v_infos.size(); jj++)
								{
									try
									{
										if(h_data[jj]!=null)
										{
										s_check = (String) h_data[jj].get((String)v_dates.elementAt(kk));
										if (s_check==null || s_check.length()==0) {
											s_check="-";
										} else {
											s_check = Dbdata.formatValue(s_check);
										}}else
											s_check="-";

										out.print("<td nowrap align=\"center\" >"); out.println(s_check); out.println("</td>");
										lst_dat.add(s_check);
									}catch(Exception e)
									{
										System.out.println("exception caught srihari :"+e);
										//s_check=null;
									}
									if(s_check==null)
									{
										s_check = "";
									}
								}
							}else
							{
								for(int jj=0; jj < v_infos.size(); jj=jj+incr)
								{
									
									try
									{
										s_check = (String) h_data[jj].get((String)v_dates.elementAt(kk));
										//max mul threshold condn
										if(maxcheck && mincheck)
										{
											String s_max1 = (String)h_data[jj+1].get((String)v_dates.elementAt(kk));
											String s_max2 = (String)h_data[jj+2].get((String)v_dates.elementAt(kk));
											String s_max3 = (String)h_data[jj+3].get((String)v_dates.elementAt(kk));
											try
											{
												if(s_max1!= null && s_max2!= null && s_max3!=null)
												maxthresh = (Float.parseFloat(s_max1)<Float.parseFloat(s_check)) || (Float.parseFloat(s_max2)<Float.parseFloat(s_check)) ||
												(Float.parseFloat(s_max3)<Float.parseFloat(s_check));
											}
											catch(Exception eer)
											{
												maxthresh = false;
											}
											String s_min1 = (String)h_data[jj+4].get((String)v_dates.elementAt(kk));
											String s_min2 = (String)h_data[jj+5].get((String)v_dates.elementAt(kk));
											String s_min3 = (String)h_data[jj+6].get((String)v_dates.elementAt(kk));
											try
											{
												if(s_min1!= null && s_min2!= null && s_min3!=null)
												minthresh = (Float.parseFloat(s_min1)>Float.parseFloat(s_check)) || (Float.parseFloat(s_min2)>Float.parseFloat(s_check)) ||
												(Float.parseFloat(s_min3)>Float.parseFloat(s_check));
											}
											catch(Exception eer)
											{
												minthresh = false;
											}
											out.print("<td nowrap align=\"center\" >");
											if(maxthresh)
											{
												out.println("<div style=\"float:left;width:80%;text-align:center\">"+s_check+"</div><div style=\"float:right\"><img class=\"iconPanelUpArrow\" src=\"/final/images/spacer.gif\" height=\"16px\" align=\"center\"></div>");
												lst_dat.add(s_check);
											}
											else if(minthresh)
											{
												out.println("<div style=\"float:left;width:80%;text-align:center\">"+s_check+"</div><div style=\"float:right\"><img class=\"iconPanelDownArrow\" src=\"/final/images/spacer.gif\" height=\"16px\" align=\"center\"></div>");
												lst_dat.add(s_check);
											}
											else
											{
												out.println("<div style=\"float:left;width:80%;text-align:center\">"+s_check+"</div><div style=\"float:right\"><img src=\"/final/images/spacer.gif\" height=\"16px\" align=\"center\"></div>");
												lst_dat.add(s_check);
											}
											out.println("</td>");

											out.print("<td nowrap align=\"center\"  >");
											out.println(s_max1);
											out.println("</td>");
											lst_dat.add(s_max1);

											out.print("<td nowrap align=\"center\"  >");
											out.println(s_max2);
											out.println("</td>");
											lst_dat.add(s_max2);

											out.print("<td nowrap align=\"center\"  >");
											out.println(s_max3);
											out.println("</td>");
											lst_dat.add(s_max3);

											out.print("<td nowrap align=\"center\"  >");
											out.println(s_min1);
											out.println("</td>");
											lst_dat.add(s_min1);

											out.print("<td nowrap align=\"center\"  >");
											out.println(s_min2);
											out.println("</td>");
											lst_dat.add(s_min2);

											out.print("<td nowrap align=\"center\"  >");
											out.println(s_min3);
											out.println("</td>");
											lst_dat.add(s_min3);

										}//for both condn
										else if(maxcheck)
										{
											String s_max1 = (String)h_data[jj+1].get((String)v_dates.elementAt(kk));
											String s_max2 = (String)h_data[jj+2].get((String)v_dates.elementAt(kk));
											String s_max3 = (String)h_data[jj+3].get((String)v_dates.elementAt(kk));
											try
											{
												if(s_max1!= null && s_max2!= null && s_max3!=null)
												maxthresh = (Float.parseFloat(s_max1)<Float.parseFloat(s_check)) || (Float.parseFloat(s_max2)<Float.parseFloat(s_check)) ||
												(Float.parseFloat(s_max3)<Float.parseFloat(s_check));
											}
											catch(Exception ww)
											{
												maxthresh = false;
											}
											out.print("<td nowrap align=\"center\" >");

											if(maxthresh)
											{
												out.println("<div style=\"float:left;width:80%;text-align:center\">"+s_check+"</div><div style=\"float:right\"><img class=\"iconPanelUpArrow\" src=\"/final/images/spacer.gif\" height=\"16px\" align=\"center\"></div>");
												lst_dat.add(s_check);
											}
											else
											{
												out.println("<div style=\"float:left;width:80%;text-align:center\">"+s_check+"</div><div style=\"float:right\"><img src=\"/final/images/spacer.gif\" height=\"16px\" align=\"center\"></div>");
												lst_dat.add(s_check);
											}
											out.println("</td>");

											out.print("<td nowrap align=\"center\" >");
											out.println(s_max1);
											out.println("</td>");

											lst_dat.add(s_max1);
											out.print("<td nowrap align=\"center\" >");
											out.println(s_max2);
											out.println("</td>");

											lst_dat.add(s_max2);
											out.print("<td nowrap align=\"center\" >");
											out.println(s_max3);
											out.println("</td>");
										}
										else if(mincheck)
										{
											String s_min1 = (String)h_data[jj+1].get((String)v_dates.elementAt(kk));
											String s_min2 = (String)h_data[jj+2].get((String)v_dates.elementAt(kk));
											String s_min3 = (String)h_data[jj+3].get((String)v_dates.elementAt(kk));
											try
											{
												if(s_min1!= null && s_min2!= null && s_min3!=null)
													minthresh = (Float.parseFloat(s_min1)>Float.parseFloat(s_check)) || (Float.parseFloat(s_min2)>Float.parseFloat(s_check)) || (Float.parseFloat(s_min3)>Float.parseFloat(s_check));
											}
											catch(Exception qq)
											{
												minthresh = false;
											}
											out.print("<td nowrap align=\"center\" >");
											if(minthresh)
											{
												out.println("<div style=\"float:left;width:80%;text-align:center\">"+s_check+"</div><div style=\"float:right\"><img class=\"iconPanelDownArrow\" src=\"/final/images/spacer.gif\" height=\"16px\" align=\"center\"></div>");
												lst_dat.add(s_check);
											}
											else
											{
												out.println("<div style=\"float:left;width:80%;text-align:center\">"+s_check+"</div><div style=\"float:right\"><img src=\"/final/images/spacer.gif\" height=\"16px\" align=\"center\"></div>");
												lst_dat.add(s_check);
											}
											out.println("</td>");

											out.print("<td nowrap align=\"center\" >");
											out.println(s_min1);
											out.println("</td>");
											lst_dat.add(s_min1);

											out.print("<td nowrap align=\"center\" >");
											out.println(s_min2);
											out.println("</td>");
											lst_dat.add(s_min2);

											out.print("<td nowrap align=\"center\" >");
											out.println(s_min3);
											out.println("</td>");
											lst_dat.add(s_min3);
										}
										else if(!(maxcheck && mincheck) && (incr==1))
										{
											if (s_check==null)
												s_check="-";
											out.print("<td nowrap align=\"center\" >");
											out.println(s_check); out.println("</td>");
											lst_dat.add(s_check); 
										}
									}catch(Exception e)
									{
										System.out.println("exception caught srihari :"+e);
										s_check=null;
									}
									if(s_check==null)
									{
										s_check = "";
									}
								}
							}
						}
	out.println("</tr>");
					}//FOR SNAPSHOT SPECIFIC - NEW CODE FOR SNAPSHOT ENDS
					else //FOR OTHER USUAL CASE
					{
						for(int jj=0; jj<v_infos.size(); jj++)
						{
							out.print("<td nowrap align=\"center\" >");
							try
							{
								s_check = (String) h_data[jj].get((String)v_dates.elementAt(kk));
							}catch(Exception e)
							{
								System.out.println("exception caught srihari :"+e);
								s_check=null;
							}
							if(s_check==null )
							{
								s_check = "-";
							}
							out.println(s_check); out.println("</td>");
							lst_dat.add(s_check);
						}
	out.println("</tr>");
					}//else for other cases
				}
				out.println("<!-- END MEASURE DATA-->");
				
				
				sen = new Hashtable();
				if(lst_dat!=null && !lst_dat.isEmpty())
				{
					sen.put(vec,lst_dat);
					ht = new Hashtable();
					ht.put(s_test_mes,sen);
					lst.add(ht);
					session.setAttribute("list",lst);
				}
				else
					session.setAttribute("list",lst);

				lst_dat = new LinkedList();
				vec = new Vector();
				ht = new Hashtable();
			}
//repetition ends
%>
	</tbody>
</table>
</div>
<%
			}
			else if (forReport!=null && forReport.equals("Farm")) //FOR Thin CLIENT ZONE REPORT
			{
				String s_farmserver = request.getParameter("select_farm");
				if (ht_avg!=null && !ht_avg.isEmpty())
				{
					String avg = "";
%>
							<!-- SET ZONE REPORT PIE CHART DISTRIBUTION GRAPH - SUMMARY DETAILS-->
<div class="newTable">
<table align="center" width="60%" cellspacing="0" cellpadding="4" id="tableborder" border="0">
	<!--<tr>
		<th class="cellbgdark" NOWRAP align="center" colspan="7"><egui:intnl text="reporter.common.Summary for Zone"/> 11111- <%=s_farmserver%> </th>
	</tr>-->
	<div class="printOuterBoxHeader"><egui:intnl text="reporter.common.Summary for Zone"/>-<%=s_farmserver%></div>
<%
					lst.add("Summary for Zone - "+s_farmserver);
					avg = (String)ht_avg.get(erd.s_test+":"+disname);
					if (avg==null || avg.equals("-5.0")) {
						avg="-";
					}
%>
	<thead>
	<tr>
		<td width="30%" wrap align="left"><%=disname%> - <egui:intnl text="reporter.common.Avg"/></td>
		<td id="cellbgapplet" class="blackcontent" nowrap  align="right" width="30%"><%=avg%></td>
<%
					vec.add(intlmap.getTextDescription("reporter.common."+disname)+"("+intlmap.getTextDescription("reporter.common.Avg")+")");
					lst_dat.add(avg);
					String  normal = (String)ht_avg.get("Normal %");
					if (normal==null || normal.equals("-5.0")) {
						normal="-";
					}
%>
	</tr>
	<tr>
		<td wrap align="left" > <egui:intnl text="reporter.common.Component Health"/> - <egui:intnl text="reporter.common.Normal"/>% - <egui:intnl text="reporter.common.Avg"/></td>
		<td id="cellbgapplet" class="blackcontent" nowrap  align="right"> <%=normal%> </td>
	</tr>
</table>
</div>
<%
					vec.add(intlmap.getTextDescription("reporter.common.Component Health")+" - "+intlmap.getTextDescription("reporter.common.Normal")+"  % ("+intlmap.getTextDescription("reporter.common.Avg")+")");
					lst_dat.add(normal);
					sen.put(vec,lst_dat);
					ht.put(s_test_mes,sen);
					lst.add(ht);
					vec = new Vector();
					lst_dat = new LinkedList();
					ht = new Hashtable();
					sen = new Hashtable();
				}

				if(Rep_data!=null&&Rep_data.size()>0)
				{
					String skey="";
					Iterator itr = (new TreeMap(Rep_data)).keySet().iterator();
					Iterator itr1 = RangeServer.keySet().iterator();
					String getKey = (String)itr1.next();
					Hashtable ServerRanges = (Hashtable)RangeServer.get(getKey);
					Vector Servers = (Vector)ServerRanges.get(Strrange);
					Vector CompTypes = new Vector();
					if(Servers!=null&&Servers.size()>0)
					{
						for(int f=0;f<Servers.size();f++)
						{
							String StrServer = (String)Servers.get(f);
							String Ctype = StrServer.substring(StrServer.lastIndexOf(":")+1,StrServer.length());
							if(!CompTypes.contains(Ctype)) {
								CompTypes.add(Ctype);
							}
						}
					}
					while (itr.hasNext())
					{
						skey = (String)itr.next();
						if(CompTypes.contains(skey))
						{
%>
							<!-- DISTRIBUTION GRAPH COMPONENT RANGE DATA -->
<div class="newTable">
<table align="center" width="100%" cellspacing="0" cellpadding="4"  id="tableborder" border="0">
	<!--<tr>-->
<%
							if (s_farmserver!=null)
							{
%>
		<!--<th class="cellbgdark" width="100%" NOWRAP align="center" colspan="7" ><egui:intnl text="reporter.common.Zone report"/> - <%=s_farmserver%>:<%=skey%></th>-->
		<div class="printOuterBoxHeader"><egui:intnl text="reporter.common.Zone report"/> - <%=s_farmserver%>:<%=intlmap.getComponentTypeDescription(skey)%></div>
<%
								t = "Zone report - "+s_farmserver+" : "+ intlmap.getComponentTypeDescription(skey);
							}
							String s_test    = request.getParameter("er_test");
							String s_measure = request.getParameter("er_meas");
							String Comptype  = request.getParameter("er_comptype");
							if(disname.indexOf("*")>-1) {
								disname = disname.replace('*','%');
							}
							String reqvariable = "";
							String variable = "";
							String value = "";
							String test_mes="";
							String entry="";
							String sub="ZONE_REPORT";
							reqvariable = s_test+":"+s_measure;
							ArrayList variables = reportInfo.getVariables(sub);
							vec.add("Range");
							vec.add("Server");

							for(int v=0; v<variables.size();v++)
							{
								variable = (String)variables.get(v);
								if(variable.indexOf("Default")>-1 || variable.indexOf("Citrix_MF_XP")>-1 || variable.indexOf("Citrix_server")>-1 || variable.indexOf(Comptype)>-1 || Comptype.equalsIgnoreCase("ALL"))
								{
									if(variable.indexOf(reqvariable)>-1)
									{
										value = reportInfo.getValue(sub,variable);
									}
								}
							}
							if (value.equals(""))
							{
								value="Avg";
							}
							Vector Report_data = (Vector)Rep_data.get(skey);
%>
	<1--</tr>-->
								<!-- SET COLUMN HEADING FOR DISTRIBUTION RANGE-->
	<thead>
	<tr>
<%
							if(cpRange!=null && dataFor!=null && dataFor.equals("distribution"))
							{
%>
		<th style="text-align:center" width="30%"><egui:intnl text="reporter.common.Range"/></th>
<%
							}
%>
		<th style="text-align:center" width="30%"><egui:intnl text="reporter.common.Server"/></th>
<%
							StringTokenizer stvals = new StringTokenizer(value,",");
							int counttokens = stvals.countTokens();
%>
		<th colspan="<%=counttokens %>" width="30%" wrap style="text-align:center"><%=disname%></th>
		<th width="30%" style="text-align:center"><egui:intnl text="reporter.common.Health"/>%</th>
	</tr>
	<tr>
		<th class="subHeader">&nbsp;</th>
<%
							if(cpRange!=null && dataFor!=null && dataFor.equals("distribution"))
							{
%>
		<th class="subHeader">&nbsp;</th>
<%
							}
							StringTokenizer st_val = new StringTokenizer(value,",");
							while (st_val.hasMoreTokens())
							{
								String tempst=st_val.nextToken();
								vec.add(disname+"("+tempst+")");
%>
		<th class="subHeader"><%=tempst%></th>
<%
							}
							vec.add("Health");
%>
		<td class="subHeader">&nbsp;</td>
	</tr>
	</thead>
								<!-- COMPONENT RANGE DATAS-->
<%
							for (int k=0; k < Report_data.size(); k++)
							{
								Vector data = (Vector)Report_data.get(k);
%>
	<tr>
<%
								String srvr="";
								String strdata="";
								Float temp=null;
								String showRange = "";
								for(int i=0; i<data.size(); i++)
								{
									if (i==0)
									{
										srvr=(String)data.get(i);
										if(cpRange!=null && dataFor!=null && dataFor.equals("distribution"))
										{
											boolean srvFound = false;
											Enumeration c_keys = cpRange.keys();
											showRange = "";
											while(c_keys.hasMoreElements())
											{
												String s_range = (String)c_keys.nextElement();
												Vector v_servers = (Vector)cpRange.get(s_range);
												if(v_servers.contains(srvr))
												{
													showRange = s_range;
													srvFound = true;
												}
												if(Strrange!=null&&!Strrange.equals(showRange))
												{
													continue;
												}
												else
													break;
											}
											if(Strrange!=null&&Strrange.equals(showRange))
											{
%>
		<td wrap  width="10%" align="left"><%=showRange%></td>
<%
												lst_dat.add(showRange);
											}
										}
										if(Strrange!=null && Strrange.equals(showRange))
										{
											String srv="";
											if(srvr.indexOf(".")>-1)
											{
												srv = srvr.substring(0,srvr.indexOf("."));
											}
											else
											{
												srv = srvr;
											}
%>
		<td wrap  width="10%" align="left"><%=srv%></a>
<%
											lst_dat.add(srv);
										}
									}
									else if (i==data.size()-1 && !data.get(i).equals("-"))
									{
										if(Strrange!=null&&Strrange.equals(showRange))
										{
											temp = (Float)data.get(i);
											if (temp.floatValue()==-5.0)
											{
%>
		<td nowrap align="right"> - </td>
<%
												lst_dat.add("-");
											}
											else
											{
%>
		<td nowrap align="right"><%=temp.toString()%></a></td>
<%
												lst_dat.add(temp.toString());
											}
%>
	</tr>
<%
										}
									} else
									{
										if(Strrange!=null&&Strrange.equals(showRange))
										{
											temp=(Float)data.get(i);
											if (temp.floatValue()==-5.0)
												strdata="-";
											else
												strdata=temp.toString();
%>
		<td align="right"><%=strdata%></td>
<%
											lst_dat.add(strdata);
										}
									}
								}//for
							}//for
%>
	</tr>
</table>
<%
						}
						sen.put(vec,lst_dat);
						ht.put(t,sen);
						lst.add(ht);
						lst_dat = new LinkedList();
						lst_dat = new LinkedList();
						sen = new Hashtable();
						ht = new Hashtable();
						vec = new Vector();
						s_test_mes="  ";
						t=" ";
					}

				}
				else //NO MEASURE AVALIABLE FOR ZONE REPORT
				{
%>
<table align="center" width="93%" cellspacing="0" cellpadding="4"  id="tableborder" border="0">
	<tr>
		<td  NOWRAP align="center" width="100%"> <span class="subheader"><egui:intnl text="reporter.common.No measures available for the current selection"/></span></td>
	</tr>
</table>
<%
				}
			}
			else if(forReport!=null && forReport.equals("CtxApplication")) //THIN CLIENT APPLICATION
			{
				String s_farmserver = request.getParameter("select_farm");
				if(appData!=null && appData.size()>0 || appUserData!=null && appUserData.size() >0)
				{
					String skey="";
%>
							<!-- THIN CLIENT APPLICATION REPORT START  -->
	<!--<tr>-->
<%
					if (s_farmserver!=null)
					{
%>
		<!--<td class="printTableHeader"  width="100%" NOWRAP align="center" colspan="7" ><egui:intnl text="reporter.common.Application report"/> <%=headerKeyName%></td>-->
		<div class="printOuterBoxHeader"><egui:intnl text="reporter.common.Application report"/><%=headerKeyName%></div>
<%
						lst.add(intlmap.getTextDescription("reporter.common.Application report")+"  "+headerKeyName);
					}
					//code added to find the values
					String s_test = request.getParameter("er_test");
					String s_measure = request.getParameter("er_meas");
					if(disname.indexOf("*")>-1)
					{
						disname = disname.replace('*','%');
					}
					String reqvariable = "";
					String variable = "";
					String value = "";
					String test_mes="";
					String entry="";
					boolean isUser = false;
					if(disname!=null && !disname.equals("Number of unique users"))
					{
						reqvariable = s_test+":"+s_measure;
						String sub = "APPLICATION_REPORT";
						ArrayList variables = reportInfo.getVariables(sub);
						for(int v=0; v<variables.size();v++)
						{
							variable = (String)variables.get(v);
							if(variable.indexOf(reqvariable)>-1)
							{
								value = reportInfo.getValue(sub,variable);
							}
							}
						if (value.equals(""))
						{
							value="Avg";
						}
					}
					else
					{
						value ="Number";
						isUser = true;
					}
%>
	<!--</tr>-->
	<!-- set Application Component Range -->
<div class="newTable">
	<table align="center" width="100%" cellspacing="0" cellpadding="0" class="printTable"  border="0">
		<thead>
			<tr>
<%
					if(cpRange!=null && dataFor!=null && dataFor.equals("distribution"))
					{
						vec.add("Range");
%>	
		<th style="text-align:center" width="30%"><egui:intnl text="reporter.common.Range"/></th>
<%
					}
%>
		<th style="text-align:center" width="30%"><egui:intnl text="reporter.common.Application"/></th>
<%
					vec.add("Application");
					StringTokenizer stvals = new StringTokenizer(value,",");
					int counttokens = stvals.countTokens();
%>
		<th colspan="<%=counttokens %>" width="30%" wrap style="text-align:center"><egui:intnl text='<%="reporter.common."+disname%>'/></th>
	</tr>
	<tr>
		<th class="subHeader"></th>
<%
					if(cpRange!=null && dataFor!=null && dataFor.equals("distribution"))
					{
%>
		<th class="subHeader"></th>
<%
					}
					StringTokenizer st_val = new StringTokenizer(value,",");
					while (st_val.hasMoreTokens())
					{
						String tempst = st_val.nextToken();
						vec.add(disname+"("+tempst+")");
%>
		<th class="subHeader"><egui:intnl text='<%="reporter.common."+tempst%>'/></th>
<%
					}
%>
	</tr>
	</thead>
<%
					int size = 0;
					if(isUser) size = appUserData.size();
					else size = appData.size();
					for (int k=0; k<size;k++)
					{
						Vector data = null;
						if(isUser)
						{
							data = (Vector)appUserData.get(k);
						}
						else
						{
							data = (Vector)appData.get(k);
						}

						String srvr="";
						String strdata="";
						Float temp=null;
						String showRange = "";
						for(int i=0; i < data.size(); i++)
						{
							if (i==0)
							{
								srvr = (String)data.get(i);
								boolean srvFound = true;
								if(cpRange!=null && dataFor!=null && dataFor.equals("distribution"))
								{
									Enumeration c_keys = cpRange.keys();
									while(c_keys.hasMoreElements())
									{
										String s_range = (String)c_keys.nextElement();
										Vector v_servers = (Vector)cpRange.get(s_range);
										if( v_servers.contains(srvr))
										{
											showRange = s_range;
											srvFound = true;
										}
										else
											srvFound = false;
										if(Strrange!=null&&!Strrange.equals(showRange))
										{
											continue;
										}
										else
											break;
									}
									if(srvFound)
									{
										if(Strrange!=null&&Strrange.equals(showRange))
										{
%>
	<tbody>
	<tr>
		<td wrap  width="10%" align="left"><%=showRange%></td>
<%
											lst_dat.add(showRange);
										}
									}
								}
								int cnt = 0;
								for(int d=1; d < data.size(); d++)
								{
									Float f = (Float)(data.get(d));
									if(f.floatValue() == -5)
									{
										cnt++;
									}
								}
								if(cnt == data.size()-1)
								{
									srvFound = false;
								}
								if(srvFound)
								{
									if(Strrange!=null&&Strrange.equals(showRange))
									{
										String srv="";
										if(srvr.indexOf(".")>-1)
										{
											srv = srvr.substring(0,srvr.indexOf("."));
										}
										else
										{
											srv = srvr;
										}
										String cmpTypeAppName = srv;
										if(srv.indexOf(":") > -1)
										{
											cmpTypeAppName = intlmap.getComponentTypeDescription(		srv.substring(0,srv.indexOf(":")) ) + srv.substring(srv.lastIndexOf(":"));
										}
%>
		<td wrap  width="10%" align="left"><%=cmpTypeAppName%></td>
<%
										lst_dat.add(cmpTypeAppName);
									}
								}
							}
							else if (i==data.size()-1 && !data.get(i).equals("-"))
							{
								temp=(Float)data.get(i);
								if (temp.floatValue()!=-5.0)
								{
									if(Strrange!=null&&Strrange.equals(showRange))
									{
%>
		<td nowrap align="right"><%=temp.toString()%></td>
<%
									lst_dat.add(temp.toString());
									}
								}
							} else
							{
								if(Strrange!=null&&Strrange.equals(showRange))
								{
									temp = (Float)data.get(i);
									if (temp.floatValue()==-5.0)
									{
										strdata="-";
									}
									else
									{
										strdata= temp.toString();
%>
		<td align="right"><%=strdata%></td>
<%
										lst_dat.add(strdata);
									}
								}
							}
						}//for
%>
	</tr>
	</tbody>
<%
					}//for
%>
</table>
<%
				}
				else //Thin Client Application Report  - No Measures Availbles
				{
%>
<table align="center" width="100%" cellspacing="0" cellpadding="0"  border="0">
	<tr>
		<td NOWRAP align="center" width="100%"> <egui:intnl text="reporter.common.No measures available for the current selection"/></td>
	</tr>
</table>
<%
				}
			}
			else if(forReport!=null && forReport.equals("Session")) //THIN CLIENT SESSION REPORT 
			{
				String from = request.getParameter("comeFrom");
				String displayServer="";
				if(server==null)
					displayServer = request.getParameter("select_farm");
				else
					displayServer = server;
				boolean serverEnable=false;
				if(from!=null) //DayWise User Details
				{
%>
<div class="newTable">
<table align="center" width="50%" cellspacing="0" cellpadding="0" border="0">
<%
					if(server==null)
					{
						displayServer = request.getParameter("select_farm");
%>
	<!--<tr>
		<th class="cellbgdark"  width="100%" NOWRAP colspan="0"> &nbsp;<egui:intnl text="reporter.common.Day wise User details for Zone"/> <%=displayServer%>  </th>
	</tr>-->
		<div><egui:intnl text="reporter.common.Day wise User details for Zone"/> <%=displayServer%></div>
<%
						s_test_mes="Day wise User details for Zone "+displayServer;
					}
					else
					{
						displayServer=request.getParameter("select_farm");
%>
	<!--<tr>
		<th class="cellbgdark"  width="100%" NOWRAP colspan="4"> &nbsp;<egui:intnl text="reporter.common.Day wise User details for Zone"/> <%=displayServer%> and Server <%=server%> </th>
	</tr>-->
		<div><egui:intnl text="reporter.common.Day wise User details for Zone"/> &nbsp; <%=displayServer%></div>
<%
						s_test_mes="Day wise User details for Zone "+displayServer+" and Server "+server;
					}
%>
	<thead>
	<tr>
		<th nowrap align="center"><b><egui:intnl text="reporter.common.Date"/></b></th>
		<th nowrap align="center"><b><egui:intnl text="reporter.common.User"/></b></th>
<%
			if(server==null)
			{
				serverEnable=true;
%>
		<th nowrap align="center"><b><egui:intnl text="reporter.common.Server"/></b></th>
<%
			}
%>
	</tr>
	</thead>
	<tr>
<%
					lst_dat = new LinkedList();
					String tempUser="";
					vec = new Vector();
					vec.add("Date");
					vec.add("User");
					if(serverEnable) vec.add("Server");
					String dispstartdate="";
					Iterator itr = userInfo.keySet().iterator();
					while(itr.hasNext())
					{
						String date=(String)itr.next();
						if(date!=null)
						{
							if(DateUtil.isDate(date.trim(),"dd/MM/yyyy"))
							{
								dispstartdate = DateUtil.changeDateFormat(date.trim(),"dd/MM/yyyy",currentDateFormat);
							}else
							{
								dispstartdate = date.trim();
							}
						}
						Vector u_data = (Vector)userInfo.get(date);
		out.println("<td nowrap align=\"center\" rowspan=\""+((u_data.size()/2)+1) +"\">"+dispstartdate+"</td>");
						for(int v=0; v<u_data.size(); v=v+2)
						{
							lst_dat.add(dispstartdate.replace(',',' '));
							String user = (String)u_data.get(v+1);
							lst_dat.add(user);
							if(!tempUser.equals(user))
							{
								int m = u_data.lastIndexOf(user)-u_data.indexOf(user);
								/*if(m!=0)
									m=m-1;*/
		out.println("<td nowrap align=\"left\"rowspan=\""+m+"\">"+user+"</td>");
							}
							if(serverEnable)
							{
								String strDispServerName = (String) u_data.get(v);
								if(strDispServerName!=null && strDispServerName.indexOf(":NULL")>-1)
								{
									strDispServerName = strDispServerName.substring(0,strDispServerName.indexOf(":NULL"));
								}
		out.println("<td nowrap align=\"left\">"+strDispServerName+"</td>");
								lst_dat.add(u_data.get(v));
							}
							/*String duration=(String)u_data.get(v+2);
							lst_dat.add(duration);
							out.println("<td id=\"cellbgapplet\" class=\"blackcontent\" nowrap align=\"center\">"+duration+"</td>");
							out.println("</tr>");
							tempUser=user;*/
						}
					}
%>
	</tr>
</table>
</div>
<%
				}
				else //Thin Client Session Summary Details
				{
					String StrSessions = (String)v_data1.get(0);
					String StrAvgDuration = (String)v_data1.get(1);
					String StrMaxDuration = (String)v_data1.get(2);
					if(ht_data!=null && !ht_data.isEmpty() && v_data1!=null && !v_data1.isEmpty())
					{
						String s_farmserver= request.getParameter("select_farm");
%>
<div class="newTable">
<table align="center" width="50%" cellspacing="0" cellpadding="4" border="0">
<%
						if(StrSessions!=null && !StrSessions.equals("") || StrAvgDuration!=null&&!StrAvgDuration.equals("-") || StrMaxDuration!=null && !StrMaxDuration.equals("-"))
						{
%>
	<!--<tr>
		<th width="100%" NOWRAP align="center" colspan="13"><egui:intnl text="reporter.common.Summary For Session"/> - <%=s_farmserver%></th>
	</tr>-->
		<div class="printOuterBoxHeader"><egui:intnl text="reporter.common.Summary For Session"/> - <%=s_farmserver%></div>	
<%
							lst.add(intlmap.getTextDescription("reporter.common.Summary for Session")+" - "+s_farmserver);
						}
						if(StrSessions!=null&&!StrSessions.equals(""))
						{
%>
	<thead>
	<tr>
		<th width="50%"> <egui:intnl text="reporter.common.Sessions completed"/>(<egui:intnl text="reporter.common.Number"/>)</th>
<%
							vec.add("Sessions completed(Number)");
%>
		<td nowrap align="right"><%
							String data1=(String)v_data1.get(0);
							if(data1!=null&&data1.equals(""))
								data1="-";
							out.println(data1);
							lst_dat.add(data1);
%>
		</td>
	</tr>
<%
							sen.put(vec,lst_dat);
							ht.put(" ",sen);
							lst.add(ht);
							vec = new Vector();
							lst_dat = new LinkedList();
							ht = new Hashtable();
							sen = new Hashtable();
						}
						if(StrAvgDuration!=null&&!StrAvgDuration.equals("-"))
						{
%>
	<tr>
		<th width="50%"><egui:intnl text="reporter.common.Average duration"/> (<egui:intnl text="reporter.common.Mins"/>)</th>
<%
							vec.add("Average duration (Mins)");
%>
		<td nowrap align="right"><%
							String avgdu=(String)v_data1.get(1);
							if(avgdu!=null&&avgdu.equals(""))
								avgdu="-";
							out.println(avgdu);
							lst_dat.add(avgdu);
%>
		</td>
	</tr>
<%
							sen.put(vec,lst_dat);
							ht.put(" ",sen);
							lst.add(ht);
							vec = new Vector();
							lst_dat = new LinkedList();
							ht = new Hashtable();
							sen = new Hashtable();
						}
						if(StrMaxDuration!=null && !StrMaxDuration.equals("-"))
						{
%>
	<tr>
		<th width="50%"><egui:intnl text="reporter.common.Maximum duration"/> (<egui:intnl text="reporter.common.Mins"/>)</th>
<%
							vec.add("Maximum duration (Mins)");
%>
		<td nowrap align="right">
<%
							String maxdu=(String)v_data1.get(2);
							if(maxdu!=null&&maxdu.equals(""))
								maxdu="-";
							out.println(maxdu);
							lst_dat.add(maxdu);
%>
		</td>
	</tr> 
	</thead>
<%
							sen.put(vec,lst_dat);
							ht.put(" ",sen);
							lst.add(ht);
							vec = new Vector();
							lst_dat = new LinkedList();
							ht = new Hashtable();
							sen = new Hashtable();
						}
%>
							<!-- Session Details -->
</table>
</div>

 <div class="newTable">
<table align="center" width="100%" cellspacing="0" cellpadding="4"  id="tableborder" border="0">
	<tr>
		<th class="cellbgdark" width="80%" NOWRAP align="center" colspan="13">
			<table align="center" width="85%" cellspacing="0" cellpadding="4" border="0">
				<tr>
<%
						//code added to find the values
						String s_test = request.getParameter("er_test");
						String s_measure = request.getParameter("er_meas");
						if(disname.indexOf("*")>-1)
						{
							disname = disname.replace('*','%');
						}
						String reqvariable = "";
						String variable = "";
						String value = "";
						String test_mes="";
						String entry="";
						String sub="CITRIX SESSION REPORT";
						reqvariable = s_test+":"+s_measure;
						ArrayList variables = reportInfo.getVariables(sub);
						for(int v=0; v<variables.size(); v++)
						{
							variable = (String)variables.get(v);
							if(variable.indexOf(reqvariable)>-1)
							{
								value = reportInfo.getValue(sub,variable);
							}
						}
						if (value!=null && value.equals(""))
						{
							value="Avg";
						}
						StringTokenizer stvals = new StringTokenizer(value,",");
						int counttokens = stvals.countTokens();
						if (s_farmserver!=null)
						{
							if(!s_test_mes.equalsIgnoreCase("No Of Sessions Completed")) {
								lst.add(intlmap.getTextDescription("reporter.common."+s_test_mes));
							}
							s_test_mes="Session Details -  "+s_farmserver;
%>
					<th class="cellbgdark"  width="100%" NOWRAP align="center" colspan="13" ><egui:intnl text="reporter.common.Session Details"/> - 
	<%						if(s_farmserver.equalsIgnoreCase("--Default--"))
							{
%>
							--<egui:intnl text="reporter.common.Default"/>--</th>
<%
							}
							else
							{
%>							<%=s_farmserver%><B></th>
<%
							}
						}
%>
				</tr>
			</table>
		</th>
	</tr>
						<!-- Session Range Details -->
	<thead>
	<tr width="100%" colspan="13">
<%
						if(cpRange!=null && dataFor!=null && dataFor.equals("distribution"))
						{
							vec.add("Range");
%>
		<th style="text-align:center" width="30%"><egui:intnl text="reporter.common.Range"/></th>
<%
						}
%>
		<th style="text-align:center" width="30%"><egui:intnl text="reporter.common.Server"/></th>
<%
						vec.add("Server");
						if(disname!=null && disname.equals("No Of Sessions Completed"))
						{
							vec.add(disname);
%>
		<th style="text-align:center"><%=disname%></th>
	</tr>
	<tr>
		<th class="subHeader"></th>
		<th class="subHeader"></th>
<%
						}
						else
						{
%>
		<th style="text-align:center" class="printTableHeader2" colspan="<%=counttokens%>"><%=disname%></th></tr>
	<tr>
		<th class="subHeader"></th>
	<%						if(cpRange!=null && dataFor!=null && dataFor.equals("distribution"))
							{
%>
		<th class="subHeader"></th>
<%
							}
							StringTokenizer st_val=new StringTokenizer(value,",");
							while (st_val.hasMoreTokens())
							{
								String tempst = st_val.nextToken();
								vec.add(disname+"("+tempst+")");
%>
		<th class="subHeader"><%=tempst%></th>
<%
							}
						}
%>
	</tr>
	</thead>
	<tbody>
<%	
						ArrayList Report_data = new ArrayList();
						String skey1="";
						String showRange = "";
						Iterator itr1 = ht_data.keySet().iterator();
						while(itr1.hasNext())
						{
							skey1 = (String)itr1.next();
							Report_data = (ArrayList)ht_data.get(skey1);
	%>
	<tr>
	<%
							if(cpRange!=null && dataFor!=null && dataFor.equals("distribution"))
							{
								boolean srvFound = false;
								Enumeration c_keys = cpRange.keys();
								while(c_keys.hasMoreElements())
								{
									showRange ="";
									String s_range = (String)c_keys.nextElement();
									Vector v_servers = (Vector)cpRange.get(s_range);
									if(v_servers.contains(skey1))
									{
										showRange = s_range;
										srvFound = true;
									}
									if(Strrange!=null&&!Strrange.equals(showRange))
									{
										continue;
									}
									else
										break;
								}
								if(Strrange!=null&&Strrange.equals(showRange))
								{
%>
		<td wrap  width="10%" align="left"><%=showRange%></td>
<%
									lst_dat.add(showRange);
								}
							}
							if(Strrange!=null&&Strrange.equals(showRange))
							{
								lst_dat.add(skey1);
%>
		<td nowrap align="left"><%=skey1%></td>
<%
							}
							for(int i=0;i<Report_data.size();i++)
							{
								if(Strrange!=null&&Strrange.equals(showRange))
								{
%>
		<td nowrap align="center" ><%=(String)Report_data.get(i)%></td>
<%
											lst_dat.add((String)Report_data.get(i));
								}
							}
						}
%>
	</tr>
	</tbody>
</table>
<%
					}
					else //Thin Client Session Report -No Data Available
					{
%>
<table align="center" width="93%" cellspacing="0" cellpadding="0" border="0">
	<tr>
		<td NOWRAP align="center" width="100%"> <egui:intnl text="reporter.common.No measures available for the current selection"/></td>
	</tr>
</table>
<%
					}
				}
			}
			else
			{
				lst.add("No measures available for the current selection");
%>
<table align="center" width="100%" cellspacing="0" cellpadding="0" border="0" height="100%">
	<tr>
		<td  NOWRAP align="center" width="100%" height="100%" valign="middle">
			<img src="/final/images/Light/nomeasures_custom.png"/>
		</td>
	</tr>
</table>
<%
			}
%>
<%
			}
		}else
		{
				
%>                
<table align="center" width="100%" cellspacing="0" cellpadding="0" border="0" height="100%">
	<tr>
		<td  NOWRAP align="center" width="100%" height="100%" valign="middle">
			<img src="/final/images/Light/nomeasures_custom.png"/>
		</td>
	</tr>
</table>
<%
		}
%>
<%
	}
	else //Users Measure DD Data,Pie Chart Graph DD
	{
%>

<!--<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" style="border-bottom:1px solid #ccc;">
	<tr>
		<td align="left" valign="top">-->
	<div class="printOuterBoxNoBorder">
<%
		String s_type = request.getParameter("er_gtype");
		if(s_type != null && s_type.equalsIgnoreCase("intersnap")) {
			s_type = "Intersnap";
		}
		if(s_type!=null&&s_type.equals("Citrix"))
		{
			if(forReport!=null && forReport.equalsIgnoreCase("Farm"))
			{
				String type = request.getParameter("er_check");
				if(type!=null && type.equals("operation"))
				{
					lst.add(intlmap.getTextDescription("reporter.common.Consolidated Data for")+" "+request.getParameter("select_farm"));
%>
		<!--	<div style="clear:both;float:left;padding:4px;">
				<div style="float:left" class="formLabel"><egui:intnl text="reporter.common.Consolidated Data for"/></div>
				<div style="float:left;width:10px" align="center" >-</div>
				<div style="float:left;" class="formValue"><%= request.getParameter("select_farm")%> </div>
			</div>-->
			<div class="printSelectionFields" ><egui:intnl text="reporter.common.Consolidated Data for"/> - <span class="bold"><%= request.getParameter("select_farm")%> </span></div>

<%
				}
				else
				{
					lst.add(intlmap.getTextDescription("reporter.common.Thin Client Data for")+" "+request.getParameter("select_farm"));
%>
			<!--<div style="clear:both;float:left;padding:4px;">
				<div style="float:left" class="formLabel"><egui:intnl text="reporter.common.Thin Client Data for"/></div>
				<div style="float:left;width:10px" align="center" >-</div>
				<div style="float:left;" class="formValue"><%= request.getParameter("select_farm")%> </div>
			</div>-->
			<div class="printSelectionFields" ><egui:intnl text="reporter.common.Thin Client Data for"/> - <span class="bold"><%= request.getParameter("select_farm")%></span></div>	
<%
				}
			}
			else
			{
				if(request.getParameter("comeFrom")==null)
				{
					String printTest="";
					if(request.getParameter("select_testmes")!=null)
					{
						if(request.getParameter("er_test").indexOf("Ctx")>-1)
							printTest="Thin Client";
						if(request.getParameter("er_test").indexOf("Term")>-1)
							printTest="Thin Client";
					}

%>
			<!--<div style="clear:both;float:left;padding:4px;">
				<div style="float:left" class="formLabel"><%=printTest%>&nbsp;<egui:intnl text="reporter.common.Data for"/></div>
				<div style="float:left;width:10px" align="center" ></div>
				<div style="float:left;" class="formValue">&nbsp;<%= headerKeyName%> </div>
			</div>-->
			<div class="printSelectionFields" ><egui:intnl text="reporter.common.Data for"/> - <span class="bold"><egui:intnl text='<%=headerKeyName%>' /></span></div>

<%
					lst.add(printTest+" "+intlmap.getTextDescription("reporter.common.Data for")+" "+headerKeyName);
				}
			}
		}
		else
		{
			if("Micro".equalsIgnoreCase(request.getParameter("er_rtype")) && "CitrixUser".equalsIgnoreCase(request.getParameter("er_trgttype")))
			{
%>
			<!--<div style="clear:both;float:left;padding:4px;">
				<div style="float:left" class="formLabel"><%=s_type%>&nbsp;<egui:intnl text="reporter.common.Data for Farm"/></div>
				<div style="float:left;width:10px" align="center" >-</div>
				<div style="float:left;" class="formValue"><%= request.getParameter("select_farm")%></div>
			</div>-->
			<div class="printSelectionFields" ><%=s_type%>&nbsp;<egui:intnl text="reporter.common.Data for Farm"/> - <span class="bold"><%= request.getParameter("select_farm")%></span></div>

			<!--<div style="clear:both;float:left;padding:4px;">
				<div style="float:left" class="formLabel"><egui:intnl text="reporter.common.Component"/></div>
				<div style="float:left;width:10px" align="center" >-</div>
				<div style="float:left;" class="formValue"><%=request.getParameter("er_component")%></div>
			</div>-->
			<div class="printSelectionFields" ><egui:intnl text="reporter.common.Component"/> - <span class="bold"><%=request.getParameter("er_component")%></span></div>

			<!--<div style="clear:both;float:left;padding:4px;">
				<div style="float:left" class="formLabel"><egui:intnl text="reporter.common.User"/></div>
				<div style="float:left;width:10px" align="center" >-</div>
				<div style="float:left;" class="formValue">-->
				<div class="printSelectionFields" ><egui:intnl text="reporter.common.User"/> -
<%
					String temp_user = request.getParameter("er_user");
					if(temp_user == null)
						temp_user = request.getParameter("er_tuser");
%>
				<!--</div>
			</div>-->
			 <span class="bold"><%=temp_user%></span></div>
<%

			}
			else
			{
%>
			<!--<div style="clear:both;float:left;padding:4px;">
				<div style="float:left" class="formLabel"><%= s_type%>&nbsp;<egui:intnl text="reporter.common.Data for"/></div>
				<div style="float:left;width:10px" align="center" >-</div>
				<div style="float:left;" class="formValue"><%= request.getParameter("er_component")%></div>
			</div> -->

			<div class="printSelectionFields" ><%= s_type%>&nbsp;<egui:intnl text="reporter.common.Data for"/> - <span class="bold"><%= request.getParameter("er_component")%></span></div>
<%
			}
			lst.add(s_type+" "+intlmap.getTextDescription("reporter.common.Data for")+" "+request.getParameter("er_component"));
		}

 


		String str_testMeas=request.getParameter("select_testmes");
		if(request.getParameter("er_dismeas")!=null)
		{
			if(s_type!=null&&s_type.equals("Citrix"))
			{
				disname  = request.getParameter("er_dismeas");
				if(disname!=null && disname.indexOf("*")>-1)
				{
					disname = disname.replace('*','%');
				}
				if(erd.s_test!=null && !erd.s_test.equals(""))
				{
					//s_test_mes = erd.s_test + "/" +disname;
					if(str_testMeas!=null && str_testMeas.indexOf("/")>-1)
					{
						String str_tempMeas = str_testMeas.substring(str_testMeas.indexOf("/")+1);
						s_test_mes = intlmap.getMeasureDescription(erd.s_test,str_tempMeas);
					}
				}
				else
					s_test_mes = disname;
			}
			else
			{
				if(erd.s_test != null && erd.s_disp_meas != null)
				{
					if (erd.s_test.endsWith("_trend"))
					{
						erd.s_test=erd.s_test.substring(0,erd.s_test.lastIndexOf("_"));
						erd.s_measure=erd.s_measure.substring(0,erd.s_measure.lastIndexOf("_"));
					}
					s_mes_unit = tablesInfo.getUnitForMeasure(erd.s_test,erd.s_disp_meas);
				}
				s_test_mes = intlmap.getTestDescription(erd.s_test) + "/" + intlmap.getMeasureDescription(erd.s_test,erd.s_measure) + " (" + s_mes_unit + ")";
			}
%>
			<!--<div style="clear:both;float:left;padding:4px;">
				<div style="float:left" class="formLabel"><egui:intnl text="reporter.common.Criteria"/></div>
				<div style="float:left;width:10px" align="center" >:</div>
				<div style="float:left;" class="formValue"><%=s_test_mes%></div>
			</div>-->
			<div class="printSelectionFields" ><egui:intnl text="reporter.common.Criteria"/> - <span class="bold"><egui:intnl text='<%=s_test_mes%>' /></span></div>
<%
		}
		if(request.getParameter("er_disp_meas")!=null && !request.getParameter("er_disp_meas").equals(""))
		{
			String strdispMeas = request.getParameter("er_disp_meas");
			String strTest = request.getParameter("er_test");
			lst.add(intlmap.getTestDescription(strTest) + "/" + intlmap.getMeasureDescription(strTest,strdispMeas));
%>
			<!-- <div style="clear:both;float:left;padding:4px;">
				<div style="float:left;" class="formValue"><egui:intnl test="<%=strTest%>"/>/<egui:intnl measure= '<%=strTest+":"+strdispMeas%>'/></div>
			</div> -->
			<div class="printSelectionFields" ><egui:intnl text="reporter.common.VM Details"/> - <span class="bold"><egui:intnl text="<%=strTest%>"/>/<egui:intnl measure= '<%=strTest+":"+strdispMeas%>'/></span></div>
<%
		}
%>
		</td>
		<td align="right" valign="top">
<%
		String strhrmin="";
		String enhrmin="";
		String strstartHrMin="";
		String strEndHrMin="";
		String d1="";
		String  d2="";
		if(erd.s_gtype !=null && (erd.s_gtype.equalsIgnoreCase("intersnap") || erd.s_gtype.equalsIgnoreCase("intrasnap") ) )
		{
			strhrmin = erd.s_sthr+" "+"Hrs "+erd.s_startmin+" Mins";
			enhrmin = erd.s_endhr+" Hrs "+erd.s_endmin+" Mins";
		}
		else
		{
				strhrmin = erd.s_sthr+":"+erd.s_startmin+"Hrs ";
				strstartHrMin = erd.s_sthr+":"+erd.s_startmin;
				enhrmin = erd.s_endhr+":"+erd.s_endmin+"Hrs ";
				strEndHrMin = erd.s_endhr+":"+erd.s_endmin;
		}
		String st_dateone="";
		String en_dateone="";
		if(erd.s_stdate.indexOf(" ")>-1)
			st_dateone = erd.s_stdate.substring(0,erd.s_stdate.lastIndexOf(" "));
		else
			st_dateone = erd.s_stdate;
		if(erd.s_enddate.indexOf(" ")>-1)
			en_dateone = erd.s_enddate.substring(0,erd.s_enddate.indexOf(" "));
		else
			en_dateone = erd.s_enddate;

		d1 = erd.s_stdate.trim()+ " " + strstartHrMin;
		d2 = erd.s_enddate.trim()+ " " + strEndHrMin;

		timeZoneConverterStart = new EgTimeZoneConverter(d1,thisuser);
		timeZoneConverterEnd = new EgTimeZoneConverter(d2,thisuser);
		String convertd1 = timeZoneConverterStart.getDateTime();
		String convertd2 = timeZoneConverterEnd.getDateTime();
%>
			
			<!--<div style="float:right;padding:4px;">
				<div style="float:left" class="formLabel"><egui:intnl text="reporter.common.Start Date"/></div>
				<div style="float:left;width:10px" align="center" >:</div>
				<div style="float:left;" class="formValue"><%=convertd1%></div>
			</div>
			<div style="clear:both;float:right;padding:4px;">
				<div style="float:left" class="formLabel"><egui:intnl text="reporter.common.End Date"/></div>
				<div style="float:left;width:10px" align="center">:</div>
				<div style="float:left;" class="formValue"><%=convertd2%></div>
			</div>-->
			<div class="printSelectionFields"><egui:intnl text="reporter.common.Timeline" /> - <span class="bold"><%=convertd1%>&nbsp;<egui:intnl text="reporter.common.hrs" /> to <%=convertd2%>&nbsp;<egui:intnl text="reporter.common.hrs" /></span></div>
<%
		Vector dvec = new Vector();
		dvec.add("\""+intlmap.getTextDescription("reporter.common.Start Date")+" : "+convertd1+"\"");
		dvec.add("\""+intlmap.getTextDescription("reporter.common.End Date")+" :"+convertd2+"\"");
		lst.add(dvec);
%>
		<!--</td>
	</tr>
</table>-->
	</div>

<%
		if(v_dates!=null && v_dates.size()!=0)
		{
%>
							<!-- set Measure Data column name here -->
   <div class="clearDiv">&nbsp;</div>
 <div class="newTable">
 <table border="0" cellspacing="0" align="center" cellpadding="0" width="100%">
<thead>
	<tr>
		<th class="printTableHeader1" style="text-align:center" width="<%=wsize%>%" nowrap><egui:intnl text="reporter.common.Measurement time"/></th>
<%
			vec.add("Measurement time");
			String s_tmp = new String();
			for(int i=0;i<v_infos.size();i++)
			{
				s_tmp = (String)v_infos.elementAt(i);
				s_tmp = s_tmp.substring(s_tmp.indexOf("+")+1);
				if(s_tmp.equals("")||s_tmp==null)
					s_tmp = "DATA";
				else if((s_tmp.length()>10) && (s_tmp.indexOf("MAX_HI")> -1   || s_tmp.indexOf("MAX_MED") > -1 
														|| s_tmp.indexOf("MAX_LOW")> -1 || s_tmp.indexOf("MIN_HI") > -1 
														|| s_tmp.indexOf("MIN_MED")> -1 || s_tmp.indexOf("MIN_LOW") > -1) )
				s_tmp = s_tmp.substring(0,7)+"<br>"+s_tmp.substring(7,s_tmp.length());
									out.println("<th class=\"tdborder\" id=\"er_submit\" wrap style=\"text-align:center \" width=\""+wsize+"%\" >"+s_tmp+"</th>");
				vec.add(s_tmp);
			}
%>
	</tr>
	</thead>
<%
			String s_check = new String();
			String s_checkdate = new String();
			String s_tmpdata = new String();
			String s_tmpdata1 = new String();
			String s_tmpmin = new String();
			String s_tmpmax = new String();
			boolean minthresh = false;
			boolean maxthresh = false;
			out.println("<!-- set Measure Data column values here -->");
			for (int kk=0;kk < v_dates.size();kk++)
			{
				s_check = (String)v_dates.elementAt(kk);
				if(s_check!=null) {
					s_check = s_check.substring(0,s_check.lastIndexOf(":"));
				}
				String formatdisp = DateUtil.changeDateFormat(s_check.substring(0,s_check.indexOf(" ")).trim(),"MM/dd/yyyy",currentDateFormat);
				timeZoneConverterStart = new EgTimeZoneConverter(formatdisp+" "+s_check.substring(s_check.indexOf(" ")),thisuser);
				lst_dat.add("\""+timeZoneConverterStart.getDateTime()+"\"");
				
	out.println("<tr height=\"22\">");
		out.println("<td nowrap align=\"center\" >");
		out.println(timeZoneConverterStart.getDateTime());
		out.println("</td>");
				//NEW CODE FOR SNAPSHOT STARTS
				if(erd.s_gtype !=null && ( (erd.s_gtype.equalsIgnoreCase("intersnap")) || (erd.s_gtype.equalsIgnoreCase("intrasnap")) )  )
				{
					if(v_infos.size() == 3)
					{
						for(int ii=0;ii<v_infos.size();ii+=3)
						{
							try
							{
								s_tmpdata = (String) h_data[ii].get((String)v_dates.elementAt(kk));
								s_tmpmin = (String) h_data[ii+1].get((String)v_dates.elementAt(kk));
								s_tmpmax = (String) h_data[ii+2].get((String)v_dates.elementAt(kk));
							}
							catch(Exception e)
							{
								System.out.println("exception caught srihari :"+e);
								s_tmpdata=null;
								s_tmpmin = null;
								s_tmpmax = null;
							}

							if(s_tmpdata==null) s_tmpdata="-";
							if(s_tmpmin==null) s_tmpmin="-";
							if(s_tmpmax==null) s_tmpmax="-";

							try
							{
								if(s_tmpmin != null && ! s_tmpmin.equals("-") )
								{
									if(Float.parseFloat(s_tmpdata) < Float.parseFloat(s_tmpmin))
									{
										minthresh = true;
									}
									else
										minthresh=false;
								}
								if(s_tmpmax !=null && !s_tmpmax.equals("-"))
								{
									if(Float.parseFloat(s_tmpdata) > Float.parseFloat(s_tmpmax))
									{
										maxthresh=true;
									}
									else
										maxthresh=false;
								}
							}
							catch(Exception ex)
							{
								maxthresh = false;
								minthresh = false;
							}

							if(minthresh)
							{
								out.print("<td nowrap align=\"center\" >");
								out.println("<div style=\"float:left;width:80%;text-align:center\">"+s_tmpdata+"</div><div style=\"float:right\"><img class=\"iconPanelDownArrow\" src=\"/final/images/spacer.gif\" height=\"16px\" align=\"center\"></div>");
							}
							else if(maxthresh)
							{
								out.print("<td nowrap align=\"center\" >");
								out.println("<div style=\"float:left;width:80%;text-align:center\">"+s_tmpdata+"</div><div style=\"float:right\"><img class=\"iconPanelUpArrow\" src=\"/final/images/spacer.gif\" height=\"16px\" align=\"center\"></div>");
							}
							else if(!minthresh && !maxthresh)
							{
								out.print("<td nowrap align=\"center\" >");
								out.println("<div style=\"float:left;width:80%;text-align:center\">"+s_tmpdata+"</div><div style=\"float:right\"><img src=\"/final/images/spacer.gif\" height=\"16px\" align=\"center\"></div>");
							}
								out.println("</td>");

								out.print("<td nowrap align=\"center\" >"); out.println(s_tmpmin);
								out.println("</td>");
								out.print("<td nowrap align=\"center\" >"); out.println(s_tmpmax);
								out.println("</td>");
						}
						lst_dat.add(s_tmpdata);
						lst_dat.add(s_tmpmin);
						lst_dat.add(s_tmpmax);
					}
					else
					if(v_infos.size() == 2)
					{
						for(int ii=0;ii<v_infos.size();ii+=2)
						{
							try
							{
								s_tmpdata = (String) h_data[ii].get((String)v_dates.elementAt(kk));
								if(v_infos.contains("MIN Threshold"))
								{
									s_tmpmin = (String) h_data[ii+1].get((String)v_dates.elementAt(kk));
								}
								if(v_infos.contains("MAX Threshold"))
								{
									s_tmpmax = (String) h_data[ii+1].get((String)v_dates.elementAt(kk));
								}
								if (!v_infos.contains("MIN Threshold") && !v_infos.contains("MAX Threshold") )
								{
									s_tmpdata1 = (String) h_data[ii+1].get((String)v_dates.elementAt(kk));
								}
							}
							catch(Exception e)
							{
								System.out.println("exception caught srihari :"+e);
								//s_tmpdata=null;
								s_tmpdata1=null;
								s_tmpmin = null;
								s_tmpmax = null;
							}
							if(s_tmpdata==null) s_tmpdata="-";
							if(s_tmpmin==null) s_tmpmin="-";
							if(s_tmpmax==null) s_tmpmax="-";
							if(s_tmpdata1==null) s_tmpdata1="-";
							try
							{
								if(s_tmpmin != null && ! s_tmpmin.equals("-") && !(s_tmpmin.equals("")))
								{
									if(Float.parseFloat(s_tmpdata) < Float.parseFloat(s_tmpmin))
									{
										minthresh = true;
									}
									else
									{
										minthresh=false;
									}
								}
								if(s_tmpmax !=null && !s_tmpmax.equals("-") && !(s_tmpmax.equals("")) )
								{
									if(Float.parseFloat(s_tmpdata) > Float.parseFloat(s_tmpmax))
									{
										maxthresh=true;
									}
									else
									{
										maxthresh=false;
									}
								}
							}
							catch(Exception ex)
							{
								maxthresh = false;
								minthresh = false;
							}

							if(minthresh) //   #DFDF00 - yellow #FF1EFF . #CC00DD magenta 
							{
								out.print("<td nowrap align=\"center\" >");
								out.println("<div style=\"float:left;width:80%;text-align:center\">"+s_tmpdata+"</div><div style=\"float:right\"><img class=\"iconPanelDownArrow\" src=\"/final/images/spacer.gif\" height=\"16px\" align=\"center\"></div>");
								lst_dat.add(s_tmpdata);
							}
							if(maxthresh)
							{
								out.print("<td nowrap align=\"center\" valign=\"middle\">");
								out.println("<div style=\"float:left;width:80%;text-align:center\">"+s_tmpdata+"</div><div style=\"float:right\"><img class=\"iconPanelUpArrow\" src=\"/final/images/spacer.gif\" height=\"16px\" align=\"center\"></div>");
								lst_dat.add(s_tmpdata);
							}
							if(!minthresh && !maxthresh)
							{
								out.print("<td nowrap align=\"center\" >");
								out.println("<div style=\"float:left;width:80%;text-align:center\">"+s_tmpdata+"</div><div style=\"float:right\"><img src=\"/final/images/spacer.gif\" height=\"16px\" align=\"center\"></div>");
								lst_dat.add(s_tmpdata);
								if (!s_tmpdata1.equals(""))	
								{
									out.print("<td nowrap align=\"center\" >");
									out.println("<div style=\"float:left;width:80%;text-align:center\">"+s_tmpdata1+"</div><div style=\"float:right\"><img src=\"/final/images/spacer.gif\" height=\"16px\" align=\"center\"></div>");
									lst_dat.add(s_tmpdata1);
								}
							}
							out.println("</td>");

							if(s_tmpmin != null && !(s_tmpmin.equals("-")) && !(s_tmpmin.equals("")))
							{
								out.print("<td nowrap align=\"center\" >"); out.println(s_tmpmin); out.println("</td>");
								lst_dat.add(s_tmpmin);
							}
							if(s_tmpmax != null && !(s_tmpmax.equals("-")) && !(s_tmpmax.equals("")) )
							{
								out.print("<td nowrap align=\"center\" >"); out.println(s_tmpmax); out.println("</td>");
								lst_dat.add(s_tmpmax);
							}
						}
					}
					else
					{
						int incr =0;
						if(v_infos.size() == 4)
							incr =4;
						else if(v_infos.size() == 7)
							incr =7;
						else 
							incr=1;

						boolean maxcheck = false;
						boolean mincheck = false;
						String s_max="",s_min="";
						if(iniui.getStateDisplayLabel("MAX_HI")!= null)
							s_max = iniui.getStateDisplayLabel("MAX_HI");
						else
							s_max="MAX";
						if(iniui.getStateDisplayLabel("MIN_HI")!= null)
							s_min = iniui.getStateDisplayLabel("MIN_HI");
						else
							s_min="MIN";

						String s_infos="";
						StringBuffer sb = new StringBuffer(s_infos);
						for(int i=0;i<v_infos.size();i++)
							sb.append(v_infos.get(i).toString());

						s_infos = sb.toString();
						if(s_infos.indexOf(s_max)> -1)
							maxcheck = false;
						if(s_infos.indexOf(s_min)> -1)
							mincheck = false;
						
						if(!(maxcheck && mincheck))
						{
							for(int jj=0;jj<v_infos.size();jj++)
							{
								try
								{
									s_check = (String) h_data[jj].get((String)v_dates.elementAt(kk));
									if (s_check==null || s_check.length()==0)
										s_check="-";
									out.print("<td nowrap align=\"center\" >"); out.println(s_check); out.println("</td>");
									lst_dat.add(s_check);
								}catch(Exception e)
								{
									System.out.println("exception caught srihari :"+e);
								}
								if(s_check==null)
								{
									s_check = "";
								}
							}
						}else
						{
							for(int jj=0;jj<v_infos.size();jj=jj+incr)
							{
								try
								{
									s_check = (String) h_data[jj].get((String)v_dates.elementAt(kk));
									//max mul threshold condn
									if(maxcheck && mincheck)
									{
										String s_max1 = (String)h_data[jj+1].get((String)v_dates.elementAt(kk));
										String s_max2 = (String)h_data[jj+2].get((String)v_dates.elementAt(kk));
										String s_max3 = (String)h_data[jj+3].get((String)v_dates.elementAt(kk));
										try
										{
											if(s_max1!= null && s_max2!= null && s_max3!=null)
											maxthresh = (Float.parseFloat(s_max1)<Float.parseFloat(s_check)) || (Float.parseFloat(s_max2)<Float.parseFloat(s_check)) ||
											(Float.parseFloat(s_max3)<Float.parseFloat(s_check));
										}
										catch(Exception eer)
										{
											maxthresh = false;
										}

										String s_min1 = (String)h_data[jj+4].get((String)v_dates.elementAt(kk));
										String s_min2 = (String)h_data[jj+5].get((String)v_dates.elementAt(kk));
										String s_min3 = (String)h_data[jj+6].get((String)v_dates.elementAt(kk));
										try
										{
											if(s_min1!= null && s_min2!= null && s_min3!=null)
											minthresh = (Float.parseFloat(s_min1)>Float.parseFloat(s_check)) || (Float.parseFloat(s_min2)>Float.parseFloat(s_check)) ||
											(Float.parseFloat(s_min3)>Float.parseFloat(s_check));
										}
										catch(Exception eer)
										{
											minthresh = false;
										}
										out.print("<td nowrap align=\"center\" >");
										if(maxthresh)
										{
											out.println("<div style=\"float:left;width:80%;text-align:center\">"+s_check+"</div><div style=\"float:right\"><img class=\"iconPanelUpArrow\" src=\"/final/images/spacer.gif\" height=\"16px\" align=\"center\"></div>");
											lst_dat.add(s_check);
										}
										else if(minthresh)
										{
											out.println("<div style=\"float:left;width:80%;text-align:center\">"+s_check+"</div><div style=\"float:right\"><img class=\"iconPanelDownArrow\" src=\"/final/images/spacer.gif\" height=\"16px\" align=\"center\"></div>");
											lst_dat.add(s_check);
										}
										else
										{
											out.println("<div style=\"float:left;width:80%;text-align:center\">"+s_check+"</div><div style=\"float:right\"><img src=\"/final/images/spacer.gif\" height=\"16px\" align=\"center\"></div>");
											lst_dat.add(s_check);
										}
										out.println("</td>");

										out.print("<td nowrap align=\"center\"  >"); out.println(s_max1);
										out.println("</td>");
										lst_dat.add(s_max1);

										out.print("<td nowrap align=\"center\"  >"); out.println(s_max2);
										out.println("</td>");
										lst_dat.add(s_max2);

										out.print("<td nowrap align=\"center\"  >"); out.println(s_max3);
										out.println("</td>");
										lst_dat.add(s_max3);

										out.print("<td nowrap align=\"center\"  >"); out.println(s_min1);
										out.println("</td>");
										lst_dat.add(s_min1);

										out.print("<td nowrap align=\"center\"  >"); out.println(s_min2);
										out.println("</td>");
										lst_dat.add(s_min2);

										out.print("<td nowrap align=\"center\"  >"); out.println(s_min3);
										out.println("</td>"); 
										lst_dat.add(s_min3);
									}//for both condn
									else if(maxcheck)
									{
										String s_max1 = (String)h_data[jj+1].get((String)v_dates.elementAt(kk));
										String s_max2 = (String)h_data[jj+2].get((String)v_dates.elementAt(kk));
										String s_max3 = (String)h_data[jj+3].get((String)v_dates.elementAt(kk));
										try
										{
											if(s_max1!= null && s_max2!= null && s_max3!=null)
											maxthresh = (Float.parseFloat(s_max1)<Float.parseFloat(s_check)) || (Float.parseFloat(s_max2)<Float.parseFloat(s_check)) ||
											(Float.parseFloat(s_max3)<Float.parseFloat(s_check));
										}
										catch(Exception ww)
										{
											maxthresh = false;
										}
										out.print("<td nowrap align=\"center\" >");

										if(maxthresh)
										{
											out.println("<div style=\"float:left;width:80%;text-align:center\">"+s_check+"</div><div style=\"float:right\"><img class=\"iconPanelUpArrow\" src=\"/final/images/spacer.gif\" height=\"16px\" align=\"center\"></div>");
											lst_dat.add(s_check);
										}
										else
										{
											out.println("<div style=\"float:left;width:80%;text-align:center\">"+s_check+"</div><div style=\"float:right\"><img src=\"/final/images/spacer.gif\" height=\"16px\" align=\"center\"></div>");
											lst_dat.add(s_check);
										}
										out.println("</td>");

										out.print("<td nowrap align=\"center\" >");
										out.println(s_max1); out.println("</td>");
										lst_dat.add(s_max1);
								
										out.print("<td nowrap align=\"center\" >");
										out.println(s_max2);
										out.println("</td>");
										lst_dat.add(s_max2);

										out.print("<td nowrap align=\"center\" >");
										out.println(s_max3);
										out.println("</td>");
									}
									else if(mincheck)
									{
										String s_min1 = (String)h_data[jj+1].get((String)v_dates.elementAt(kk));
										String s_min2 = (String)h_data[jj+2].get((String)v_dates.elementAt(kk));
										String s_min3 = (String)h_data[jj+3].get((String)v_dates.elementAt(kk));
										try
										{
											if(s_min1!= null && s_min2!= null && s_min3!=null)
											minthresh = (Float.parseFloat(s_min1)>Float.parseFloat(s_check)) || (Float.parseFloat(s_min2)>Float.parseFloat(s_check)) ||
											(Float.parseFloat(s_min3)>Float.parseFloat(s_check));
										}
										catch(Exception qq)
										{
											minthresh = false;
										}
										out.print("<td nowrap align=\"center\" >");

										if(minthresh)
										{
											out.println("<div style=\"float:left;width:80%;text-align:center\">"+s_check+"</div><div style=\"float:right\"><img class=\"iconPanelDownArrow\" src=\"/final/images/spacer.gif\" height=\"16px\" align=\"center\"></div>");
											lst_dat.add(s_check);
										}
										else
										{
											out.println("<div style=\"float:left;width:80%;text-align:center\">"+s_check+"</div><div style=\"float:right\"><img src=\"/final/images/spacer.gif\" height=\"16px\" align=\"center\"></div>");
											lst_dat.add(s_check);
										}
										out.println("</td>");

										out.print("<td nowrap align=\"center\" >");
										out.println(s_min1);
										out.println("</td>");
										lst_dat.add(s_min1);

										out.print("<td nowrap align=\"center\" >");
										out.println(s_min2);
										out.println("</td>");
										lst_dat.add(s_min2);

										out.print("<td nowrap align=\"center\" >");
										out.println(s_min3);
										out.println("</td>");
										lst_dat.add(s_min3);
									}
									else if(!(maxcheck && mincheck) && (incr==1))
									{
										if (s_check==null)
											s_check="-";
										out.print("<td nowrap align=\"center\" >");
										out.println(s_check);
										out.println("</td>");
										lst_dat.add(s_check);
									}
								}catch(Exception e)
								{
									System.out.println("exception caught srihari :"+e);
									s_check=null;
								}
								if(s_check==null)
								{
									s_check = "";
								}
							}
						}
					}
	out.println("</tr>");
				}//for snapshot specific //new code for snapshot ends
				else //for other usual case
				{
					for(int jj=0;jj<v_infos.size();jj++)
					{
						out.print("<td nowrap align=\"center\" >");
						try
						{
							s_check = (String) h_data[jj].get((String)v_dates.elementAt(kk));
						}catch(Exception e)
						{
							System.out.println("exception caught srihari :"+e);
							s_check=null;
						}
						if(s_check==null || s_check.equals("-5.0"))
						{
							s_check = "-";
						}
						out.println(s_check);
						lst_dat.add(s_check);
						out.println("</td>");
					}
	out.println("</tr>");
				}//else for other cases
				out.println("<!-- End Measure Data values -->");
			}
			%>
</table>
</div>
			<%
		}
		else if (forReport!=null && forReport.equals("Farm")) //ZONE REPORT GRAPH RANGE DATA
		{
			String s_farmserver = request.getParameter("select_farm");
			if (ht_avg!=null && !ht_avg.isEmpty())
			{
				String avg = "";
%>
						<!-- SET ZONE REPORT PIE CHART DISTRIBUTION GRAPH - SUMMARY DETAILS-->
<div class="clearDiv">&nbsp;</div>
<div class="printOuterBox">
	<div class="newTable">
	<div class="printOuterBoxHeader"><egui:intnl text="reporter.common.Summary for Zone"/> -
			<%=s_farmserver%></div>
	<table border="0" cellspacing="0" align="center" cellpadding="0" width="100%">
		
	<%
					lst.add(intlmap.getTextDescription("reporter.common.Summary for Zone")+" - "+s_farmserver);
					avg = (String)ht_avg.get(erd.s_test+":"+disname);
					if (avg==null || avg.equals("-5.0"))
						avg="-";
					String dispname="";
					if(disname!=null)
						dispname = disname;
	%>
		<tr>
			<td width="30%" wrap align="left"><%=dispname%>- <egui:intnl text="reporter.common.Avg"/></td>
			<td nowrap  align="right" width="30%"> <%=avg%> </td>
		</tr>
	<%
					vec.add(disname+"(Avg)");
					lst_dat.add(avg);
					String  normal=(String)ht_avg.get("Normal %");
					if (normal==null || normal.equals("-5.0"))
						normal="-";
	%>
		<tr>
			<td  wrap align="left"> <egui:intnl text="reporter.common.Component Health"/> - <egui:intnl text="reporter.common.Normal"/> % - <egui:intnl text="reporter.common.Avg"/></td>
			<td nowrap  align="right"> <%=normal%> </td>
		</tr>
	</table>
	</div>
	<div class="clearDiv">&nbsp;</div>
<%
				vec.add("Component Health - Normal % (Avg)");
				lst_dat.add(normal);
				sen.put(vec,lst_dat);
				ht.put(s_test_mes,sen);
				lst.add(ht);
				vec = new Vector();
				lst_dat = new LinkedList();
				ht = new Hashtable();
				sen = new Hashtable();
			}
			if(Rep_data!=null&&Rep_data.size()>0)
			{
				String skey="";
				Iterator itr = (new TreeMap(Rep_data)).keySet().iterator();
				Iterator itr1 =RangeServer.keySet().iterator();
				String getKey = (String)itr1.next();
				Hashtable ServerRanges = (Hashtable)RangeServer.get(getKey);
				Vector Servers =(Vector)ServerRanges.get(Strrange);
				Vector  CompTypes = new Vector();
				if(Servers!=null&&Servers.size()>0)
				{
						for(int f=0;f<Servers.size();f++)
						{
							String StrServer =(String)Servers.get(f);
							String Ctype = StrServer.substring(StrServer.lastIndexOf(":")+1,StrServer.length());
							if(!CompTypes.contains(Ctype))
								CompTypes.add(Ctype);
						}
				}
				while (itr.hasNext())
				{
					skey = (String)itr.next();
					if(CompTypes.contains(skey))
					{
%>
	<div class="newTable">	
	<%				
	if (s_farmserver!=null)
							{
	%>
			<!--<td  width="100%" NOWRAP align="center" colspan="7" class="printTableHeader"><egui:intnl text="reporter.common.Zone report"/> - <%=s_farmserver%> :  <egui:intnl type="<%=skey%>"/></td>-->
			<div class="printOuterBoxHeader"><egui:intnl text="reporter.common.Zone report"/> - <%=s_farmserver%> :  <egui:intnl type="<%=skey%>"/></div>
	<%
								t="Zone report - "+s_farmserver+" : "+intlmap.getComponentTypeDescription(skey);
							}
	%>
	<table align="center" width="100%" cellspacing="0" cellpadding="0" border="0">
		
	<%
			
							String s_test = request.getParameter("er_test");
							String s_measure = request.getParameter("er_meas");
							String Comptype  = request.getParameter("er_comptype");
							if(disname.indexOf("*")>-1)
							{
								disname = disname.replace('*','%');
							}
							String reqvariable = "";
							String variable = "";
							String value = "";
							String test_mes="";
							String entry="";
							String sub="ZONE_REPORT";
							reqvariable =s_test+":"+s_measure;
							ArrayList variables=reportInfo.getVariables(sub);
							vec.add("Range");
							vec.add("Server");
							for(int v=0; v<variables.size();v++)
							{
								variable=(String)variables.get(v);
								if(variable.indexOf("Default")>-1 || variable.indexOf("Citrix_MF_XP")>-1 
									|| variable.indexOf("Citrix_server")>-1 || variable.indexOf(Comptype)>-1
									|| Comptype.equalsIgnoreCase("ALL") || Comptype.equals("-1")
									|| variable.indexOf("Terminal_server")>-1 )
								{
									if(variable.indexOf(reqvariable)>-1)
									{
										value = reportInfo.getValue(sub,variable);
									}
								}
							}
							if (value.equals(""))
							{
								value="Avg";
							}
							Vector Report_data = (Vector)Rep_data.get(skey);
	%>
		<thead>
		<tr>
	<%
							if(cpRange!=null && dataFor!=null && dataFor.equals("distribution"))
							{
	%>
			<th style="text-align:center"  width="30%"><b><egui:intnl text="reporter.common.Range"/></b></th>
	<%
							}
	%>
			<th style="text-align:center" width="30%"><b><egui:intnl text="reporter.common.Server"/></b></th>
	<%
							StringTokenizer stvals = new StringTokenizer(value,",");
							int counttokens = stvals.countTokens();
	%>
			<th style="text-align:center" colspan="<%=counttokens %>" width="30%" wrap ><b><egui:intnl text='<%="reporter.common."+disname%>'/></b></th>

			<th width="30%" style="text-align=center"><b><egui:intnl text="reporter.common.Health"/></b> %</th>
		</tr>
		<tr>
			<th class="subHeader"></th>
	<%
							if(cpRange!=null && dataFor!=null && dataFor.equals("distribution"))
							{
	%>
			<th class="subHeader"></th>
	<%
							}
							StringTokenizer st_val = new StringTokenizer(value,",");
							while (st_val.hasMoreTokens())
							{
								String tempst=st_val.nextToken();
								vec.add(disname+"("+tempst+")");
	%>
			<th class="subHeader"><b><%=tempst %></b></th>
	<%
							}
							vec.add("Health");
	%>
			<th class="subHeader"></th>
		</tr>
		</thead>
		<tbody>
	<%
							for (int k=0; k<Report_data.size();k++)
							{
								Vector data=(Vector)Report_data.get(k);
	%>
		<tr>
	<%
								String srvr="";
								String strdata="";
								Float temp=null;
								String showRange = "";
								for(int i=0;i<data.size();i++)
								{
									if (i==0)
									{
										srvr=(String)data.get(i);
										if(cpRange!=null && dataFor!=null && dataFor.equals("distribution"))
										{
											boolean srvFound = false;
											Enumeration c_keys = cpRange.keys();
											showRange = "";
											while(c_keys.hasMoreElements())
											{
												String s_range = (String)c_keys.nextElement();
												Vector v_servers = (Vector)cpRange.get(s_range);
												if(v_servers.contains(srvr))
												{
													showRange = s_range;
													srvFound = true;
												}
												if(Strrange!=null&&!Strrange.equals(showRange))
												{
													continue;
												}
												else
													break;
											}
											if(Strrange!=null&&Strrange.equals(showRange))
											{
	%>
			<td wrap  width="10%" align="center"><%=showRange%></td>
	<%
												lst_dat.add(showRange);
											}
										}
										if(Strrange!=null&&Strrange.equals(showRange))
										{
											String srv="";
											String srvr1=srvr;
											String servername = srvr1.substring(0,srvr1.lastIndexOf(":"));
											String servtype = intlmap.getComponentTypeDescription(srvr1.substring(srvr1.lastIndexOf(":")+1,srvr1.length()));
											if(servername.endsWith(":NULL"))
												servername = servername.substring(0,servername.indexOf(":"));
											if(srvr.indexOf(".")>-1)
											{
												srv = servername;
											}
											else
											{
												srv = servername;
											}
	%>
			<td wrap  width="10%" align="center"><%=srv%></a></td>
	<%
											lst_dat.add(srv);
										}
									}
									else if (i==data.size()-1 && !data.get(i).equals("-"))
									{
										if(Strrange!=null&&Strrange.equals(showRange))
										{
											temp = (Float)data.get(i);
											if (temp.floatValue()==-5.0)
											{
	%>
			<td nowrap align="center"> - </td>
	<%
												lst_dat.add("-");
											}
											else
											{
	%>
			<td nowrap align="center"><%=temp.toString()%></a></td>
	<%
												lst_dat.add(temp.toString());
											}
	%>
		</tr>
	<%
										}
									}else
									{
										if(Strrange!=null&&Strrange.equals(showRange))
										{
											temp=(Float)data.get(i);
											if (temp.floatValue()==-5.0)
												strdata="-";
											else
												strdata = temp.toString();
	%>
			<td  id="tdborder" class="blackcontent" align="center"><%=strdata%></td>
	<%
											lst_dat.add(strdata);
										}
									}
								}//for
	%>
		</tr> <!--  tr closed by jaiwin  -->
	<%
							}//for
	%>									 
		</tbody>
	</table> <!-- table closed by jaiwin  -->
	</div>
</div>
<%
					}
					sen.put(vec,lst_dat);
					ht.put(t,sen);
					lst.add(ht);
					lst_dat=new LinkedList();
					//lst_dat=new LinkedList();
					sen=new Hashtable();
					ht=new Hashtable();
					vec=new Vector();
					s_test_mes="  ";
					t=" ";
				}
			}
			else //No Data Available For Zone Report
			{
%>
<table align="center" width="100%" cellspacing="0" cellpadding="0"  border="0">
	<tr>
		<td NOWRAP align="center" width="100%"> <egui:intnl text="reporter.common.No measures available for the current selection"/></td>
	</tr>
</table>
<%
			}
		}
		else if(forReport!=null && forReport.equals("CtxApplication")) //Thin Client Application Report Summary
		{
			String s_farmserver = request.getParameter("select_farm");
			if(appData!=null&&appData.size()>0 || appUserData!=null && appUserData.size() >0)
			{
				String skey="";
%>
			<br/>
<div class="clearDiv">&nbsp;</div>
<div class="printOuterBox">
<div class="newTable">
<table align="center" width="100%" cellspacing="0" cellpadding="0"  border="0">
	<!--<tr>-->
<%
				if (s_farmserver!=null)
				{
%>
		<!--<td width="100%" NOWRAP align="center" colspan="7" class="printTableHeader"> <egui:intnl text="reporter.common.Application report"/>&nbsp; <%=headerKeyName%> &nbsp;</td>-->
			<div class="printOuterBoxHeader"> <egui:intnl text="reporter.common.Application report"/>&nbsp; <%=headerKeyName%></div>
<%
						lst.add(intlmap.getTextDescription("reporter.common.Application report")+"   "+headerKeyName);
				}
				//code added to find the values
				String s_test = request.getParameter("er_test");
				String s_measure = request.getParameter("er_meas");
				if(disname.indexOf("*")>-1)
				{
					disname = disname.replace('*','%');
				}
				String reqvariable = "";
				String variable = "";
				String value = "";
				String test_mes="";
				String entry="";
				boolean isUser = false;
				if(disname!=null && !disname.equals("Number of unique users"))
				{
					reqvariable =s_test+":"+s_measure;
					String sub="APPLICATION_REPORT";
					ArrayList variables = reportInfo.getVariables(sub);
					for(int v=0; v < variables.size(); v++)
					{
						variable = (String)variables.get(v);
						if(variable.indexOf(reqvariable)>-1)
						{
							value = reportInfo.getValue(sub,variable);
						}
					}
					if (value.equals(""))
					{
						value = "Avg";
					}
				}
				else
				{
					value ="Number";
					isUser = true;
				}
%>
	<!--</tr>-->
	<thead>
	<tr>
<%
				if(cpRange!=null && dataFor!=null && dataFor.equals("distribution"))
				{
					vec.add("Range");
%>
		<th style="text-align:center" rowspan= "2" width="15%" class="printTableHeader2"><egui:intnl text="reporter.common.Range"/></th>
<%
				}
%>
		<th style="text-align:center" rowspan= "2" width="15%" class="printTableHeader2"><egui:intnl text="reporter.common.Application"/></th>
<%
				vec.add("Application");
				StringTokenizer stvals = new StringTokenizer(value,",");
				int counttokens = stvals.countTokens();
%>
		<th colspan="<%=counttokens %>" width="15%" class="printTableHeader2" wrap style="text-align:center"><egui:intnl text='<%="reporter.common."+disname%>'/></th>
	</tr>
	<tr>
<%
				if(cpRange!=null && dataFor!=null && dataFor.equals("distribution"))
				{
%>
<%
				}
				StringTokenizer st_val=new StringTokenizer(value,",");
				while (st_val.hasMoreTokens())
				{
					String tempst = st_val.nextToken();
					vec.add(disname+"("+tempst+")");
%>
		<th align="center" class="subHeader"><egui:intnl text='<%="reporter.common."+tempst %>'/></th>
<%
				}
%>
	</tr>  
	</thead>
<%
				int size = 0;
				if(isUser)
					size = appUserData.size();
				else
					size = appData.size();
				for (int k=0; k<size;k++)
				{
					Vector data = null;
					if(isUser)
					{
						data = (Vector)appUserData.get(k);
					}
					else
					{
						data=(Vector)appData.get(k);
					}
					String srvr="";
					String strdata="";
					Float temp=null;
					String showRange = "";
					for(int i=0;i<data.size();i++)
					{
						if (i==0)
						{
							srvr = (String)data.get(i);
							boolean srvFound = true;
							if(cpRange!=null && dataFor!=null && dataFor.equals("distribution"))
							{
								Enumeration c_keys = cpRange.keys();
								while(c_keys.hasMoreElements())
								{
									String s_range = (String)c_keys.nextElement();
									Vector v_servers = (Vector)cpRange.get(s_range);
									if( v_servers.contains(srvr))
									{
										showRange = s_range;
										srvFound = true;
									}
									else
										srvFound = false;
									if(Strrange!=null&&!Strrange.equals(showRange))
									{
										continue;
									}
									else
										break;
								}
								if(srvFound)
								{
									if(Strrange!=null&&Strrange.equals(showRange))
									{
%>
	<tr>
		<td wrap width="10%" align="left"><%=showRange%></td>
<%
										lst_dat.add(showRange);
									}
								}
							}
							int cnt = 0;
							for(int d=1; d < data.size(); d++)
							{
								Float f = (Float)(data.get(d));
								if(f.floatValue() == -5)
								{
									cnt++;
								}
							}
							if(cnt == data.size()-1)
							{
								srvFound = false;
							}
							if(srvFound)
							{
								if(Strrange!=null && Strrange.equals(showRange))
								{
									String srv="";
									if(srvr.indexOf(".")>-1)
									{
										srv = srvr.substring(0,srvr.indexOf("."));
									}
									else
									{
										srv = srvr;
									}
									String cmpTypeAppName = srv;
									if(srv.indexOf(":") > -1)
									{
										cmpTypeAppName = intlmap.getComponentTypeDescription( srv.substring(0,srv.indexOf(":")) ) + srv.substring(srv.lastIndexOf(":"));
									}
									if(cmpTypeAppName.startsWith("+"))
										cmpTypeAppName=cmpTypeAppName.substring(1);
%>
		<td wrap width="10%" align="left"><%=cmpTypeAppName%></td>
<%
									lst_dat.add(cmpTypeAppName);
								}
							}
						}
						else if (i==data.size()-1 && !data.get(i).equals("-"))
						{
							temp=(Float)data.get(i);
							if (temp.floatValue()!=-5.0)
							{
								if(Strrange!=null&&Strrange.equals(showRange))
								{
									 String strDoubleValue=utils.round(temp,2);
%>
		<!-- <td nowrap align="center"><%=temp.toString()%></td> -->
		<td nowrap align="center"><%=strDoubleValue%></td>
<%
									lst_dat.add(temp.toString());
								}
							}
						}else
						{
							if(Strrange!=null && Strrange.equals(showRange))
							{
								temp=(Float)data.get(i);
								if (temp.floatValue()==-5.0)
								{
									strdata="-";
								}
								else
								{
									//strdata=temp.toString();
									strdata = utils.round(temp,2);

%>
		<td align="center"><%=strdata%></td>
<%
									lst_dat.add(strdata);
								}
							}
						}
					}//for
%>
	</tr>
<%
				}//for
%>
</table> <!--  table closed by jaiwin  -->
</div>
</div>
<%
			}
			else //Application Report - No Data Avaliable 
			{
%>
<table align="center" width="100%" cellspacing="0" cellpadding="0" border="0">
	<tr>
		<td NOWRAP align="center" width="100%"><egui:intnl text="reporter.common.No measures available for the current selection"/></td>
	</tr>
</table>
<%
			}
		}
		else if(forReport!=null && forReport.equals("Session")) //ThinClient Session Report
		{
			String from = request.getParameter("comeFrom");
			String displayServer="";
			if(server==null)
				displayServer = request.getParameter("select_farm");
			else
				displayServer = server;
			boolean serverEnable = false;
			if(from!=null) //DayWise User Details
			{
%>
<%
				if(server==null)
				{
					displayServer = request.getParameter("select_farm");
%>
	<div class="printOuterBoxHeader"><egui:intnl text="reporter.common.Day wise User details for Zone"/> &nbsp;&nbsp;<egui:intnl text='<%="reporter.common."+  displayServer%>'/></div>
<%
					s_test_mes="Day wise User details for Zone "+displayServer;
				}
				else
				{
					displayServer = request.getParameter("select_farm");
					String strDispComponentName = server;
					String strServerTemp="";
					if(server!=null && server.indexOf(":NULL")>-1)
					{
						strDispComponentName = server.substring(0,server.indexOf("NULL"));
					}
					else if(server!=null && server.indexOf(":")>-1)
					{
						strDispComponentName = server.substring(0,server.lastIndexOf(":"));
					}
					if(server!=null && server.indexOf(":")>-1)
					{
						strServerTemp = server.substring(server.lastIndexOf(":")+1);
					}
					
%>
	<div class="printOuterBoxHeader"><egui:intnl text="reporter.common.Day wise User details for Zone"/> &nbsp;<%=displayServer%> and Server <%=strDispComponentName+intlmap.getComponentTypeDescription(strServerTemp)%></div>
<%
					s_test_mes = "Day wise User details for Zone "+displayServer+" and Server "+strDispComponentName+intlmap.getComponentTypeDescription(strServerTemp);
				}
%>
<div class="newTable">
<table align="center" width="100%" cellspacing="0" cellpadding="0" border="0">

	<thead>
	<tr>
		<th nowrap align="center"><b><egui:intnl text="reporter.common.Date"/></b></th>
		<th nowrap align="center"><b><egui:intnl text="reporter.thin.User"/></b></th>
<%
				if(server==null)
				{
					serverEnable=true;
%>
		<th nowrap align="center"><b><egui:intnl text="reporter.common.Server"/></b></th>
<%
				}
%>
	</tr>
	</thead>
	<tr>
<%
				lst_dat = new LinkedList();
				String tempUser="";
				vec = new Vector();
				vec.add("Date");
				vec.add("User");
				if(serverEnable)
					vec.add("Server");
				Iterator itr = userInfo.keySet().iterator();
				while(itr.hasNext())
				{
					String date = (String)itr.next();
					String dispstartdate="";
					if(date != null)
					{
						if(DateUtil.isDate(date.trim(),"dd/MM/yyyy"))
						{
							dispstartdate = DateUtil.changeDateFormat(date.trim(),"dd/MM/yyyy",currentDateFormat);
						}
						else if(DateUtil.isDate(date.trim(),"dd/MM/yyyy HH:mm"))
						{
							dispstartdate = DateUtil.changeDateFormat(date.trim(),"dd/MM/yyyy HH:mm",currentDateFormat+" HH:mm");
						}
						else
						{
							dispstartdate = date.trim();
						}
					}
					Hashtable temp_data = (Hashtable)userInfo.get(date);
					TreeMap u_data = new TreeMap(temp_data);
					out.println("<td nowrap align=\"center\" rowspan=\""+(u_data.size())+"\">"+dispstartdate+"</td>");

					Iterator itr1 = u_data.keySet().iterator();
					while(itr1.hasNext())
					{
						String user = (String)itr1.next();
						Vector v_server = (Vector)u_data.get(user);
						int m=0;
						if(v_server!=null)
							m = v_server.size();
					out.println("<td nowrap align=\"left\" >"+user+"</td>");
						if(serverEnable)
						{
							if(v_server!=null && !v_server.isEmpty())
							{
%>
					<td nowrap align="left" style="padding:0px">
						 <table align="center" width="100%" cellspacing="0" cellpadding="0"  border="0" style="border: 0px;"> 
<%
								for (int d=0;d<v_server.size();d++)
								{
									String strDispServerName = (String)v_server.get(d);
									if(strDispServerName!=null && strDispServerName.indexOf(":NULL")>-1)
									{
										strDispServerName = strDispServerName.substring(0,strDispServerName.indexOf(":NULL"));
									}
									if(d==v_server.size()-1)
									{

								//out.println("<td id=\"blackcontent\" nowrap align=\"left\">"+strDispServerName+"</td></tr>");
								out.println("<td style='border-bottom: 0px !important;'>"+strDispServerName+"</td>");
									}
									else
								//out.println("<td class=\"bottom_border\"  id=\"blackcontent\" nowrap align=\"left\">"+v_server.get(d)+"</td></tr>");
									out.println("<td style='border-bottom: 0px !important;'>"+v_server.get(d)+"</td>");
									lst_dat.add(dispstartdate.replace(',',' '));
									lst_dat.add(user);
									lst_dat.add(strDispServerName);
								}
%>
						</table>
					</td>
<%							}
						}
						else
						{
							lst_dat.add(dispstartdate.replace(',',' '));
							lst_dat.add(user);
						}
						/*String duration=(String)u_data.get(v+2);
							lst_dat.add(duration);
							out.println("<td id=\"cellbgapplet\" class=\"blackcontent\" nowrap align=\"center\">"+duration+"</td>");*/
	out.println("</tr>");
					}
				}
%>
</tr>
</table>
</div>
<%
			}
			else
			{
				String StrSessions = (String)v_data1.get(0);
				String StrAvgDuration = (String)v_data1.get(1);
				String StrMaxDuration = (String)v_data1.get(2);
				if(ht_data!=null && !ht_data.isEmpty() && v_data1!=null && !v_data1.isEmpty())
				{
					String s_farmserver= request.getParameter("select_farm");
%>
<div class="clearDiv">&nbsp;</div>
 <div class="printOuterBox">
 <div class="newTable">
<table align="center" width="50%" cellspacing="0" cellpadding="0" border="0">
<%
					if(StrSessions!=null && !StrSessions.equals("") || StrAvgDuration!=null && !StrAvgDuration.equals("-") || StrMaxDuration!=null && !StrMaxDuration.equals("-"))
					{
%>
	<!-- <thead>
	<tr>
		<!-- <td width="50%" NOWRAP align="left" colspan="13"><egui:intnl text="reporter.common.SUMMARY FOR SESSION"/>- <%=er_option%></td>	 
		<th colspan="13"><egui:intnl text="reporter.common.SUMMARY FOR SESSION"/>- <%=er_option%></th>
	</tr>
	</thead>   -->
	<thead>
	<tr>
	<th class="printTableHeader2" nowrap colspan="2" align ="center"><egui:intnl text="reporter.common.SUMMARY FOR SESSION"/>-<%=er_option%></th>
	</tr>
	</thead>
<%
						lst.add(intlmap.getTextDescription("reporter.common.Summary for Session")+" - "+er_option);
					}
					if(StrSessions!=null&&!StrSessions.equals(""))
					{
%>
	<tr>
		<td width="50%" class="printTableHeader1" > <egui:intnl text="reporter.common.Sessions completed"/>(<egui:intnl text="reporter.common.Number"/>)</td>
<%
						vec.add("Sessions completed(Number)");
%>
		<td class="printTableHeader1" nowrap align="right">
<%
						String data1=(String)v_data1.get(0);
						if(data1!=null&&data1.equals(""))
							data1="-";
						out.println(data1);
						lst_dat.add(data1);
%>
		</td>
	</tr> 
<%
						sen.put(vec,lst_dat);
						ht.put(" ",sen);
						lst.add(ht);
						vec=new Vector();
						lst_dat=new LinkedList();
						ht=new Hashtable();
						sen=new Hashtable();
					}
					if(StrAvgDuration!=null&&!StrAvgDuration.equals("-"))
					{
%>
	<tr>
		<td width="50%"><egui:intnl text="reporter.common.Average duration"/> (<egui:intnl text="reporter.common.Mins"/>)</td>
<%
										vec.add("Average duration (Mins)");
%>
		<td nowrap align="right">
<%
						String avgdu=(String)v_data1.get(1);
						if(avgdu!=null&&avgdu.equals(""))
						avgdu="-";
						out.println(avgdu);
						lst_dat.add(avgdu);
%>
		</td>
	</tr>  
<%
						sen.put(vec,lst_dat);
						ht.put(" ",sen);
						lst.add(ht);
						vec = new Vector();
						lst_dat = new LinkedList();
						ht = new Hashtable();
						sen = new Hashtable();
					}
					if(StrMaxDuration!=null && !StrMaxDuration.equals("-"))
					{
%>
	<tr>
		<td width="50%"><egui:intnl text="reporter.common.Maximum duration"/> (<egui:intnl text="reporter.common.Mins"/>)</td>
<%
						vec.add("Maximum duration (Mins)");
%>
		<td nowrap align="right"><%
						String maxdu = (String)v_data1.get(2);
						if(maxdu != null && maxdu.equals(""))
							maxdu="-";
						out.println(maxdu);
						lst_dat.add(maxdu);
%>
		</td>
	</tr>	
<%
						sen.put(vec,lst_dat);
						ht.put(" ",sen);
						lst.add(ht);
						vec = new Vector();
						lst_dat = new LinkedList();
						ht = new Hashtable();
						sen = new Hashtable();
					}
%>
</table>
</div>

	<!--<tr>
		<td colspan="4" width="100%" NOWRAP align="center">-->
		<!--	<table width="85%" cellspacing="0" cellpadding="0" border="0">
				<tr>-->
<%
					//code added to find the values
					String s_test = request.getParameter("er_test");
					String s_measure = request.getParameter("er_meas");
					if(disname.indexOf("*")>-1)
					{
						disname = disname.replace('*','%');
					}
					String reqvariable = "";
					String variable = "";
					String value = "";
					reqvariable = s_test+":"+s_measure;
					String test_mes="";
					String entry="";
					String sub="CITRIX SESSION REPORT";
					ArrayList variables = reportInfo.getVariables(sub);
					for(int v=0; v<variables.size(); v++)
					{
						variable=(String)variables.get(v);
						if(variable.indexOf(reqvariable)>-1)
						{
							value=reportInfo.getValue(sub,variable);
						}
					}
					if (value!=null && value.equals(""))
					{
						value="Avg";
					}
					StringTokenizer stvals = new StringTokenizer(value,",");
					int counttokens = stvals.countTokens();
					if (s_farmserver!=null)
					{
						if(!s_test_mes.equalsIgnoreCase("No Of Sessions Completed"))
						lst.add(s_test_mes);
						s_test_mes="Session Details -  "+headerKeyName;
%>
					<!--<td width="100%" NOWRAP align="center" colspan="13" ><egui:intnl text="reporter.common.Session Details"/> <%=headerKeyName%><B></td>-->
					
<%
					}
%>
			<!--	</tr>
			</table>-->
		<!--</td>
	</tr>-->
	<div class="clearDiv">&nbsp;</div>
	<div class="printOuterBoxHeader"><egui:intnl text="reporter.common.Session Details"/>  <%=headerKeyName%></div>
<div class="newTable">
<table align="center" width="100%" cellspacing="0" cellpadding="0" class="printTable" border="0">
	<thead>
	<tr>
<%
					if(cpRange!=null && dataFor!=null && dataFor.equals("distribution"))
					{
						vec.add("Range");
%>
		<th style="text-align:center"  width="30%" ><egui:intnl text="reporter.common.Range"/></th>
<%
					}
%>
		<th style="text-align:center"  width="30%"><egui:intnl text="reporter.common.Server"/></th>
<%
					vec.add("Server");
					if(disname!=null && disname.equals("No Of Sessions Completed"))
					{
						vec.add(disname);
%>
		<th style="text-align:center"><egui:intnl text='<%="reporter.common."+disname%>'/></th>
	</tr>
<%
					}
					else
					{
%>
		<th style="text-align:center" colspan="<%=counttokens%>"><%=disname%></th>
	</tr>
	<tr>
		<th class="subHeader"></th>
<%
						if(cpRange!=null && dataFor!=null && dataFor.equals("distribution"))
						{
%>
		<th class="subHeader"></th>
<%
						}
						StringTokenizer st_val=new StringTokenizer(value,",");
						while (st_val.hasMoreTokens())
						{
							String tempst=st_val.nextToken();
							vec.add(disname+"("+tempst+")");
%>
		<th class="subHeader"><%=tempst%></th>
<%
						}
					}
%>
	</tr>
	</thead>
<%
					
					//for user session analysis -pie chart drilldown grid sort basd on ist column
					ht_data=sortFirstColumnOnTheGrid(ht_data);

					ArrayList Report_data = new ArrayList();
					String skey1="";
					String showRange = "";
					Iterator itr1 = ht_data.keySet().iterator();
					while(itr1.hasNext())
					{
						skey1= (String)itr1.next();
						Report_data= (ArrayList)ht_data.get(skey1);
%>	
	<tbody>
	<tr>
<%
						if(cpRange!=null && dataFor!=null && dataFor.equals("distribution"))
						{
							boolean srvFound = false;
							Enumeration c_keys = cpRange.keys();
							while(c_keys.hasMoreElements())
							{
								showRange ="";
								String s_range = (String)c_keys.nextElement();
								Vector v_servers = (Vector)cpRange.get(s_range);
								if(v_servers.contains(skey1))
								{
									showRange = s_range;
									srvFound = true;
								}
								if(Strrange!=null&&!Strrange.equals(showRange))
								{
									continue;
								}
								else
									break;
							}
							if(Strrange!=null&&Strrange.equals(showRange))
							{
%>
		<td wrap  width="10%" align="center"><%=showRange%></td>
<%
								lst_dat.add(showRange);
							}
						}
						if(Strrange!=null&&Strrange.equals(showRange))
						{
							lst_dat.add(skey1);
							if(skey1.indexOf("NULL")>-1)
								skey1=skey1.substring(0,skey1.indexOf("NULL")-1);
%>
		<td nowrap align="center"><%=skey1%></td>
<%
						}
						for(int i=0;i<Report_data.size();i++)
						{
							if(Strrange!=null&&Strrange.equals(showRange))
							{
%>
		<td nowrap align="center"  ><%=(String)Report_data.get(i)%></td>
<%
								lst_dat.add((String)Report_data.get(i));
							}
						}
					}
%>
	</tr>
	</tbody>
</table>
</div>
 </div> 
<%
				}
				else
				{
%>
<table align="center" width="100%" cellspacing="0" cellpadding="0" border="0">
	<tr>
		<td NOWRAP align="center" width="100%"> <egui:intnl text="reporter.common.No measures available for the current selection"/></td>
	</tr>
</table>
<%
				}
			}
		}
		else if(forReport!=null && forReport.equals("CtxUserActivity"))
		{

			String s_farmserver = request.getParameter("select_farm");
			if(appData!=null&&appData.size()>0 || appUserData!=null && appUserData.size() >0)
			{
				String skey="";
%>
<div class="clearDiv">&nbsp;</div>
<div class="printOuterBox">

<%
				if (s_farmserver!=null && !s_farmserver.equals("-1"))
				{
%>
		<!--<td class="printTableHeader" width="100%" NOWRAP align="center" colspan="7" > <egui:intnl text="reporter.common.Application report"/>&nbsp;-&nbsp; <%=s_farmserver%> &nbsp;</td>-->
		<div class="printOuterBoxHeader"> <egui:intnl text="reporter.common.Application report"/>&nbsp;-&nbsp; <%=s_farmserver%> </div>
<%
						lst.add(intlmap.getTextDescription("reporter.common.Application report")+" -  "+s_farmserver);
				}
				//swami
				else
				{
%>		<div class="printOuterBoxHeader"> <egui:intnl text="reporter.common.Application report"/></div>
<%
				lst.add(intlmap.getTextDescription("reporter.common.Application report"));
				}
				//swami
				//code added to find the values
				String s_test = request.getParameter("er_test");
				String s_measure = request.getParameter("er_meas");
				if(disname.indexOf("*")>-1)
				{
					disname = disname.replace('*','%');
				}
				String reqvariable = "";
				String variable = "";
				String value = "";
				String test_mes="";
				String entry="";
				boolean isUser = false;
				if(disname!=null && !disname.equals("Number of unique users"))
				{
					reqvariable =s_test+":"+s_measure;
					String sub="CITRIX_USER_ACTIVITY_REPORT";
					ArrayList variables = reportInfo.getVariables(sub);
					for(int v=0; v < variables.size(); v++)
					{
						variable = (String)variables.get(v);
						if(variable.indexOf(reqvariable)>-1)
						{
							value = reportInfo.getValue(sub,variable);
						}
					}
					if (value.equals(""))
					{
						value = "Avg";
					}
				}
				else
				{
					value ="Number";
					isUser = true;
				}
%>
<div class="newTable">
	<table align="center" width="100%" cellspacing="0" cellpadding="0" class="printTable">
		<thead>
			<tr>
<%
				if(cpRange!=null && dataFor!=null && dataFor.equals("distribution"))
				{
					vec.add("Range");
%>
		<th align="center" rowspan="2" width="30%" ><egui:intnl text="reporter.common.Range"/></th>
<%
				}
%>
		<th align="center" rowspan="2" width="30%"><egui:intnl text="reporter.common.User"/></th>
<%
				vec.add("Application");
				StringTokenizer stvals = new StringTokenizer(value,",");
				int counttokens = stvals.countTokens();
				s_mes_unit = tablesInfo.getUnitForMeasure(s_test,s_measure);
%>
		<th colspan="<%=counttokens %>" width="40%" style="text-align:center;" ><egui:intnl text='<%="reporter.common."+disname%>'/> (<%=s_mes_unit%>)</th>
	</tr>
	
	<tr>
<%
				if(cpRange!=null && dataFor!=null && dataFor.equals("distribution"))
				{
%>
<%
				}
				StringTokenizer st_val=new StringTokenizer(value,",");
				while (st_val.hasMoreTokens())
				{
					String tempst = st_val.nextToken();
					vec.add(disname+"("+tempst+")");
%>
		<th align="center" class="subHeader"><egui:intnl text='<%="reporter.common."+tempst %>'/></th>
<%
				}
%>
	</tr>
	</thead>
	<tbody>
<%
				int size = 0;
				if(isUser)
					size = appUserData.size();
				else
					size = appData.size();
				for (int k=0; k<size;k++)
				{
					Vector data = null;
					if(isUser)
					{
						data = (Vector)appUserData.get(k);
					}
					else
					{
						data=(Vector)appData.get(k);
					}
					String srvr="";
					String strdata="";
					Float temp=null;
					String showRange = "";
					for(int i=0;i<data.size();i++)
					{
						if (i==0)
						{
							srvr = (String)data.get(i);
							boolean srvFound = true;
							if(cpRange!=null && dataFor!=null && dataFor.equals("distribution"))
							{
								Enumeration c_keys = cpRange.keys();
								while(c_keys.hasMoreElements())
								{
									String s_range = (String)c_keys.nextElement();
									Vector v_servers = (Vector)cpRange.get(s_range);
									if( v_servers.contains(srvr))
									{
										showRange = s_range;
										srvFound = true;
									}
									else
										srvFound = false;
									if(Strrange!=null&&!Strrange.equals(showRange))
									{
										continue;
									}
									else
										break;
								}
								if(srvFound)
								{
									if(Strrange!=null&&Strrange.equals(showRange))
									{
%>
	<tr>
		<td wrap  width="10%" align="left"><%=showRange%></td>
<%
										lst_dat.add(showRange);
									}
								}
							}
							int cnt = 0;
							for(int d=1; d < data.size(); d++)
							{
								Float f = (Float)(data.get(d));
								if(f.floatValue() == -5)
								{
									cnt++;
								}
							}
							if(cnt == data.size()-1)
							{
								srvFound = false;
							}
							if(srvFound)
							{
								if(Strrange!=null && Strrange.equals(showRange))
								{
									String srv="";
									if(srvr.indexOf(".")>-1)
									{
										srv = srvr.substring(0,srvr.indexOf("."));
									}
									else
									{
										srv = srvr;
									}
									srv = srvr;
									String cmpTypeAppName = srv;
									if(srv.indexOf(":") > -1)
									{
										cmpTypeAppName = intlmap.getComponentTypeDescription( srv.substring(0,srv.indexOf(":")) ) + srv.substring(srv.lastIndexOf(":"));
									}
%>
		<td wrap width="10%" align="left"><%=cmpTypeAppName%></td>
<%
									lst_dat.add(cmpTypeAppName);
								}
							}
						}
						else if (i==data.size()-1 && !data.get(i).equals("-"))
						{
							temp=(Float)data.get(i);
							if (temp.floatValue()!=-5.0)
							{
								if(Strrange!=null&&Strrange.equals(showRange))
								{
%>
		<td nowrap align="center"><%=temp.toString()%></td>
<%
									lst_dat.add(temp.toString());
								}
							}
						}else
						{
							if(Strrange!=null && Strrange.equals(showRange))
							{
								temp=(Float)data.get(i);
								if (temp.floatValue()==-5.0)
								{
									strdata="-";
								}
								else
								{
									strdata=temp.toString();
%>
		<td align="right"><%=strdata%></td>
<%
									lst_dat.add(strdata);
								}
							}
						}
					}//for
%>
	</tr>
<%
				}//for
%>

</tbody></table> </div><!--  table closed by jaiwin  -->
</div>
<%
			}
			else //Application Report - No Data Avaliable 
			{
%>
<table align="center" width="100%" cellspacing="0" cellpadding="0" border="0">
	<tr>
		<td NOWRAP align="center" width="100%" height="100%" valign="middle"><egui:intnl text="reporter.common.No measures available for the current selection"/></td>
	</tr>
</table>
<%
			}
		}//dass
		else
		{
%>
<table align="center" width="100%" cellspacing="0" cellpadding="0" border="0" height="100%">
	<tr>
		<td  NOWRAP align="center" width="100%" height="100%" valign="middle"><img src="/final/images/Light/nomeasures_custom.png"/></td>
	</tr>
</table>
<%
		}
	}
	sen = new Hashtable();
	if(lst_dat!=null && !lst_dat.isEmpty())
	{
		sen.put(vec,lst_dat);
		ht = new Hashtable();
		ht.put(s_test_mes,sen);
		lst.add(ht);
		session.setAttribute("list",lst);
	}
	else
		session.setAttribute("list",lst);
		
}
catch(Throwable t)
{
		t.printStackTrace();
}
%>

<%!   

public Map sortFirstColumnOnTheGrid(Map htdata){  

Hashtable tempTable=new Hashtable();
Map ht_data_final=null;
try
	{
	if(htdata!=null)
	{
		ht_data_final=new LinkedHashMap();
		Iterator itr1=htdata.keySet().iterator();
		while(itr1.hasNext())
			{
		String skey1= (String)itr1.next();
		ArrayList Report_data= (ArrayList)htdata.get(skey1);
			if(Report_data!=null)
			{
				String ky=(String)Report_data.get(0);//sortFirstColumn
				if(ky!=null)
				{
					ky=ky.trim();
					if(!ky.equals("-") && !ky.equals("-5") && !ky.equals("-1"))
					{
						if(ky.length()>0)
						{
						 Double x = new Double(ky);
				tempTable.put(skey1,x);
						}
					}
				}
			}
			}		

		 ArrayList as = new ArrayList( tempTable.entrySet() );
         
          Collections.sort( as , new Comparator() {
            public int compare( Object o1 , Object o2 )
            {
                Map.Entry e1 = (Map.Entry)o1 ;
                Map.Entry e2 = (Map.Entry)o2 ;
                Double first = (Double)e1.getValue();
                Double second = (Double)e2.getValue();
			   return second.compareTo( first );
            }
			});

				Iterator i = as.iterator();
        while ( i.hasNext() )
        {
			 Map.Entry r1 = (Map.Entry)i.next() ;
			 String key=(String)r1.getKey();
			 ArrayList ls=(ArrayList)htdata.get(key);
			 ht_data_final.put(key,ls);

        }
		}
	}
	catch(Exception e)
	{
		ht_data_final=htdata;
		e.printStackTrace();
	}
	return ht_data_final;  
}  

%>

		<!-- DON'T EVER TOUCH ANY PART OF HTML CODE BWLOW THIS COMMENT -->
</body>
</html>