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

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

	String queryString = ErUtils.prepareQueryString(request.getParameterMap());
	String qString=getEncodedQueryString(queryString);
	String mngrIP= new IniFile(new EgConfigInfo("manager").getDbFile()).getValue("DB_PROPERTIES","ManagerUrl");
	UBean = new ErUserData(urs,false);
	session.setAttribute("UBean",UBean);
	ErReqData erd = new ErReqData(request);
	EgDateInfo egDt =new EgDateInfo();
	ErUtils erUtils = new ErUtils();
	ErReportHelper erh=new ErReportHelper();
    	String adGroupFns=request.getParameter("adGroupFns");
    	String clientIp=request.getParameter("clientIp");
	EgUserRole userRole      = thisuser.getUserRole();
	boolean hasAllComponentAccess= userRole.hasAllComponentAccess();
	//added by chandrasekhar
	List userCompList=new LinkedList();
	if(!hasAllComponentAccess)
	{
		userCompList = getComponentsForUserNotAccessAllComponents(thisuser);
	}
	//ended here
	String s_tit= "";
	String s_tit1= "";
	List lst = new LinkedList();
	List lst_dat = new LinkedList();
	Hashtable sen = new Hashtable();
	Hashtable ht = new Hashtable();
	Vector vec = new Vector();
	Hashtable ht1 = new Hashtable();
	List lst_dat1 = new LinkedList();
	Hashtable sen1 = new Hashtable();
	Vector vec2 = new Vector();
	Vector vec1 = new Vector();
	Vector vec3 = new Vector();
	List lst_dat2 = new LinkedList();
	Vector v_val1 = new Vector();
	EgMappingInfo intlmp=new EgMappingInfo(thisuser.getLanguage());
	ErComponentsUtils compUtil = new ErComponentsUtils(thisuser.getLoginID());
	List siteNames = new LinkedList();
	siteNames.addAll(compUtil.getUserSites());
	siteNames.addAll(compUtil.getUserServices(true));
	EgMappingInfo intlmap = new EgMappingInfo(thisuser.getLanguage());
	String reportType=request.getParameter("er_reportType");
	EgTablesInfo tablesInfo = new EgTablesInfo("manager");
	EgSpecsInfo specsInfo = new EgSpecsInfo("manager");
	EgTesterInfo testInfo = new EgTesterInfo("manager");
	EgTestInfo tokInfo = new EgTestInfo("manager");
	EgDbInfo dbInfo = new EgDbInfo("manager");
	EgReportInfo reportInfo=new EgReportInfo("manager");
	EgDiscInfoHelper  discInfoHelper=new EgDiscInfoHelper();
	String colSeparator = testInfo.getDDSeparator1();
	String rowSeparator = testInfo.getDDSeparator2();
	String server = "";
	String user = "";
	String Farmserver = "";
	String view_name = "";
	com.egurkha.ini.IniUI ui = (com.egurkha.ini.IniUI)com.egurkha.ini.IniUI.getInstance();
	String installDir = EgInstallInfo.getInstallDir();
	Hashtable Hasservice=new Hashtable();
	Vector v_repdata = (Vector)session.getAttribute("Rep_data");
	Hashtable ht_Data = (Hashtable)session.getAttribute("TopNReportData");
	if(ht_Data == null)
	{
		ht_Data = (Hashtable)request.getAttribute("TopNReportData");
	}
	Hashtable Rep_data1 = (Hashtable) session.getAttribute("Farm_data");
	if(Rep_data1 == null || Rep_data1.equals(""))
	{
		Rep_data1 = (Hashtable)request.getAttribute("Form_Data");
	}
	Hashtable avg_data = (Hashtable) session.getAttribute("SummaryData");
	Hashtable Application_data = (Hashtable)session.getAttribute("htdat");
	Hashtable Session_data = (Hashtable)session.getAttribute("sessionData");
	if(avg_data == null)
	{
		avg_data = (Hashtable)request.getAttribute("SummaryData");
	}
	if(Session_data == null)
	{
		Session_data = (Hashtable)request.getAttribute("Report_data_ForSession");
	}
	if(Application_data == null)
	{
		Application_data = (Hashtable)request.getAttribute("htdat");
	}
	ArrayList apptop= (ArrayList)session.getAttribute("appForPrint");

	if(apptop== null && "true".equals(request.getParameter("throughSchedule")))
	{
		apptop =  (ArrayList)request.getAttribute("appForPrint");
	}
	ArrayList alistallMeasuresDisp=(ArrayList)request.getAttribute("alistallMeasuresDisp1");
	String st_apptopdata=  (String)session.getAttribute("titleapp");
	Hashtable htableMinMaxAvgPer =(Hashtable)request.getAttribute("htableMinMaxAvgPer1");
	Hashtable htableTargetHost =(Hashtable)request.getAttribute("htableTargetHost1");
	Hashtable htableSummaryAvgDisp=(Hashtable)request.getAttribute("htableSummaryAvgDisp1");

	String s_comptype = request.getParameter("avg");
	String s_compType=request.getParameter("er_compType");
	String titforsession = (String)session.getAttribute("title");
	Vector Session_data1 = (Vector)session.getAttribute("sessionData1");
	if(Session_data1 == null)
	{
		Session_data1 = (Vector)request.getAttribute("Report_data1");
	}
	ArrayList arrses_data = (ArrayList)session.getAttribute("sessionDatatop");
	if(arrses_data == null)
	{
		 arrses_data = (ArrayList)request.getAttribute("Report_data2");
	}
	ArrayList dataHash = (ArrayList) session.getAttribute("Event_data");//from ErCtxEventReporter for total alert
	if(dataHash == null)
	{
		dataHash = (ArrayList)request.getAttribute("RESULTPROC");
	}
	Vector a_list=(Vector)session.getAttribute("NO_ALERTS");//from ErCtxEventReporter.jsp for all alerts
	if(a_list ==null)
	{
		a_list=(Vector)request.getAttribute("ALERTS");
	}
     
    	int groupRowCnt=0;
	String adGroupForPrint = request.getParameter("adGroupForPrint");

	String groupBy=" Summary Report";

	if(adGroupFns!=null && adGroupFns.equalsIgnoreCase("Details"))
	{ groupBy=" Details Report";
	}
	if(adGroupForPrint!=null && adGroupForPrint.length()>0)
	{
		groupBy+=" for "+adGroupForPrint;
	}
	if(adGroupForPrint!=null &&  adGroupForPrint.equals("-1"))
		groupBy="";


	//ArrayList Hash_repdata = (ArrayList) request.getAttribute("hash_data");
	Hashtable Ht_repdata = (Hashtable) session.getAttribute("hash_summary_data");
	ArrayList topAppsDataForFarm = (ArrayList)session.getAttribute("userTopAppsFarm");
	ArrayList topAppsDataForServer = (ArrayList)session.getAttribute("userTopAppsServ");
	ArrayList  perServerDispMaxAvgPer = (ArrayList)session.getAttribute("userMaxAvgPer");
	//ArrayList perServerDispMaxAvgPer = (ArrayList)request.getAttribute("userMaxAvgPer");
	ArrayList disconuser=(ArrayList)request.getAttribute("disconuserdeal");
	Hashtable  aList_Rep_data =(Hashtable) session.getAttribute("OverAllUserSummary_data");

	if(Ht_repdata == null)
	{
		Ht_repdata = (Hashtable) request.getAttribute("Summary_Report_data");
	}
	
	if(aList_Rep_data == null)
	{
		aList_Rep_data =(Hashtable) request.getAttribute("Summary_Report_OverAllUserSummary_data");
	}

	if(perServerDispMaxAvgPer == null)
	{
		   perServerDispMaxAvgPer = (ArrayList) request.getAttribute("perServerDispMaxAvgPer");
		// perServerDispMaxAvgPer = (ArrayList)session.getAttribute("perServerDispMaxAvgPer");
	}
	if(topAppsDataForFarm == null)
	{
		topAppsDataForFarm = (ArrayList) request.getAttribute("topAppsDataForFarm");
	}
	if(topAppsDataForServer == null)
	{
		topAppsDataForServer = (ArrayList) request.getAttribute("topAppsDataForServer");
	}
	if(disconuser == null)
	{
		disconuser=(ArrayList)request.getAttribute("disconnectuser");
	}
	Vector userReSum = (Vector)session.getAttribute("userReSummary");
	if(userReSum == null)
	{
		userReSum = (Vector)request.getAttribute("userReSummary");
		//userReSum = (Vector)request.getAttribute("userReSummaryControlProcess");
	}
	ArrayList Repserver_data = null;//(ArrayList)session.getAttribute("Repserver_data");
	if(Repserver_data == null)
	{
		Repserver_data = (ArrayList)request.getAttribute("Repserver_data");
	}
	
	String showFrom=request.getParameter("showFrom");
	if(showFrom==null || showFrom.length()==0)
	{
		showFrom = "Outside view";
	}
	String INI_SUBJECT = "CITRIX_USER_REPORT";
	if(showFrom.equalsIgnoreCase("Inside view"))
	{
		INI_SUBJECT = "CITRIX_USER_REPORT_INSIDE";
	}
	String geoColumn = reportInfo.getValue(INI_SUBJECT,"GeoColumnDetails_"+s_compType);
	ArrayList geoColumnList = com.egurkha.util.StringUtils.egTokenizer(geoColumn, ",",false,false,true);
	String client_details = null;
	ArrayList aListClientDetails =  new ArrayList();
	String strCompTypeDetailsVal =null;
	
	HashMap powerMap=(HashMap)session.getAttribute("powerinfoMap");
	HashMap esxDataMapType=(HashMap)session.getAttribute("guestMap");
	HashMap osinfoMapType=(HashMap)session.getAttribute("osinfoMap");

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

	String timefrom = request.getParameter("timefrom");
	String timeto = request.getParameter("timeto");
	String minfrom = request.getParameter("minfrom");
	String minto = request.getParameter("minto");
	String r_type = request.getParameter("er_rtype");
	
	Hashtable h_data = new Hashtable();
	Vector time = new Vector();
	Vector print_data = new Vector();
	ArrayList arr_session = new ArrayList();
	Hashtable avgAcrosServerFinal=new Hashtable();
	h_data = (Hashtable)session.getAttribute("Report_data");
	time = (Vector)session.getAttribute("time");

	String ctype = request.getParameter("er_comptype");
	String rtype = request.getParameter("er_gtype");
	String ercontype =request.getParameter("ercontype");
	String subtype = request.getParameter("er_trgttype");
	String Strexcwe = request.getParameter("er_excwe");
	String erservice = request.getParameter("erservice");
	String typeisend= request.getParameter("typeisend");
	String chec= request.getParameter("er_check");

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

	String dispStartDate = null;
	String dispEndDate = null;
	String start_date=erd.s_stdate;
	String end_date=erd.s_enddate;
	if(start_date!=null && end_date!=null)
	{
		if(erd.s_startmin !=null && !erd.s_startmin.equalsIgnoreCase("null"))
		{
			dispStartDate=start_date.trim()+" "+erd.s_sthr+":"+erd.s_startmin;
		}
		else
		{
			dispStartDate=start_date.trim()+" "+erd.s_sthr+":"+"00";
		}

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

	for(int kk=0;kk<aListSupportedComponentType.size();kk++)
	{
		aListAlltype.add("All "+aListSupportedComponentType.get(kk));
	}
	boolean isVm = false;
	if(	aListVmComponentType !=null)
	{
		if(aListVmComponentType.contains(s_compType))
			isVm = true;
	}
	String er_RmDispName = request.getParameter("er_RmDispName");
	if(s_compType!=null)
	{
		client_details = reportInfo.getValue(INI_SUBJECT,"ClientDetails");
		if(isVm)
			client_details = reportInfo.getValue(INI_SUBJECT,"VdiClientDetails");
		if(client_details!=null && client_details.length()>0)
		{
			StringTokenizer stToken = new StringTokenizer(client_details,",");
			while (stToken.hasMoreTokens())
			{
				String strVal = stToken.nextToken();
				if(strVal!=null && strVal.startsWith(s_compType))
				{
					strCompTypeDetailsVal = strVal;
					break;
				}
			}
		}
	}
	if(strCompTypeDetailsVal!=null && strCompTypeDetailsVal.length()>0)
	{
		StringTokenizer stToken_1 = new StringTokenizer(strCompTypeDetailsVal,":");
		stToken_1.nextToken();//Component Type Token
		if(isVm)
			stToken_1.nextToken();//TestName Token
		while (stToken_1.hasMoreTokens())
		{
			String strVal = stToken_1.nextToken();
			String strColName = strVal;
			if(strVal!=null && strVal.indexOf("#")>-1)
			{
				strVal = strVal.substring(strVal.indexOf("#")+1);
				strColName = strColName.substring(0,strColName.indexOf("#"));
			}
			aListClientDetails.add(strVal);
		}
	}

%>

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

<title>&nbsp; <egui:intnl text="reporter.common.Reporter" />
&nbsp; &nbsp;-PDR- &nbsp;</title>
<%
	}
	else
	{
%>
	<title>eG Reporter</title>
<%
	}
%>
<style>
body{font-size:100%}
.borderradius{
border-radius: 5px 5px 5px 5px;
-moz-border-radius: 5px 5px 5px 5px;
-khtml-border-radius: 5px 5px 5px 5px;
-o-border-radius: 5px 5px 5px 5px;
-webkit-border-radius: 5px 5px 5px 5px;
border-color:#d2d2d2;
border-style:solid;
border-width:1px;
margin-bottom:5px;

}


#tdborder{ padding-left:5px}
</style>
<style type="text/css" media="print">
#header {
background: #000 !important;
}

#printbt{ display:none}
</style>
<meta name="Author" content="eG">
<meta  charset="UTF-8">
<link rel="stylesheet" type="text/css" href="/final/reporter/styles/printpagestyle.css" />
<link rel="stylesheet" type="text/css" href="/final/styles/eGLightThemeIcons.css" />
<!-- <link rel=stylesheet href="../reporter/styles/er_reporter.css"> -->
<script language="JavaScript1.2"
	src="../reporter/scripts/er_imagesLite.js"></script>
<script language="javascript" src="../reporter/scripts/jsrsClient.js"></script>
<script language="javascript" src="../reporter/scripts/select.js"></script>
<script language="JavaScript1.2" src="../scripts/<%=script_src%>"></script>
<script language="javascript">
	var remoteURL = "/final/servlet/com.eg.ErRemoteScriptingServlet";
	var noItemText = "Not Applicable";
	var focusItem = null;
</script>

</head>


<body  marginwidth="20" marginheight="20" bgcolor="#FFFFFF" onLoad="javascript:void(0);" onUnLoad="javascript:void(0)">
	<form name="ErCompare" method="post" onSubmit="return false;" style="margin:0px; padding:0px">

		<div class="printHeaderBoxLogo"><img src="<%=imageName%>" border="0"></div>
		<div class="printHeaderBox">
		
		<!-- SET REPORT TITLE HERE -->
<%
	String subrtype=request.getParameter("subrtype");
	throughSchedule=request.getParameter("throughSchedule");
	if(throughSchedule!=null && throughSchedule.equalsIgnoreCase("true"))
	{
		subrtype=request.getParameter("er_subrtype");
	}
	else
		subrtype = subrtype;
	if (!StringUtils.isNull(er_RmDispName))
	{
		if(adGroupFns!=null && adGroupFns.equalsIgnoreCase("Details"))
		{
			lst.add(intlmp.getTextDescription("reporter.thin."+er_RmDispName)+" - "+intlmp.getTextDescription("reporter.common.AD GROUP DETAILS REPORT"));
%>
			<div class="printHeaderBoxTitle"><span class="<%=fontStyleDblSingl%>"><%=intlmp.getTextDescription("reporter.thin."+er_RmDispName)%> - <egui:intnl text="reporter.common.AD GROUP DETAILS REPORT" /> &nbsp;&nbsp;&nbsp; </span></div>
<%
		}
		else
		{
			lst.add(intlmp.getTextDescription("reporter.thin."+er_RmDispName)+" - "+intlmp.getTextDescription("reporter.common.AD GROUP SUMMARY REPORT"));
%>
			<div class="printHeaderBoxTitle"><span class="<%=fontStyleDblSingl%>"><%=intlmp.getTextDescription("reporter.thin."+er_RmDispName)%> - <egui:intnl text="reporter.common.AD GROUP SUMMARY REPORT" /> &nbsp;&nbsp;&nbsp; </span></div>
<%		}
	}
	else 
	{
		if(adGroupFns!=null && adGroupFns.equalsIgnoreCase("Details"))
		{
			lst.add(intlmp.getTextDescription("reporter.thin.THIN CLIENT REPORTS")+" - "+intlmp.getTextDescription("reporter.common.AD GROUP DETAILS REPORT"));
%>
			<div class="printHeaderBoxTitle"><span class="<%=fontStyleDblSingl%>"><egui:intnl text="reporter.consolidated.Thin Client Reports" /> - <egui:intnl text="reporter.common.AD GROUP DETAILS REPORT" /> &nbsp;&nbsp;&nbsp; </span></div>
<%
		}
		else
		{
			lst.add(intlmp.getTextDescription("reporter.thin.THIN CLIENT REPORTS")+" - "+intlmp.getTextDescription("reporter.common.AD GROUP SUMMARY REPORT"));
%>
			<div class="printHeaderBoxTitle"><span class="<%=fontStyleDblSingl%>"><egui:intnl text="reporter.consolidated.Thin Client Reports" /> - <egui:intnl text="reporter.common.AD GROUP SUMMARY REPORT" /> &nbsp;&nbsp;&nbsp; </span></div>
<%      }
	}
	if(pdfPrint !=null && pdfPrint.equalsIgnoreCase("yes"))
	{
%> 
			<div class="printHeaderBoxPrintIcon" ><img class="iconPrinter mouse" src="data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" border="0" onclick="javascript:print()" alt="PRINT" title="PRINT"></div>

<%
	}
%> 
		</div> 
		<div class="printOuterBoxNoBorder">
<%
		String Days = reportInfo.getExcludeWeekend(INI_SUBJECT);
		boolean showAllUsers = true;
		boolean showDuration = false;
		boolean showMeasure = false;
		boolean onlyThisUser = false;
		boolean showTop = false;
		ArrayList subjects=null;
		int sess =0;
		String avg = "";
		String maximum  ="";
		String s_duration="";
		String s_totaltime="";
		String s_pcttotaltime="";
		String msmttime="";
		String LoginTime;
		String s_farmserver = request.getParameter("select_farm");
		String discontest="";
		String logon_duration="";
		String idleTime="";
		String activeTime="";
		IniFile inifile=null;
		inifile = new IniFile(EgInstallInfo.getInstallDir()+"/manager/config/eg_format.ini");

		if(s_compType!=null && s_compType.equals("Terminal_server"))
			discontest=inifile.getValue("FORMAT","TermDisconnectsTest:New_disconnects");
		else if(s_compType!=null && s_compType.equals("Citrix_server"))
			discontest=inifile.getValue("FORMAT","CtxDisconnectsTest:New_disconnects");
		boolean likeAllUsers = false;
		Hashtable avgPerForMeasures = new Hashtable();
		Hashtable fromReport = new Hashtable();
		if(userReSum!=null && userReSum.size() > 0)
		{
			showAllUsers = ((Boolean)userReSum.get(0)).booleanValue();
			showDuration = ((Boolean)userReSum.get(1)).booleanValue();
			showMeasure = ((Boolean)userReSum.get(2)).booleanValue();
			sess = ((Integer)userReSum.get(3)).intValue();
			onlyThisUser = ((Boolean)userReSum.get(4)).booleanValue();
			likeAllUsers = ((Boolean)userReSum.get(5)).booleanValue();
			if(showDuration)
			{
				avg = (String)userReSum.get(6);
				maximum = (String)userReSum.get(7);
			}
			if(showAllUsers || likeAllUsers || onlyThisUser)
			showTop = true;
		}
		user = request.getParameter("er_user");
		if(user == null || user.equals(""))
			user = request.getParameter("er_tuser");
%>
			<div class="printSelectionFields ">
				<span class="<%=fontStyleDblSingl%> bold"><egui:intnl text="reporter.common.Thin Client " /> <%=" "+intlmap.getTextDescription("reporter.thin.AD Group ")+groupBy%></span>&nbsp;
			</div>
<%
		if(showAllUsers)
		{
			lst.add(intlmp.getTextDescription("reporter.common.Thin Client")+" "+intlmap.getTextDescription("reporter.thin.AD Group ")+groupBy);
					
		}
		else
		{
			lst.add(intlmp.getTextDescription("reporter.common.Thin Client")+" "+intlmap.getTextDescription("reporter.thin.AD Group ")+groupBy);
		}
		lst.add('"'+intlmp.getTextDescription("reporter.common.Time period")+":"+intlmp.getTextDescription("reporter.common.From")+" "+timefrom+":"+minfrom+intlmp.getTextDescription("reporter.common.Hrs")+" "+intlmp.getTextDescription("reporter.common.To")+" "+timeto+":"+minto+intlmp.getTextDescription("reporter.common.Hrs")+'"');

		Vector dvec = new Vector();
		String stimefmt = "Start Date : "+dispStartDate+" "+intlmp.getTextDescription("reporter.common.hrs");
		String etimefmt = "End Date : "+dispEndDate+" "+intlmp.getTextDescription("reporter.common.hrs");;
		dvec.add('"'+stimefmt+'"');
		dvec.add('"'+etimefmt+'"');
		lst.add(dvec);
%>
			<div class="printSelectionFields"><egui:intnl text="reporter.common.Timeline" /> -
				<span class="bold"><%=dispStartDate%><egui:intnl text="reporter.common.hrs" /><egui:intnl text="reporter.common.to" />&nbsp; &nbsp;<%=dispEndDate%>&nbsp;<egui:intnl text="reporter.common.hrs" /></span>
			</div>
			<div class="printSelectionFields"><egui:intnl text="reporter.common.Time Period" /> -
				<span class="bold"><%=timefrom+":"+minfrom%><egui:intnl text="reporter.common.hrs" />&nbsp;<egui:intnl text="reporter.common.To" />&nbsp;<%=timeto+":"+minto%></span>
			</div>
<%
		if(Strexcwe!=null&&Strexcwe.equalsIgnoreCase("Yes"))
		{
			lst.add(intlmp.getTextDescription("reporter.common.Exclude weekends")+":"+Days+'"');
%>
			<div class="printSelectionFields"><egui:intnl text="reporter.common.Exclude WeekEnds" /> -
				<span class="bold"><%=Days%></span>
			</div>
<%
		}
%>	
		</div>
		<div class="printOuterBox">
<%
		//if(topAppsDataForFarm ==null || topAppsDataForFarm.isEmpty() || topAppsDataForFarm.size()== 0)
		{
			if(Ht_repdata!=null && Ht_repdata.size()>0)
			{
				TreeMap Map_param = new TreeMap(Ht_repdata);
				Iterator itr1 = Map_param.keySet().iterator();
				Vector v_users = new Vector();
				/*for(int j=0; j < sess; j++)
				{
					try
					{
						Object v = (Object)Hash_repdata.get(j);
						if(v instanceof Hashtable)
						{
							avgPerForMeasures = (Hashtable)Hash_repdata.get(j);
							continue;
						}
						else if(v instanceof HashMap)
						{
							Report_data = (HashMap)Hash_repdata.get(j);
						}
					}
					catch(Exception e)
					{
						System.out.println("EXCEPTION IN USER :"+e);
					}
				}*/
%>
<%
				//if(showDuration || showAllUsers  || likeAllUsers)
				{
					String totalspan=(String)session.getAttribute("headingspan");
					int in = 0;
					if(totalspan != null)
					{
						if(s_compType!=null && aListVmComponentType.contains(s_compType))
						{
							in = Integer.parseInt(totalspan);
							in = in+1;
							totalspan = Integer.toString(in);
						}
					}
				/*	if(totalspan == null)
					{
						totalspan=(String)request.getAttribute("headingspan");
					//	totalspan=(String)request.getAttribute("totalspanControlProcess");
					}*/
					if(totalspan == null)
					{
						subjects=(ArrayList)reportInfo.getVariables(INI_SUBJECT);
						if(showAllUsers)
						totalspan=(getColspanCount(subjects,INI_SUBJECT,s_compType)+9)+"";
						else
						totalspan=(getColspanCount(subjects,INI_SUBJECT,s_compType)+7)+"";
						if(s_compType!=null && aListVmComponentType.contains(s_compType))
						{
							in = Integer.parseInt(totalspan);
							in = in + 1;
							totalspan = Integer.toString(in);
						}
					}
					if(totalspan != null)
					{
						totalspan = (Integer.parseInt(totalspan)+1)+"";
					}
					if(adGroupFns!=null && adGroupFns.equalsIgnoreCase("Details"))
					{
							in = Integer.parseInt(totalspan);
							in = in -2 ;
							if(!isVm)
								in = in -1 ;

							totalspan = Integer.toString(in);
					}
					else if(adGroupFns!=null && adGroupFns.equalsIgnoreCase("Summary"))
					{
							in = Integer.parseInt(totalspan);
							if(!isVm)
								in = in -1 ;
							totalspan = Integer.toString(in);
					}
					if(adGroupFns!=null && adGroupFns.equalsIgnoreCase("Details") && clientIp!=null && clientIp.equals("Yes"))
					{
						totalspan=totalspan+aListClientDetails.size();
					}
					// If problem will arise na we look it in totalspan
					if(!showAllUsers && !likeAllUsers)
					{
						s_tit = intlmp.getTextDescription("reporter.common.SESSION DETAILS");
%>
			<div class="printOuterBoxHeader"><egui:intnl text="reporter.thin.SESSION DETAILS" /></div>
<%
					}
					else
					{
						if(likeAllUsers)
						{
							s_tit = intlmp.getTextDescription("reporter.common.SESSION DETAILS");
%>
			<div class="printOuterBoxHeader"><egui:intnl text="reporter.common.SESSION DETAILS" /></div>
<%
						}
						else
						{
							s_tit = intlmp.getTextDescription("reporter.common.SESSION DETAILS");
%>
			<div class="printOuterBoxHeader"><egui:intnl text="reporter.common.SESSION DETAILS" /></div>
<%
						}
					}
%>
			<div class="newTable">
				<table align="center" width="100%" cellspacing="0" cellpadding="4" id="tableborder"  border="1" bordercolor="#d2d2d2" style="font-size:12px;border-collapse:collapse;border:#d2d2d2 1px solid">
					<thead>
						<tr>
					<%
						ArrayList a_measunit = new ArrayList(); // get measures unit name and no of column separator
						if(showAllUsers || likeAllUsers)
						{
							if(adGroupFns!=null && adGroupFns.equalsIgnoreCase("Details"))
								vec1.add(intlmp.getTextDescription("reporter.common.AD Group"));
							vec1.add(intlmp.getTextDescription("reporter.common.User"));
					%>
							<th id="er_submit" colspan="2" align="center" nowrap width="10%"><span class="<%=fontStyleDblSingl%>"><egui:intnl text="reporter.common.User" /> </span></th>
					<%
						}
						if(adGroupFns!=null && adGroupFns.equalsIgnoreCase("Details") && clientIp!=null && clientIp.equals("Yes"))
						{
							if(aListClientDetails !=null && aListClientDetails.size()>0 ){
								for(int m=0;m<aListClientDetails.size();m++)
								{
									String str1=(String)aListClientDetails.get(m);
									vec1.add(intlmp.getTextDescription("reporter.common."+str1));
					%>
							<th id="er_submit" align="center"> <div style="width: 80px; word-wrap: break-word; overflow-x:auto;"><%=str1%> </div></th>
				<%
							}
						}
					}
					vec1.add(intlmp.getTextDescription("reporter.common.Session Start Time(Local time on server)"));
					vec1.add(intlmp.getTextDescription("reporter.common.Logout/Disconnect Time(Time on Mgmt)"));
					vec1.add(intlmp.getTextDescription("reporter.common.Server"));
				%>

							<th id="er_submit" align="center"> <div style="width: 80px; word-wrap: break-word; overflow-x:auto;"><egui:intnl text="reporter.common. Session Start Time "/></div></th>
							<th id="er_submit" align="center"> <div style="width: 80px; word-wrap: break-word; overflow-x:auto;"><egui:intnl text="reporter.common.Logout / Disconnect Time"/></div></th>
							<th id="er_submit" align="center" nowrap width="10%"><span class="<%=fontStyleDblSingl%>"><egui:intnl text="reporter.common.Server" /> </span></th>
				<%
					if(adGroupFns!=null && adGroupFns.equalsIgnoreCase("Details") && clientIp!=null && clientIp.equals("Yes"))
					{
						if(geoColumnList !=null && geoColumnList.size()>0 ){
							for(int m=0;m<geoColumnList.size();m++)
							{
								String str1=(String)geoColumnList.get(m);
								vec1.add(intlmp.getTextDescription("reporter.common."+str1));
				%>
							<th id="er_submit" align="center"> <div style="width: 80px; word-wrap: break-word; overflow-x:auto;"><%=str1%> </div></th>
				<%
							}
						}
					}
					if(s_compType!=null && aListVmComponentType.contains(s_compType))
					{
						vec1.add(intlmp.getTextDescription("reporter.common.Desktop Name"));
				%>
							<th id="er_submit" align="center" wrap width="10%"><span class="<%=fontStyleDblSingl%>"><egui:intnl text="reporter.common.Desktop Name"/></span></th>
				<%
					}
					vec1.add(intlmp.getTextDescription("reporter.common.Logon Duration")+" ("+intlmp.getTextDescription("reporter.common.Sec")+")");
					if(adGroupFns==null || adGroupFns.equalsIgnoreCase("Summary"))
					{
						vec1.add(intlmp.getTextDescription("reporter.common.Total Connected Time (Mins)"));
						vec1.add(intlmp.getTextDescription("reporter.common.Total Elapsed Time (Mins)"));
						vec1.add(intlmp.getTextDescription("reporter.common.% Connected Time (%)"));
					}
					else
					{
						vec1.add(intlmp.getTextDescription("reporter.common.Duration of Access (Mins)"));
						vec1.add(intlmp.getTextDescription("reporter.common.Idle Time (Mins)"));
						vec1.add(intlmp.getTextDescription("reporter.common.Active Time (Mins)"));
					}
				%>
							<th id="er_submit" align="center" wrap width="20%"><egui:intnl text="reporter.common.Logon Duration"/></th>
				<% 
					if(adGroupFns==null || adGroupFns.equalsIgnoreCase("Summary"))
					{
				%>
							<th id="er_submit" align="center" wrap width="20%"><egui:intnl text="reporter.common.Total Connected Time"/></th>
							<th id="er_submit" align="center" wrap width="20%"><egui:intnl text="reporter.common.Total Elapsed Time"/></th>
							<th id="er_submit" align="center" wrap width="20%"><egui:intnl text="reporter.common.% Connected Time"/></th>
				<%
					}
					else
					{
					%>
							<th class="printTable" id="er_submit" align="center" wrap width="20%"><egui:intnl text="reporter.common.Duration of Access"/></th>
							<th class="printTable" id="er_submit" align="center" wrap width="20%"><egui:intnl text="reporter.common.Idle Time"/></th>
							<th class="printTable" id="er_submit" align="center" wrap width="20%"><egui:intnl text="reporter.common.Active Time"/></th>
<%
					}
					if(perServerDispMaxAvgPer!=null && perServerDispMaxAvgPer.size() > 0)
					{
						Hashtable pServerData = (Hashtable)perServerDispMaxAvgPer.get(0);
						if(pServerData!=null && pServerData.size() > 0)
						{
							Enumeration p_keys = pServerData.keys();
							while(p_keys.hasMoreElements())
							{
								String key = (String)p_keys.nextElement();
								Hashtable value = (Hashtable)pServerData.get(key);
					//			Enumeration n_keys = value.keys();
								Hashtable ht_colspan=(Hashtable)session.getAttribute("colspan");
								if(ht_colspan == null)
								{
									ht_colspan=(Hashtable)request.getAttribute("colspan");
								}
								//This code Added For PD4ML Schedule & BackGround
								if(ht_colspan == null || ht_colspan.isEmpty())
								{
									Hashtable colspanCode = new Hashtable();
									if(value!=null && value.size() > 0)
									{
										Iterator itr=value.keySet().iterator();
										while(itr.hasNext())
										{
											String userNam=(String)itr.next();
											try
											{
												Vector ns = (Vector)value.get(userNam);
												colspanCode.put(userNam,Integer.toString(ns.size()));
											}
											catch(ClassCastException e)
											{
												String data = (String)value.get(userNam);
												colspanCode.put(userNam,Integer.toString(data.length()));
											}
										}
									}
									ht_colspan = colspanCode;
								}
								//End Code
								/*	Hashtable ht_colspan=new Hashtable();
									ht_colspan.put("IO Writes","1");
									ht_colspan.put("Memory util","1");
									ht_colspan.put("Latency avg","1");
									ht_colspan.put("Cpu util","1");
									ht_colspan.put("IO Reads","1");*/
								//{IO Writes =1, Memory util =1, Latency avg =1, Cpu util =1, IO Reads =1}
								//int totalspan=4;
								/*String s_compTypeProc=request.getParameter("er_compType");
								for (int i=0;i<subjects.size();i++)
								{
									String vars=(String)subjects.get(i);
									
									if(s_compTypeProc!=null && !(vars.indexOf(s_compTypeProc)>-1))
										continue;
									StringTokenizer st_var=new StringTokenizer(vars,":");
									String disname="";
									String displayname="";
									while(st_var.hasMoreTokens())
									{
										st_var.nextToken();
										st_var.nextToken();
										String mes=st_var.nextToken();
										String mes1="";
										StringTokenizer st_mes=new StringTokenizer(mes,"#");
										
										if(st_mes.hasMoreTokens() )
											mes1=st_mes.nextToken();
										else
											mes1=mes;
										if(s_compTypeProc!=null && s_compTypeProc.equals("Terminal_server"))
												test="TermUserTest";
										else if(s_compTypeProc!=null && s_compTypeProc.equals("Vmware_vdi_server"))
											test="VmGuestTest";
										else if(s_compTypeProc!=null && s_compTypeProc.equals("VmVdi_i_server"))
											test="EsxGuestTest";
										else if(s_compTypeProc!=null && aListSupportComponentType.contains(s_compTypeProc))
										{
											test = reportInfo.getTestName(INI_SUBJECT,s_compTypeProc,false);
										}
										else
											test="CtxXpUserTest";

										disname=dbInfo.getColumnForMeasure(test,mes1);
										if(st_mes.hasMoreTokens() )
											displayname=st_mes.nextToken();
										else
											displayname=mes;
									}

									String vals=reportInfo.getValue(sub,vars);
									ArrayList al=new ArrayList();
									StringTokenizer map=new StringTokenizer(vals,",");
									//totalspan+=map.countTokens();
									ht_colspan.put(displayname,String.valueOf(map.countTokens()));
								/*	while(map.hasMoreTokens())
									{
										al.add(map.nextToken());
									}
									String strmap=(String)al.get(al.size()-1);
									strmap=strmap.substring(strmap.indexOf(" ")+1);
									Addmapping+=","+disname+"_"+al.get(0)+"#"+disname+"_"+strmap;*/
									
								//}
								subjects=(ArrayList)reportInfo.getVariables(INI_SUBJECT);
								for(int count_dis=0; count_dis<subjects.size(); count_dis++)
								{
									String var=(String)subjects.get(count_dis);
									if(var.indexOf(s_compType)<0)
										continue;

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

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

									String unitmeasure=tablesInfo.getUnitForMeasure(test,measure);
									String cspan=(String)ht_colspan.get(temp_disp);
									a_measunit.add(unitmeasure+"="+cspan);
				%>
							<th id="er_submit" align="center" wrap colspan="<%=cspan%>" width="10%"><span class="<%=fontStyleDblSingl%>"><egui:intnl text='<%="reporter.common."+temp_disp%>' /></span></th>
				<%
								}
								break;
							}
						}
					}
				%>
						</tr>
						<!-- separate measures from unit.add separate row start-->
						<tr>
				<%
					if(showAllUsers || likeAllUsers)
					{
				%>
							<th class="subHeader" id="er_submit" colspan="2" align="center" width="10%">&nbsp;</th>
				<%
					}
					if(adGroupFns!=null && adGroupFns.equalsIgnoreCase("Details") && clientIp!=null && clientIp.equals("Yes"))
					{
						if(aListClientDetails !=null && aListClientDetails.size()>0 ){
							for(int m=0;m<aListClientDetails.size();m++)
							{
				%>
							<th class="subHeader" id="er_submit" align="center" width="10%">&nbsp;</th>
				<%
							}
						}
					}
				%>
							<th class="subHeader" id="er_submit" align="center" width="10%">&nbsp;</th>
							<th class="subHeader" id="er_submit" align="center" width="10%">&nbsp;</th>
							<th class="subHeader" id="er_submit" align="center" width="10%">&nbsp;</th>

				<%
					if(adGroupFns!=null && adGroupFns.equalsIgnoreCase("Details") && clientIp!=null && clientIp.equals("Yes"))
					{
						if(geoColumnList !=null && geoColumnList.size()>0 ){
							for(int m=0;m<geoColumnList.size();m++)
							{
				%>
							<th class="subHeader" id="er_submit" align="center" width="10%">&nbsp;</th>
				<%
							}
						}
					}
					if(s_compType!=null && aListVmComponentType.contains(s_compType))
					{
				%>
							<th class="subHeader" id="er_submit" align="center" width="10%">&nbsp;</th>
				<%
					}
				%>

							<th class="subHeader" id="er_submit" align="center" width="10%"><span class="<%=fontStyleDblSingl%>">(<egui:intnl text="reporter.common.Sec" />)</span></th>

							<th class="subHeader" id="er_submit" align="center" width="10%"><span class="<%=fontStyleDblSingl%>">(<egui:intnl text="reporter.common.Mins" />)</span></th>
				<% 
					if(adGroupFns==null || adGroupFns.equalsIgnoreCase("Summary"))
					{
				%>
							<th class="subHeader" id="er_submit" align="center" width="10%"><span class="<%=fontStyleDblSingl%>">(<egui:intnl text="reporter.common.Mins" />)</span></th>
							<th class="subHeader" id="er_submit" align="center" width="10%"><span class="<%=fontStyleDblSingl%>">(<egui:intnl text="reporter.common.%" />)</span></th>
				<%
					}
					else{
						%>
							<th class="subHeader" id="er_submit" align="center" width="10%"><span class="<%=fontStyleDblSingl%>">(<egui:intnl text="reporter.common.Mins" />)</span></th>
							<th class="subHeader" id="er_submit" align="center" width="10%"><span class="<%=fontStyleDblSingl%>">(<egui:intnl text="reporter.common.Mins" />)</span></th>
				<%
					}
					for(int u=0; u < a_measunit.size(); u++)
					{
						String measureUnit=(String)a_measunit.get(u);
						StringTokenizer unitValue=new StringTokenizer(measureUnit,"=");
						int tokensCount=unitValue.countTokens();
						String measUnitDisp = unitValue.nextToken();
						String countDisp = unitValue.nextToken();
				%>
							<th colspan="<%=countDisp%>" class="subHeader" id="er_submit" nowrap align="center" width="10%">(<%=measUnitDisp%>)</th>
				<%
					}

				%>

						</tr>
		<!-- end -->
						<tr>
				<%
					if(perServerDispMaxAvgPer!=null && perServerDispMaxAvgPer.size() > 0)
					{
						if(showAllUsers || likeAllUsers)
						{
				%>
							<th class="subHeader" id="er_submit" colspan="2" align="center" nowrap width="10%"><b>&nbsp;</b></th>
				<%
						}
					}
					if(adGroupFns!=null && adGroupFns.equalsIgnoreCase("Details") && clientIp!=null && clientIp.equals("Yes"))
					{
						if(aListClientDetails !=null && aListClientDetails.size()>0 ){
							for(int m=0;m<aListClientDetails.size();m++)
							{
				%>
							<th class="subHeader" id="er_submit" align="center" nowrap width="10%"><b>&nbsp;</b></th>
				<%
							}
						}
					}
				%>
							<th class="subHeader" id="er_submit" align="center" nowrap width="10%"><b>&nbsp;</b></th>
							<th class="subHeader" id="er_submit" align="center" nowrap width="10%"><b>&nbsp;</b></th>
							<th class="subHeader" id="er_submit" align="center" wrap width="10%"><b>&nbsp;</b></th>
				<%
					if(adGroupFns!=null && adGroupFns.equalsIgnoreCase("Details") && clientIp!=null && clientIp.equals("Yes"))
					{
						if(geoColumnList !=null && geoColumnList.size()>0 ){
							for(int m=0;m<geoColumnList.size();m++)
							{
				%>
							<th class="subHeader" id="er_submit" align="center" nowrap width="10%"><b>&nbsp;</b></th>
				<%
							}
						}
					}
				%>
							<th class="subHeader" id="er_submit" align="center" wrap width="10%"><b>&nbsp;</b></th>
							<th class="subHeader" id="er_submit" align="center" wrap width="10%"><b>&nbsp;</b></th>

				<%
					if(adGroupFns==null || adGroupFns.equalsIgnoreCase("Summary"))
					{
				%>
							<th class="subHeader" id="er_submit" align="center" wrap width="10%"><b>&nbsp;</b></th>
							<th class="subHeader" id="er_submit" align="center" width="10%">&nbsp;</th>
				<%
					}
					else{
				%>
							<th class="subHeader" id="er_submit" align="center" wrap width="10%"><b>&nbsp;</b></th>
							<th class="subHeader" id="er_submit" align="center" width="10%">&nbsp;</th>
				<%
					}
					if(s_compType!=null && aListVmComponentType.contains(s_compType))
					{
				%>
							<th class="subHeader" id="er_submit"  align="center" wrap width="10%"><b>&nbsp;</b></th>
				<%
					}
					if(perServerDispMaxAvgPer!=null && perServerDispMaxAvgPer.size() > 0)
					{
						Hashtable pServerData = (Hashtable)perServerDispMaxAvgPer.get(0);
						if(pServerData!=null && pServerData.size() > 0)
						{
							Enumeration p_keys = pServerData.keys();
							while(p_keys.hasMoreElements())
							{
								String key = (String)p_keys.nextElement();
								Hashtable value = (Hashtable)pServerData.get(key);
								if(value!=null && value.size() > 0)
								{
									subjects=(ArrayList)reportInfo.getVariables(INI_SUBJECT);
									int count = 0;
									for(int count_dis=0; count_dis<subjects.size(); count_dis++)
									{
										String var=(String)subjects.get(count_dis);
										if(var.indexOf(s_compType)<0)
											continue;
										StringTokenizer temp_st=new StringTokenizer(var,"#");
										temp_st.nextToken();
										String temp_disp=temp_st.nextToken();
										Vector v_data = (Vector)value.get(temp_disp);
										if(v_data!=null && v_data.size() > 0)
										{
											for(int vd=0; vd < v_data.size(); vd++)
											{
												String val = (String)v_data.get(vd);
												StringTokenizer st_v = new StringTokenizer(val,"$");
												while(st_v.hasMoreTokens())
												{
													String measure = (String)st_v.nextToken();
													String computed = (String)st_v.nextToken();
													String computedVal = (String)st_v.nextToken();
													String measureUnit=(String)a_measunit.get(count);
													StringTokenizer unitValue=new StringTokenizer(measureUnit,"=");
													String measUnitDisp = unitValue.nextToken();
													vec1.add(intlmp.getTextDescription("reporter.thin."+temp_disp)+"("+measUnitDisp+")"+"-"+"("+computed+")");
				%>
							<th class="subHeader" id="er_submit" align="center" nowrap width="10%"><span class="<%=fontStyleDblSingl%>"><b><egui:intnl text='<%="reporter.common."+computed%>' /></b></span></th>
				<%
												}
											}
											count++;
										}
									}
								}
								break;
							}
						}
					}
				%>
						</tr>
					</thead>
					<tbody>
				<%
					int summarCount = 0;
					ArrayList aListTotalIO = new ArrayList();
					while(itr1.hasNext())
					{
						aListTotalIO = new ArrayList();
						String strAdgroup = (String)itr1.next();
				
						ArrayList Hash_repdata = new ArrayList();
						Hash_repdata = (ArrayList) Ht_repdata.get(strAdgroup);
						if(Hash_repdata == null || Hash_repdata.size()==0)
							continue;
				%>
						<tr>
				<%
						if(adGroupFns!=null && adGroupFns.equalsIgnoreCase("Details"))
						{
							if(Hash_repdata!=null)
								groupRowCnt=Hash_repdata.size();
						}
						else if(user!=null && ((user=="-- All --")||( user=="*")))
						{
							if(Hash_repdata!=null && Hash_repdata.size()>1)
								groupRowCnt=Hash_repdata.size()-1;
						}
						else
							groupRowCnt=Hash_repdata.size();
						String tmpStr=new String(strAdgroup);
						if(strAdgroup!=null && strAdgroup.equalsIgnoreCase("AD_NULL"))
						{
							tmpStr="Default";
						}
						else
							tmpStr=strAdgroup;
						if(tmpStr!=null && !tmpStr.equalsIgnoreCase("AD_NULL"))
						{
%>
							<th class="cellbgdark" align="center" colspan="<%=totalspan%>" ><%=tmpStr%> (<%=groupRowCnt%>)</th>
<%
							int intTotalspan = 0;
							try{
								intTotalspan = Integer.parseInt(totalspan);
							}catch(Exception e){}
							if(adGroupFns==null || adGroupFns.equalsIgnoreCase("Summary")){
								for(int dd=0;dd<intTotalspan-1;dd++)
								{
									int mod = (intTotalspan)/2;
									if(isVm)
									{
										if(dd>=(intTotalspan-2))
											break;
										mod = (intTotalspan-2)/2;
									}
									if( mod ==dd)
										lst_dat1.add('"'+tmpStr+" ("+groupRowCnt+")"+'"');
									else
										lst_dat1.add(" ");
								}
							}
						}
					%>
						</tr>
					<%
						float io_readWriteTotal=-5.0f;
						for(int j=0;j<Hash_repdata.size();j++)
						{
							io_readWriteTotal=-5.0f;
							Object v1 = (Object)Hash_repdata.get(j);
							if(v1 instanceof Hashtable)
								continue;
							Report_data = (HashMap)Hash_repdata.get(j);
							if(showAllUsers || likeAllUsers)
								user = (String)Report_data.get("user");
							server = (String)Report_data.get("trgt_host");
							LoginTime = (String)Report_data.get("login_time");
							s_totaltime = (String)Report_data.get("connectionTime");
							s_duration = (String)Report_data.get("duration");
							s_pcttotaltime = (String)Report_data.get("perConectionTime");
							logon_duration = (String)Report_data.get("logon_duration");
							idleTime = (String)Report_data.get("idleTime");
							activeTime = (String)Report_data.get("activeTime");
							String temp_server=server;
							if(server.endsWith(":NULL"))
							{
								temp_server = server.substring(0,server.indexOf(":"));
							}
							msmttime = (String)Report_data.get("msmttime");
							if(msmttime!=null && !msmttime.equals(""))
							{
								if(msmttime.indexOf(":000")>0)
									msmttime=msmttime.substring(0,msmttime.indexOf(":000"));
							}
							msmttime = DateUtil.changeDateFormat(msmttime,"dd-MM-yyyy HH:mm:ss",currentDateFormat+" HH:mm");
					%>
						<tr class="newimg">
					<%
							String logintimedisp=LoginTime.substring(0,LoginTime.indexOf(" "));
							//logintimedisp = DateUtil.changeDateFormat(logintimedisp.trim(),"MM/dd/yyyy",currentDateFormat);
							String toFormAsKey = "";
							if(showAllUsers || likeAllUsers)
							{
								if(adGroupFns!=null && adGroupFns.equalsIgnoreCase("Details"))
								lst_dat1.add('"'+tmpStr+'"');
								lst_dat1.add('"'+user+'"');
								toFormAsKey = user + "$";
					%>
							<td class="blackcontent" id="tdborder" colspan="2" align="left" > <div style="width: 80px; word-wrap: break-word; overflow-x:auto;"><%=user%></div></td>
					<%
						}
						if(adGroupFns!=null && adGroupFns.equalsIgnoreCase("Details") && clientIp!=null && clientIp.equals("Yes"))
						{
							if(aListClientDetails !=null && aListClientDetails.size()>0 ){
								for(int m=0;m<aListClientDetails.size();m++)
								{
									String str1=(String)aListClientDetails.get(m);
									String strVal1=(String)Report_data.get(str1);
									lst_dat1.add('"'+strVal1+'"');
					%>
							<td class="blackcontent" id="tdborder" align="left" > <div style="width: 80px; word-wrap: break-word; overflow-x:auto;"><%=strVal1%></div></td>
					<%
								}
							}
						}

						double d_duration = Math.round(Double.parseDouble(s_duration));
						String st_duration = String.valueOf(d_duration);
						if(st_duration!=null & st_duration.indexOf(".") > -1)
						{
							st_duration  = st_duration.substring(0,st_duration.indexOf("."));
						}
						double d_totalConnectiontime = Math.round(Double.parseDouble(s_totaltime));
						s_totaltime = String.valueOf(d_totalConnectiontime);
						double d_pctConnectiontime = Math.round(Double.parseDouble(s_pcttotaltime));
						s_pcttotaltime = String.valueOf(d_pctConnectiontime);
						toFormAsKey = toFormAsKey + LoginTime + "$" + server + "$" + st_duration;
						String deskNameData = (String)Report_data.get("guestname");;
						if(perServerDispMaxAvgPer!=null && perServerDispMaxAvgPer.size() > 0)
						{
							Hashtable pServerDataSample = (Hashtable)perServerDispMaxAvgPer.get(0);
							if(pServerDataSample!=null&&pServerDataSample.size() > 0)
							{
								Hashtable p_val = (Hashtable)pServerDataSample.get(toFormAsKey);
								String deskName = null;
								if(p_val!=null)
									deskName = (String)p_val.get("DeskTopName");
								if(deskName!=null && deskName.length()>0)
								{
									if(deskName!=null && deskName.indexOf(",")>-1)
									{
										deskNameData = "";
										StringTokenizer stTokenDesktop = new StringTokenizer(deskName,",");
										while(stTokenDesktop.hasMoreTokens())
										{
											String strTempDesktop=stTokenDesktop.nextToken();
											if(strTempDesktop.indexOf("_")>-1)
												deskNameData += strTempDesktop.substring(strTempDesktop.lastIndexOf("_")+1,strTempDesktop.length())+",";
										}
										if(deskNameData!=null && deskNameData.endsWith(","))
											deskNameData = deskNameData.substring(0,deskNameData.length()-1);
									}else{
										deskNameData = deskName;
										if(deskName.indexOf("_")>-1)
											deskNameData = deskName.substring(deskName.lastIndexOf("_")+1,deskName.length());
										else
											deskNameData="";
									}
								}
							}
						}
						lst_dat1.add("\""+LoginTime+"\"");
						lst_dat1.add("\""+msmttime+"\"");
						lst_dat1.add('"'+temp_server+'"');
					%>
							<td class="blackcontent" id="tdborder" align="left" width="20%" wrap><%=LoginTime%></td>
							<td class="blackcontent" id="tdborder"  align="left"> <div style="width: 100px; word-wrap: break-word; overflow-x:auto;"><%=msmttime%></div></td>
							<td class="blackcontent" id="tdborder" align="left"> <div style="width: 100px; word-wrap: break-word; overflow-x:auto;"><span class="<%=fontStyleDblSingl%>"><%=temp_server%></span></div></td>
					<%
						if(adGroupFns!=null && adGroupFns.equalsIgnoreCase("Details") && clientIp!=null && clientIp.equals("Yes"))
						{
							if(geoColumnList !=null && geoColumnList.size()>0 ){
								for(int m=0;m<geoColumnList.size();m++)
								{
									String str1=(String)geoColumnList.get(m);
									String strVal1=(String)Report_data.get(str1);
									lst_dat1.add('"'+strVal1+'"');
					%>
							<td class="blackcontent" id="tdborder" align="left"> <div style="width: 100px; word-wrap: break-word; overflow-x:auto;"><span class="<%=fontStyleDblSingl%>"><%=strVal1%></span></div></td>
					<%
								}
							}
						}
						if(s_compType!=null && aListVmComponentType.contains(s_compType))
						{
							if(deskNameData == null || deskNameData.equals(""))
							{
								deskNameData = "-";
								lst_dat1.add('"'+deskNameData+'"');
					%>
					<!--	<td class="blackcontent" id="tdborder"  width="20%"  align="center" nowrap><%=deskNameData%></td> -->
							<td class="blackcontent" id="tdborder" align="center"> <div style="width: 80px; word-wrap: break-word; overflow-x:auto;"><%=deskNameData%></div></td>
					<%
							}
							else
							{
								lst_dat1.add('"'+deskNameData+'"');
					%>
				<!--		<td class="blackcontent" id="tdborder"  width="20%"  align="left" nowrap><%=deskNameData%></td> -->
							<td class="blackcontent" id="tdborder" align="left"> <div style="width: 80px; word-wrap: break-word; overflow-x:auto;"><%=deskNameData%></div></td>
					<%
							}
						}
					%>
							<td class="blackcontent" id="tdborder" align="center"> <div style="width: 100px; word-wrap: break-word; overflow-x:auto;"><span class="<%=fontStyleDblSingl%>"><%=logon_duration%></span></div></td>

					<%
						lst_dat1.add(dbInfo.formatValue(logon_duration));
						lst_dat1.add(dbInfo.formatValue(s_duration));
						if(adGroupFns==null || adGroupFns.equalsIgnoreCase("Summary"))
						{
							lst_dat1.add(dbInfo.formatValue(s_totaltime));
							lst_dat1.add(dbInfo.formatValue(s_pcttotaltime));
						}
						else{
							lst_dat1.add(idleTime);
							lst_dat1.add(activeTime);
						}
					%>
							<td class="blackcontent" id="tdborder" width="20%" align="center" nowrap><%=dbInfo.formatValue(s_duration)%></td>
					<%
						if(adGroupFns==null || adGroupFns.equalsIgnoreCase("Summary"))
						{
					%>
							<td class="blackcontent" id="tdborder" width="20%" align="center" nowrap><%=dbInfo.formatValue(s_totaltime)%></td>
							<td class="blackcontent" id="tdborder" width="20%" align="center" nowrap><%=dbInfo.formatValue(s_pcttotaltime)%></td>
					<%
						}
						else{
					%>
							<td class="blackcontent" id="tdborder" width="20%" align="center" nowrap><%=idleTime%></td>
							<td class="blackcontent" id="tdborder" width="20%" align="center" nowrap><%=activeTime%></td>
					<%
						}
						if(perServerDispMaxAvgPer!=null && perServerDispMaxAvgPer.size() > 0)
						{
							Hashtable pServerData = (Hashtable)perServerDispMaxAvgPer.get(0);
							Hashtable ser_dur = (Hashtable)perServerDispMaxAvgPer.get(1);
							String appDisp = "";
							if(pServerData!=null && pServerData.size() > 0)
							{
								Hashtable p_valuedd = (Hashtable)pServerData.get(toFormAsKey);
								String sDatedd = "";
								String eDatedd = "";
								String sHrdd = "";
								String eHrdd = "";
								String sMindd = "";
								String eMindd = "";
								if(ser_dur!=null && ser_dur.size() > 0)
								{
									String valdd = (String)ser_dur.get(toFormAsKey);
									if(valdd == null)
										continue;
									StringTokenizer st_dd = new StringTokenizer(valdd,"$");
									String sTimedd = "";
									String eTimedd = "";
									while(st_dd.hasMoreTokens())
									{
										sTimedd = (String)st_dd.nextToken();
										eTimedd = (String)st_dd.nextToken();
									}
									StringTokenizer st_startdd = new StringTokenizer(sTimedd,"/ :");
									String datedd = "";
									String monthdd = "";
									String yeardd = "";
									String hourdd = "";
									String minsdd = "";
									String secsdd = "";
									while(st_startdd.hasMoreTokens())
									{
										datedd = (String)st_startdd.nextToken();
										monthdd = (String)st_startdd.nextToken();
										yeardd = (String)st_startdd.nextToken();
										hourdd = (String)st_startdd.nextToken();
										minsdd = (String)st_startdd.nextToken();
										secsdd = (String)st_startdd.nextToken();
									}
									sDatedd = monthdd + "/"  + datedd + "/" + yeardd;
									sHrdd = hourdd;
									if(sHrdd.startsWith("0"))
										sHrdd = sHrdd.substring(1);
									sMindd = minsdd;
									if(sMindd.startsWith("0"))
										sMindd = sMindd.substring(1);
									StringTokenizer st_enddd = new StringTokenizer(eTimedd,"/ :");
									while(st_enddd.hasMoreTokens())
									{
										datedd = (String)st_enddd.nextToken();
										monthdd = (String)st_enddd.nextToken();
										yeardd = (String)st_enddd.nextToken();
										hourdd = (String)st_enddd.nextToken();
										minsdd = (String)st_enddd.nextToken();
										secsdd = (String)st_enddd.nextToken();
									}
									eDatedd = monthdd + "/" + datedd + "/" + yeardd;
									eHrdd = hourdd;
									eMindd = minsdd;
									if(eHrdd.startsWith("0"))
										eHrdd = eHrdd.substring(1);
									if(eMindd.startsWith("0"))
										eMindd = eMindd.substring(1);
								}
							}
							if(pServerData!=null && pServerData.size() > 0)
							{
								Hashtable p_value = (Hashtable)pServerData.get(toFormAsKey);
								String sDate = "";
								String eDate = "";
								String sHr = "";
								String eHr = "";
								String sMin = "";
								String eMin = "";
								if(ser_dur!=null && ser_dur.size() > 0)
								{
									String val = (String)ser_dur.get(toFormAsKey);
									StringTokenizer st_d = new StringTokenizer(val,"$");
									String sTime = "";
									String eTime = "";
									while(st_d.hasMoreTokens())
									{
										sTime = (String)st_d.nextToken();
										eTime = (String)st_d.nextToken();
									}
									StringTokenizer st_start = new StringTokenizer(sTime,"/ :");
									String date = "";
									String month = "";
									String year = "";
									String hour = "";
									String mins = "";
									String secs = "";
									while(st_start.hasMoreTokens())
									{
										date = (String)st_start.nextToken();
										month = (String)st_start.nextToken();
										year = (String)st_start.nextToken();
										hour = (String)st_start.nextToken();
										mins = (String)st_start.nextToken();
										secs = (String)st_start.nextToken();
									}
									sDate = month + "/"  + date + "/" + year;
									sHr = hour;
									if(sHr.startsWith("0"))
										sHr = sHr.substring(1);
									sMin = mins;
									if(sMin.startsWith("0"))
										sMin = sMin.substring(1);
									StringTokenizer st_end = new StringTokenizer(eTime,"/ :");
									while(st_end.hasMoreTokens())
									{
										date = (String)st_end.nextToken();
										month = (String)st_end.nextToken();
										year = (String)st_end.nextToken();
										hour = (String)st_end.nextToken();
										mins = (String)st_end.nextToken();
										secs = (String)st_end.nextToken();
									}
									eDate = month + "/" + date + "/" + year;
									eHr = hour;
									eMin = mins;
									if(eHr.startsWith("0"))
										eHr = eHr.substring(1);
									if(eMin.startsWith("0"))
										eMin = eMin.substring(1);
								}
								if(p_value!=null && p_value.size() >0)
								{
									subjects=(ArrayList)reportInfo.getVariables(INI_SUBJECT);
									for(int count_dis=0; count_dis<subjects.size(); count_dis++)
									{
										String var=(String)subjects.get(count_dis);
										if(var.indexOf(s_compType)<0)
											continue;
										StringTokenizer temp_st=new StringTokenizer(var,"#");
										temp_st.nextToken();
										String temp_disp=temp_st.nextToken();
										String dbName = "";
										String dispName = "";
										Vector p_val = (Vector)p_value.get(temp_disp);//p_key);
										if(p_val!=null && p_val.size() >0)
										{
											for(int pv=0; pv < p_val.size(); pv++)
											{
												String value = (String)p_val.get(pv);
												StringTokenizer st_v = new StringTokenizer(value,"$");
												String computedVal = "-";
												while(st_v.hasMoreTokens())
												{
													String measure = (String)st_v.nextToken();
													StringTokenizer st_m = new StringTokenizer(measure,"#");
													dispName = (String)st_m.nextToken();
													dbName = (String)st_m.nextToken();
													String computed = (String)st_v.nextToken();
													computedVal = (String)st_v.nextToken();
												}
												if(computedVal!=null && computedVal.equals("-"))
												{
													lst_dat1.add(computedVal);
						%>
							<td class="blackcontent" id="tdborder" nowrap align="center" width="10%"><%=computedVal%></td>
						<%
												}
												else
												{
													try{
														if(value!=null && (value.indexOf("IO Reads")>-1 || value.indexOf("IO Writes")>-1))
														{
															if(io_readWriteTotal == -5.0f)
																io_readWriteTotal = Float.parseFloat(computedVal);
															else
																io_readWriteTotal += Float.parseFloat(computedVal);
														}
													}catch(Exception e){}
													lst_dat1.add(computedVal);
						%>
							<td class="blackcontent" id="tdborder" nowrap align="center" width="10%"><%=computedVal%></td>
						<%
												}
											}
										}
									}
								}
							}
						}
						
						/*if(io_readWriteTotal<0)
						{
							aListTotalIO.add(dbInfo.formatValue("-5.0"));
							lst_dat1.add("-");
%>
					<td class="blackcontent" id="tdborder"  nowrap align="center" width="10%">-</td>
<%
						}else
						{
							aListTotalIO.add(dbInfo.formatValue(io_readWriteTotal));
							lst_dat1.add(dbInfo.formatValue(io_readWriteTotal));
%>
							<td class="blackcontent" id="tdborder"  nowrap align="center" width="10%"><%=dbInfo.formatValue(io_readWriteTotal)%></td>
<%
						}*/

				%>
						</tr>
				<%
					}
				%>
						<tr>
				<%
				//if(adGroupFns==null || adGroupFns.equalsIgnoreCase("Summary"))
				//{
						if(aList_Rep_data!=null && aList_Rep_data.size()>0);
						{
							ArrayList aList_temp = (ArrayList)aList_Rep_data.get(strAdgroup);
							if(aList_temp!=null)
							{
								if(strAdgroup!=null && strAdgroup.equalsIgnoreCase("AD_NULL"))
								{
										strAdgroup = "Default";
								}
								if(adGroupFns!=null && adGroupFns.equalsIgnoreCase("Details"))
								{
									lst_dat1.add(strAdgroup);
								}
								for (int i=0;i<aList_temp.size();i++)
								{
									int colspan=1;
									if(i==0)
										colspan =2;
									if(isVm)
									{
										if(i==9)
										continue;
									}
									else if(i==8)
										continue;
									String strAvg = (String)aList_temp.get(i);
									try
									{
										if(strAvg!=null && !(strAvg.equals("-") || strAvg.equalsIgnoreCase("Summary")))
										{
										try
											{if(i>6)
											{
												strAvg= erUtils.round(Float.parseFloat(strAvg),2);
											}
											else
											{
											double d_data = Math.round(Double.parseDouble(strAvg));
											strAvg = String.valueOf(d_data);
											}
										}
										catch (Exception e)
										{}
										}
									}catch(Exception e)
									{e.printStackTrace();}

										lst_dat1.add(dbInfo.formatValue(strAvg));
						%>
								<th class="tdborder" id="er_submit" colspan="<%=colspan%>" align="center" wrap width="10%"><b><%=dbInfo.formatValue(strAvg)%></b></th>
						<%	
								}
								if(aListTotalIO!=null && aListTotalIO.size()>1)
								{
									String strAvg = erUtils.calculateAvg(aListTotalIO);
									try
									{
										if(strAvg!=null && !(strAvg.equals("-")))
										{
											double d_data = Math.round(Double.parseDouble(strAvg));
											strAvg = String.valueOf(d_data);
											lst_dat1.add(dbInfo.formatValue(strAvg));
										}else
											lst_dat1.add("-");
									}catch(Exception e)
									{e.printStackTrace();}
				%>
								<th class="tdborder" id="er_submit" align="center" wrap width="10%"><b><%=dbInfo.formatValue(strAvg)%></b></th>
				<%
								}
								summarCount++;
							}
						}
				//}
			%>
						</tr>
			<%
				}
			%>
					</tbody>
				</table>
	<%
			}
	%>

	<%
		}
		else
		{
	%>
				<table align="center" width="93%" cellspacing="0" cellpadding="4" id="tableborder" border="0">
					<tr>
						<!--<td id="er_submit" NOWRAP align="center" width="100%"><span
							class="<%=fontStyleDblSingl%>"><egui:intnl
							text="reporter.common.No measures available for the current selection" /></span></td>-->
							<table width='100%' height='100%'><tr>	<td align='center' valign='middle'><img src='/final/images/Light/nomeasures_custom.png' /></td></tr></table>
					</tr>
				</table>
				<br>

<%
		}
	}
	sen1 = new Hashtable();
	if(lst_dat1!=null && !lst_dat1.isEmpty())
	{
			sen1.put(vec1,lst_dat1);
			ht1=new Hashtable();
			ht1.put(s_tit,sen1);
			lst.add(ht1);
			sen1 = new Hashtable();
			ht1 = new Hashtable();
		session.setAttribute("ScheduleCSVData",lst);
	}
	else 
	{
		session.setAttribute("ScheduleCSVData",lst);
	}
%>
			</div>
		</div>
	<%
		if(pdfPrint!=null && pdfPrint.equalsIgnoreCase("yes"))
		{
	%>
			<div class="printFooterText"><%=strPrintFooterText%></div>
	<%
		}
	%>
		</body>
	</html>


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

				String value = parameter.substring(ind+1);
				if(reqparam!=null&&reqparam.equals("er_timeline"))
				{
					value=com.eg.EgURLEncoder.encode(value, "UTF-8");
				}
				else if(reqparam!=null&&reqparam.equals("er_trgt"))
				{
					value=com.eg.EgURLEncoder.encode(value, "UTF-8");
				}
				else if(reqparam!=null&&reqparam.equals("er_trgttype"))
				{
					value=com.eg.EgURLEncoder.encode(value, "UTF-8");
				}
				else if(reqparam!=null&&reqparam.equals("er_time"))
				{
					value=com.eg.EgURLEncoder.encode(value, "UTF-8");
				}
				else if(reqparam!=null&&reqparam.equals("pdfTime"))
				{
					value=com.eg.EgURLEncoder.encode(value, "UTF-8");
				}
				else if(reqparam!=null&&reqparam.equals("er_priority"))
				{
					value=com.eg.EgURLEncoder.encode(value, "UTF-8");
				}
				else if(reqparam!=null&&reqparam.equals("er_uptimetest"))
				{
					value=com.eg.EgURLEncoder.encode(value, "UTF-8");
				}
				else if(reqparam!=null&&reqparam.equals("limitforbg"))
				{
					value=com.eg.EgURLEncoder.encode(value, "UTF-8");
				}
				else if(reqparam!=null&&reqparam.equals("er_stdate"))
				{
					value=com.eg.EgURLEncoder.encode(value, "UTF-8");
				}
				else if(reqparam!=null&&reqparam.equals("inidate"))
				{
					value=com.eg.EgURLEncoder.encode(value, "UTF-8");
				}
				else if(reqparam!=null&&reqparam.equals("er_enddate"))
				{
					value=com.eg.EgURLEncoder.encode(value, "UTF-8");
				}
				else if(reqparam!=null&&reqparam.equals("startdate"))
				{
					value=com.eg.EgURLEncoder.encode(value, "UTF-8");
				}
				else if(reqparam!=null&&reqparam.equals("enddate"))
				{
					value=com.eg.EgURLEncoder.encode(value, "UTF-8");
				}
				else if(reqparam!=null&&reqparam.equals("er_rtype"))
				{
					value=com.eg.EgURLEncoder.encode(value, "UTF-8");
				}
				else if(reqparam!=null&&reqparam.equals("inidate"))
				{
					value=com.eg.EgURLEncoder.encode(value, "UTF-8");
				}
				else if(reqparam!=null&&reqparam.equals("er_component"))
				{
					value=com.eg.EgURLEncoder.encode(value, "UTF-8");
				}else if(reqparam!=null&&reqparam.equals("subevent"))
				{
					value=com.eg.EgURLEncoder.encode(value, "UTF-8");
				}
				else if(reqparam!=null&&reqparam.equals("compNameList"))
				{
					value=com.eg.EgURLEncoder.encode(value, "UTF-8");
				}
				else if(reqparam!=null&&reqparam.equals("vw"))
				{
					value=com.eg.EgURLEncoder.encode(value, "UTF-8");
				}
				else if(reqparam!=null&&reqparam.equals("insubzone"))
				{
					value=com.eg.EgURLEncoder.encode(value, "UTF-8");
				}
				else if(reqparam!=null&&reqparam.equals("er_usertimeline"))
				{
					value=com.eg.EgURLEncoder.encode(value, "UTF-8");
				}
				else if(reqparam!=null&&reqparam.equals("er_template"))
				{
					value=com.eg.EgURLEncoder.encode(value, "UTF-8");
				}
				else if(reqparam!=null&&reqparam.equals("er_userid") || reqparam.equals("eruserid") || reqparam.equals("userID") || reqparam.equals("uid") || reqparam.equals("er_RmDispName") )
				{
					value=com.eg.EgURLEncoder.encode(value, "UTF-8");					
				}
				if(reqparam!=null&&(reqparam.equals("er_sthr") || reqparam.equals("chartformat") || reqparam.equals("st_date") || reqparam.equals("Minto") || reqparam.equals("stmin") || reqparam.equals("er_startmin") || reqparam.equals("throughSchedule") || reqparam.equals("scheduleType") || reqparam.equals("er_views") || reqparam.equals("endate") || reqparam.equals("enmin") || reqparam.equals("er_endhr")))
				{
					continue;
				}
				qString += reqparam+"="+value.trim()+"&";
			}
		}
		}catch(Exception e)
		{
			e.printStackTrace();
		}
		return qString;
	}
%>

<%@ include file="ErRemoveUser.jsp"%>
<%
	//For Setting the PDf File Name
	HashMap paramVal =new HashMap();
	paramVal.put("fileName","User_Session_Details");
	session.setAttribute("parameters", paramVal);
%>