<!DOCTYPE html>

<%
/*****************************************************************************
*	File name		: ErApplicationUserDetailsPrintReport.jsp
*	Purpose			: This page Handles Application UserDetails report Print funcionality
*	Version			: Reporter 6.0.3
*	Author			:Karthikeyan
********************************************************************************/
%>
<%@ include file="ErTracker.jsp"%>
<%@ page import="egurkha.reporter.*"%>
<%@ page import="com.eg.EgDiscInfoHelper"%>
<%@ page import="java.util.*"%>
<%@ page import="java.util.regex.*"%>
<%@ 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" />

<%
	
	Hashtable resultServiceNamesForComp=(Hashtable)esmb.getServiceNamesForComponentMap();
%>
<%
		String titleToDisplay ="";
try
{	
	String csvNameByRow=request.getParameter("csvNameByRow");// for display multiple user name in csv file true->next row, false->same column
	String queryString = ErUtils.prepareQueryString(request.getParameterMap());
	String qString=getEncodedQueryString(queryString);
	String mngrIP= new IniFile(new EgConfigInfo("manager").getDbFile()).getValue("DB_PROPERTIES","ManagerUrl");
	String strManagerURL = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort();
	UBean = new ErUserData(urs,false);
	session.setAttribute("UBean",UBean);
	ErReqData erd = new ErReqData(request);
	EgDateInfo egDt =new EgDateInfo();
	ErUtils erUtils = new ErUtils();
	ErReportHelper erh=new ErReportHelper();
	EgMappingInfo intlmp=new EgMappingInfo(thisuser.getLanguage());
	//ErComponentsUtils compUtils = new ErComponentsUtils(thisuser.getLoginID());
	EgTimeZoneConverter converterStart=null;
	EgTimeZoneConverter converterEnd = null;
	String comFormat="";
	String groupByComponent=request.getParameter("group_by_component");

	System.out.println("groupByComponent::Print:::>>>"+groupByComponent);
	EgUserRole userRole      = thisuser.getUserRole();
	boolean hasAllComponentAccess= userRole.hasAllComponentAccess();
	List userCompList=new LinkedList();
	if(!hasAllComponentAccess)
	{
		userCompList = getComponentsForUserNotAccessAllComponents(thisuser);
	}
	String s_tit= "";
	String s_tit1= "";
	List lst = new LinkedList();
	List lst_dat = new LinkedList();
	Hashtable sen = new Hashtable();
	Hashtable ht = new Hashtable();
	Vector vec = new Vector();
	Hashtable ht1 = new Hashtable();
	List lst_dat1 = new LinkedList();
	Hashtable sen1 = new Hashtable();
	Vector vec2 = new Vector();
	Vector vec1 = new Vector();
	Vector vec3 = new Vector();
	List lst_dat2 = new LinkedList();
	Vector v_val1 = new Vector();
	//ended here
	List siteNames = new LinkedList();
	siteNames.addAll(compUtils.getUserSites());
	siteNames.addAll(compUtils.getUserServices(true));
	EgMappingInfo intlmap = new EgMappingInfo(thisuser.getLanguage());
	String reportType=request.getParameter("er_reportType");
	String er_RmDispName = request.getParameter("er_RmDispName");
	String rtype = request.getParameter("er_gtype");
	String subtype = request.getParameter("er_trgttype");	
	String er_option =request.getParameter("er_option");
	String erservice = request.getParameter("erservice");
		
	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 Rep_data1 = (Hashtable) session.getAttribute("Farm_data");
	if((rtype.equals("Citrix") && subtype.equals("Consolidated Report") && erservice.equalsIgnoreCase("Service Health"))|| (Rep_data1 == null || Rep_data1.equals("")))
	{
		Rep_data1 = (Hashtable)request.getAttribute("Form_Data");
	}
	Hashtable Application_data = (Hashtable)session.getAttribute("htdat");
	Hashtable Session_data = (Hashtable)session.getAttribute("sessionData");
	
	if(Session_data == null)
	{
		Session_data = (Hashtable)request.getAttribute("Report_data_ForSession");
	}
	if(Application_data == null)
	{
		Application_data = (Hashtable)request.getAttribute("htdat");
	}
	Vector v_iconData = (Vector)session.getAttribute("v_iconData");
	if(v_iconData == null)
	{
		v_iconData = (Vector)request.getAttribute("v_iconData"); 
	}	
	
	String isNeedGeo = reportInfo.getValue("APPLICATION_REPORT", "needGeoDetails");
	String columnsUsed = reportInfo.getValue("APPLICATION_REPORT", "GeoDetailsColumn");
	boolean needGeoDetails = false;
	if(isNeedGeo!=null && isNeedGeo.equalsIgnoreCase("Yes"))
	{
		needGeoDetails = true;
	}
	ArrayList apptop= (ArrayList)session.getAttribute("appForPrint");

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

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

	ErSort.order=orderBy;
	ErSort.index=er_sortby;
	String s_comptype = request.getParameter("avg");
	String titforsession = (String)session.getAttribute("title");
	Vector Session_data1 = (Vector)session.getAttribute("sessionData1");
	if(Session_data1 == null)
	{
		Session_data1 = (Vector)request.getAttribute("Report_data1");
	}
	ArrayList arrses_data = (ArrayList)session.getAttribute("sessionDatatop");
	if(arrses_data == null)
	{
		 arrses_data = (ArrayList)request.getAttribute("Report_data2");
	}
	ArrayList dataHash = (ArrayList) session.getAttribute("Event_data");//from ErCtxEventReporter for total alert
	if(dataHash == null)
	{
		dataHash = (ArrayList)request.getAttribute("RESULTPROC");
	}
	Vector a_list=(Vector)session.getAttribute("NO_ALERTS");//from ErCtxEventReporter.jsp for all alerts
	if(a_list ==null)
	{
		a_list=(Vector)request.getAttribute("ALERTS");
	}

	//ArrayList Hash_repdata = (ArrayList) request.getAttribute("hash_data");
	ArrayList Hash_repdata = (ArrayList) session.getAttribute("hash_data");
	ArrayList topAppsDataForFarm = (ArrayList)session.getAttribute("userTopAppsFarm");
	ArrayList topAppsDataForServer = (ArrayList)session.getAttribute("userTopAppsServ");
	ArrayList  perServerDispMaxAvgPer = (ArrayList)session.getAttribute("userMaxAvgPer");
	//ArrayList perServerDispMaxAvgPer = (ArrayList)request.getAttribute("userMaxAvgPer");
	ArrayList disconuser=(ArrayList)request.getAttribute("disconuserdeal");
	if(Hash_repdata == null)
	{
		Hash_repdata = (ArrayList) request.getAttribute("Report_data");
	}
	if(perServerDispMaxAvgPer == null)
	{
		   perServerDispMaxAvgPer = (ArrayList) request.getAttribute("perServerDispMaxAvgPer");
		// 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");
	}

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

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

	String timefrom = request.getParameter("timefrom");
	String timeto = request.getParameter("timeto");
	String minfrom = request.getParameter("minfrom");
	String minto = request.getParameter("minto");
	String r_type = request.getParameter("er_rtype");
	String viewReport = (String)session.getAttribute("view");
	if(viewReport == null)
	{
		viewReport = request.getParameter("vw");
	}
//	view_name=getViewName(viewReport);
	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");
	if(ctype == null)
	{
		ctype = request.getParameter("er_compType");
	}
	String ercontype =request.getParameter("ercontype");
	String Strexcwe = request.getParameter("er_excwe");
	String typeisend= request.getParameter("typeisend");
	String chec= request.getParameter("er_check");

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

	String dispStartDate = null;
	String dispEndDate = null;
	String uiFile = "eg_ui.ini";
	String s_iniFile_dir = EgInstallInfo.getInstallDir()+ "/manager/config/";
	IniFile egUI = new IniFile(s_iniFile_dir + uiFile);
	String currentDateFormat = strUserDateFormat;
	String thinzone="";
	
	String fontStyleDbl = "";
	String fontStyleDblSingl = "";
	String pdfPrint = request.getParameter("pdfPrint");
	if((dbInfo.doubleByteEnabled || !thisuser.getLanguage().equals("en_US")) && !(pdfPrint !=null && pdfPrint.equalsIgnoreCase("yes")))
	{
		fontStyleDbl = " multi_font";
		fontStyleDblSingl = "multi_font";
	}
	else
	{
		fontStyleDbl = "";
		fontStyleDblSingl = "";
	}
	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));
	}
//
		String er_site = request.getParameter("er_site");
		String headerKeyName="";
			if(er_option!=null && er_option.equalsIgnoreCase("Segment"))
			{
				headerKeyName=" : "+er_site;
			}
			else if(er_option!=null && er_option.equalsIgnoreCase("Service"))
			{
				headerKeyName=" : "+er_site;
			}
			else if(er_option!=null && er_option.equalsIgnoreCase("Group"))
			{
				headerKeyName=" : "+er_site;
			}
			else if(er_option!=null && er_option.equalsIgnoreCase("Component"))
			{
				if(request.getParameter("er_compType")!=null)
					headerKeyName=" : "+intlmap.getComponentTypeDescription(request.getParameter("er_compType"));
				else if(request.getParameter("er_select_server")!=null)
					headerKeyName=" : "+request.getParameter("er_select_server");
				else
					headerKeyName="";
			}
			else
			{
				er_option="zone";
				headerKeyName=" : "+request.getParameter("select_farm");
			}
			//

%>

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

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

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

<link rel="stylesheet" type="text/css" href="../../final/styles/eGLightThemeIcons.css" />
<link rel="stylesheet" type="text/css" href="../../final/reporter/styles/printpagestyle.css" />

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

<script language="JavaScript1.2"
	src="../reporter/scripts/er_imagesLite.js"></script>
<script language="javascript" src="../reporter/scripts/jsrsClient.js"></script>
<script language="javascript" src="../reporter/scripts/select.js"></script>

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

<body marginwidth="20" marginheight="20" bgcolor="#FFFFFF">

<%
	String strLogCls = "printHeaderBoxLogo";
	if(pdfPrint !=null && pdfPrint.equalsIgnoreCase("yes"))
	{
		strLogCls = "printHeaderBoxLogo";
	}
	else
		strLogCls = "printPdfHeaderBoxLogo";

	if(pdfPrint !=null && pdfPrint.equalsIgnoreCase("yes"))
	{
%>
		<div class="<%=strLogCls%>" style="padding-top:10px"><img src="<%=imageName%>" border="0" /></div>
<%
	}
	else
	{
%>
		<div class="<%=strLogCls%>"><img src="<%=imageName%>" border="0" /></div>
<%
	}
	String subrtype=request.getParameter("subrtype");
	throughSchedule=request.getParameter("throughSchedule");
	if(throughSchedule!=null && throughSchedule.equalsIgnoreCase("true"))
	{
		subrtype=request.getParameter("er_subrtype");
	}
	else if(subrtype==null)
	{
		subrtype=request.getParameter("er_subrtype");
	}
	if(er_RmDispName!=null && er_RmDispName.length()>0) 
	{
		titleToDisplay = er_RmDispName.trim();
	} 
%>	 <div class="printHeaderBox">
						<!--<div style="float:left" > <header><%=titleToDisplay%></header></div>-->
						<div class="printHeaderBoxTitle"><%= titleToDisplay %></div>
							

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

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

%>
						<div style="float:right"><img class="iconPrinter mouse"  id="printbt" 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>
					<!--</td>
				</tr>
			</table>
		</td>
	</tr>
</table>-->
<%
	String start_date=erd.s_stdate;
	String end_date=erd.s_enddate;
	if(start_date!=null && end_date!=null)
	{
		if(erd.s_startmin !=null && !erd.s_startmin.equalsIgnoreCase("null"))
		{
			dispStartDate=start_date.trim()+" "+erd.s_sthr+":"+erd.s_startmin;
		}
		else
		{
			dispStartDate=start_date.trim()+" "+erd.s_sthr+":"+"00";
		}

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



	



			//THINCLIENT APPLICATION REPORT
	 if(rtype.equals("Citrix") && subtype.equals("Application User Details"))
	{
		String Days = reportInfo.getExcludeWeekend("APPLICATION_REPORT");
%>

<div class="printOuterBoxNoBorder">
<!--<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" style="border-bottom:1px solid #ccc;">
	<tr>
		<td align="left" valign="top" width="50%"> -->
			<!--<div style="float:left;padding:4px;">-->


<%		String s_server1 = request.getParameter("er_server"); 
		String s_application1 = request.getParameter("er_application");
		String s_perserver=request.getParameter("er_perserver");
		String s_farmserver1 = request.getParameter("select_farm");
		if(s_farmserver1!=null && !s_farmserver1.equals("-1"))
		{
					s_tit = intlmap.getTextDescription("reporter.application.Application User Details Report for")+" - "+headerKeyName;
%>
						<!--<div style="float:left" class="formLabel"><egui:intnl text="reporter.common.Application User Details Report for "/>&nbsp;<%=er_option%></div><div style="float:left;" class="formValue">&nbsp;<%=headerKeyName%></div>-->
						<!--<div class="printOuterBoxNoBorder">-->
						<div class="printSelectionFields"><egui:intnl text="Application User Details Report for" />&nbsp;<%=er_option%> - <span class="bold"><%=headerKeyName%></span></div>
<%
		}
		else
		{
%>
						<!--<div style="float:left;" class="formValue"><egui:intnl text="reporter.common.Application User Details Report" /></div>-->
						<div class="printSelectionFields"><egui:intnl text="reporter.common.Exclude WeekEnds" /> - <span class="bold"><egui:intnl text="<%=Days%>" /></span></div>
<%
		}
%>
			<!--</div>-->
<%
		if(Strexcwe!=null&&Strexcwe.equalsIgnoreCase("Yes"))
		{
%>
			<!--<div style="clear:both;float:left;padding:4px;">
				<div style="float:left" class="formLabel"><egui:intnl text="reporter.common.Exclude WeekEnds" /></div>
				<div style="float:left;width:10px" align="center" >:</div>
				<div style="float:left;" class="formValue"><%=Days%></div>
			</div>-->
				<div class="printSelectionFields"><egui:intnl text="reporter.common.Exclude WeekEnds" /> - <span class="bold"><egui:intnl text="<%=Days%>" /></span></div>
<%
		}
		if(ctype!=null && ctype.length()>0)
		{
%>			
			<!-- <div style="clear:both;float:left;padding:4px;">
				<div style="float:left" class="formLabel"><egui:intnl text="reporter.common.Component Type" /></div>
				<div style="float:left;width=10px" align="center" >:</div>
				<div style="float:left;" class="formValue"><%=intlmap.getComponentTypeDescription(ctype)%></div>
			</div> -->
			<div class="printSelectionFields"><egui:intnl text="reporter.common.Component Type" /> - <span class="bold"><egui:intnl type="<%=ctype%>" /></span></div>
<%
		}
%>
		<!-- </td>
		<td align="right" valign="top">	  -->
			<!--<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"><%=st_Time%>&nbsp;<egui:intnl text="reporter.common.hrs" /></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"> <%=en_Time%>&nbsp;<egui:intnl text="reporter.common.hrs" /></div>
			</div>-->
				<div class="printSelectionFields">Timeline - <span class="bold"><%=st_Time%> &nbsp;<egui:intnl text="reporter.common.hrs" /> to <%=en_Time%> &nbsp;<egui:intnl text="reporter.common.hrs" /> </span></div>
			

			<!--<div style="clear:both;float:right;padding:4px;">
				<div style="float:left" class="formLabel"><egui:intnl text="reporter.common.Time Period" /></div>
				<div style="float:left;width:10px" align="center">:</div>
				<div style="float:left;" class="formValue"><%=timefrom+":"+minfrom%>&nbsp;<egui:intnl text="reporter.common.to" /> &nbsp;<%=timeto+":"+minto%></div>
			</div>-->
			
				<div class="printSelectionFields">Time Period - <span class="bold"><%=timefrom+":"+minfrom%> &nbsp;<egui:intnl text="reporter.common.hrs" /> to <%=timeto+":"+minto%> &nbsp;<egui:intnl text="reporter.common.hrs" /></span></div>
				<!--</div>-->
		<!--</td>
	</tr>
</table>-->
</div>
<%
	Vector dvec = new Vector();
	String stimefmt = "Start Date : "+st_Time+" "+intlmp.getTextDescription("reporter.common.hrs");
	String etimefmt = "End Date : "+en_Time+" "+intlmp.getTextDescription("reporter.common.hrs");;
	dvec.add('"'+stimefmt+'"');
	dvec.add('"'+etimefmt+'"');
	lst.add(s_tit);
	lst.add(dvec);

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

		if(apptop == null || apptop.isEmpty() || apptop.size()==0)
		{
			if(Application_data!=null && Application_data.size() > 0)
			{
	
				Vector value2=new Vector();
				int columnCount=0;//used to find the column count for header colspan
				if (!Application_data.isEmpty())
				{
					Enumeration enum1 = Application_data.keys();
					while(enum1.hasMoreElements())
					{
						String key1 = (String)enum1.nextElement();
						value2=(Vector)Application_data.get(key1);
						if(value2.size()>0)
						columnCount=((Vector)value2.get(0)).size();
						String s_server=request.getParameter("er_server");
						String s_farmserver=request.getParameter("select_farm");
						String s_application=request.getParameter("er_application");
						if(!needGeoDetails)
						{
%>
<div class="printOuterBox">
<%
	if ((s_server==null  || s_server.equals("-1") || aListAlltype.contains(s_server) || s_server.equals("")) &&  s_farmserver!=null && !s_farmserver.equals(""))
	{
%>
		<div class="printOuterBoxHeader"><egui:intnl text="reporter.common.Application User Details Report " /></div>
		<div class="newTable">
			<table cellspacing="0" border="0" cellpadding="0" width="100%"><col width="30%"><col width="30%"><col width="30%"><col width="10%">
				<thead>
				<tr>
				<%
					if(s_perserver!=null && s_perserver.equals("No"))
					{
				%>
						<th align="left"><egui:intnl text="reporter.common.Server" /> / <egui:intnl text="reporter.common.Application" /></th>
				<%
					}
					else
					{
						if(groupByComponent!=null && groupByComponent.equalsIgnoreCase("yes"))
						{
				%>
						<th align="left"><egui:intnl text="reporter.common.Component" /></th>
				<%
						}
				%>
						<th  align="left" nowrap><egui:intnl text="reporter.common.Application" /></th>
<%
					}
	}
	else if ((s_server!=null || !s_server.equals("-1") || !s_server.equals("")) )
	{
		s_tit1=intlmap.getTextDescription("reporter.common.Application User Details Report for Server")+" - ";
%>
		<div class="printOuterBoxHeader"><egui:intnl text="reporter.common.Application User Details Report -" /></div>
			<div class="newTable">
				<table cellspacing="0" border="0" cellpadding="0" width="100%">
					<thead>
					<tr>
					<%
						if(groupByComponent!=null && groupByComponent.equalsIgnoreCase("yes"))
						{
					%>
							<th align="left"><egui:intnl text="reporter.common.Component" /></th>
					<%
						}
					%>
							<th align="center" align="left" width="20%" ><egui:intnl text="reporter.common.Application" /></th>
<%
	}
	else
	{
%>
		<div class="printOuterBoxHeader" width="100%" NOWRAP align="left" colspan="<%=columnCount%>"><egui:intnl text="reporter.common.Application User Details Report for Application" /> - <%=s_application%></div>
		<div class="newTable">
			<table cellspacing="0" border="0" cellpadding="0" width="100%">
				<thead>
				<tr>
<%
	}
%>
						<th  width="10%" align="center" nowrap><egui:intnl text="Unique User Count" /></th>
						<th   width="70%" align="left" nowrap><egui:intnl text="User Name(s)" /></th>

		<%	
			if(groupByComponent!=null && groupByComponent.equalsIgnoreCase("yes"))
			{
				vec.add(intlmp.getTextDescription("reporter.common.Component"));
			}
			vec.add(intlmp.getTextDescription("reporter.common.Application"));
			vec.add(intlmp.getTextDescription("Unique User Count"));
			vec.add(intlmp.getTextDescription("User Name(s)"));
			String s_var = "";
			String st_value="";
			String displayname="";
			String mes="";
			Vector v_val = new Vector();
			ArrayList sublist=(ArrayList)reportInfo.getVariables("APPLICATION_REPORT");
			int count=0;
			
			for(int m=0;m<sublist.size();m++)
			{
				s_var = (String)sublist.get(m);
				String val2="";
				if (s_server==null || s_server.equals("-1"))
				{
					if(s_var.startsWith(key1)) 
					{
						StringTokenizer tok2 = new StringTokenizer(s_var,":");
						while(tok2.hasMoreTokens())
						{
							tok2.nextToken();
							tok2.nextToken();
							val2=tok2.nextToken();
							StringTokenizer meas=new StringTokenizer(val2,"#");
							if(meas.hasMoreTokens() )
								mes=meas.nextToken();
							else
								mes=val2;
							if(meas.hasMoreTokens() )
								displayname=meas.nextToken();
							else
								displayname=val2;
						}
						st_value=reportInfo.getValue("APPLICATION_REPORT",s_var);
						v_val.add(st_value);
					}
				}
				else
				{
					String strCompType = null;
					if(s_server.lastIndexOf(":")>-1)
						strCompType = s_server.substring(s_server.lastIndexOf(":")+1);
					if(s_server.indexOf("All ")>-1)
						strCompType = s_server.substring(s_server.lastIndexOf("All ")+("All ".length()));

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

		%>
					<th colspan="<%=countTokens%>" align="center"><b><egui:intnl text='<%="reporter.common."+displayname%>' /></b></th>
		<%
					}
				}
				displayname="";
			}
			count++;
		%>
				</tr>
				<tr>
					<td align="center"></td>
					<td align="center"></td>
					<td align="center"></td>
<%
		if(groupByComponent!=null && groupByComponent.equalsIgnoreCase("yes"))
		{
%>
			<td align="center"></td>
<%
		}
%>
		<%
			int fieldsize=3;
			for(int v=0;v<v_val.size();v++)
			{
				String v_value = (String)v_val.get(v);
				StringTokenizer tokenizer=new StringTokenizer(v_value,",");
				while(tokenizer.hasMoreTokens())
				{
					String str1=tokenizer.nextToken();
		%>
					<td align="center"><b><egui:intnl text='<%="reporter.common."+str1%>' /></b></td>
		<%
				}
			}
		%>
				</tr>
			</thead>
			<tbody>
		<%
						}
						else
						{
							if(groupByComponent!=null && groupByComponent.equalsIgnoreCase("yes"))
							{
								vec.add(intlmp.getTextDescription("reporter.common.Component"));
							}
							vec.add(intlmp.getTextDescription("reporter.common.Application"));
							vec.add(intlmp.getTextDescription("Unique User Count"));
							vec.add(intlmp.getTextDescription("User Name(s)"));
							ArrayList varList = (ArrayList)reportInfo.getVariables("APPLICATION_REPORT");
							String strUnitValue="";
							String strDisplayName="";
							String strMeasure="";
							Vector vecValue = new Vector();
							int tempCount=0;
							for(int cnt=0;cnt<varList.size();cnt++)
							{
								String strVariable = (String)varList.get(cnt);
								String strUnit="";
								if (s_server==null || s_server.equals("-1"))
								{
									if(strVariable.startsWith(key1)) 
									{
										StringTokenizer stToken = new StringTokenizer(strVariable,":");
										while(stToken.hasMoreTokens())
										{
											stToken.nextToken();
											stToken.nextToken();
											strUnit=stToken.nextToken();
											StringTokenizer measUnit=new StringTokenizer(strUnit,"#");
											if(measUnit.hasMoreTokens() )
												strMeasure=measUnit.nextToken();
											else
												strMeasure=strUnit;
											if(measUnit.hasMoreTokens() )
												strDisplayName=measUnit.nextToken();
											else
												strDisplayName=strUnit;
										}
										strUnitValue=reportInfo.getValue("APPLICATION_REPORT",strVariable);
										vecValue.add(strUnitValue);
									}
								}
								else
								{
									String strTempCompType = null;
									if(s_server.lastIndexOf(":")>-1)
										strTempCompType = s_server.substring(s_server.lastIndexOf(":")+1);
									if(s_server.indexOf("All ")>-1)
										strTempCompType = s_server.substring(s_server.lastIndexOf("All ")+("All ".length()));
									if(strTempCompType!=null && strVariable !=null && !strVariable.startsWith(strTempCompType))
										continue;
									if(s_server.lastIndexOf(":")>-1)
										strTempCompType = s_server.substring(s_server.lastIndexOf(":")+1);
									if(strTempCompType!=null && strVariable !=null && !strVariable.startsWith(strTempCompType))
										continue;
									StringTokenizer tok2 = new StringTokenizer(strVariable,":");
									if(strVariable.indexOf(key1)>-1)
									{
										while(tok2.hasMoreTokens())
										{
											tok2.nextToken();
											tok2.nextToken();
											strUnit=tok2.nextToken();
											StringTokenizer measUnit=new StringTokenizer(strUnit,"#");
											if(measUnit.hasMoreTokens() )
												 strMeasure=measUnit.nextToken();
											else
												 strMeasure=strUnit;
											if(measUnit.hasMoreTokens() )
												strDisplayName=measUnit.nextToken();
											else
												strDisplayName=strUnit;
										}
										strUnitValue=reportInfo.getValue("APPLICATION_REPORT",strVariable);
										vecValue.add(strUnitValue);
									}
								}
								if (strUnitValue.equals(""))
									strUnitValue="Avg";
								StringTokenizer st_val=new StringTokenizer(strUnitValue,",");
								int countTokens=st_val.countTokens();
								if(strUnitValue.indexOf("Avg")>-1 && strUnitValue.indexOf("Pct")>-1 
									&& strUnitValue.indexOf("Max")  >-1 )
								{
									vec.add(intlmp.getTextDescription("reporter.common."+strDisplayName));
								}
								else if((strUnitValue.indexOf("Avg")>-1 && strUnitValue.indexOf("Pct")>-1) 
									|| (strUnitValue.indexOf("Avg")>-1 && strUnitValue.indexOf("Max")>-1) 
									|| (strUnitValue.indexOf("Max")>-1 && strUnitValue.indexOf("Pct")>-1) )
								{
									if(!strDisplayName.equals(""))
									{
										String strValues = (String)vecValue.get(tempCount);
										StringTokenizer tokenizer=new StringTokenizer(strValues,",");
										String str11=tokenizer.nextToken();
										String str22=tokenizer.nextToken();
										vec.add(intlmp.getTextDescription("reporter.common."+strDisplayName)+" - "+"("+str11+")");
										vec.add(intlmp.getTextDescription("reporter.common."+strDisplayName)+" - "+"("+str22+")");
									}
								}
								else
								{
									if(!strDisplayName.equals(""))
									{
										vec.add(intlmp.getTextDescription("reporter.common."+strDisplayName));
									}
								}
								strDisplayName="";
								tempCount++;
							}
						}
		Collections.sort(value2,new ErSort());
		ArrayList aColList = new ArrayList();
		ArrayList aTempColList = new ArrayList();
		if(needGeoDetails)
		{
			StringTokenizer st = new StringTokenizer(columnsUsed,",");
			aColList.add("username");
			while(st.hasMoreTokens())
			{
				String strColumns = st.nextToken();
				aColList.add(strColumns);
				aTempColList.add(strColumns);
				vec.add(intlmap.getTextDescription("reporter.common."+strColumns));
			}
		}
		for (int z=0;z<value2.size();z++)
		{
			Vector v_data=(Vector)value2.get(z);
			int counts=0;
			ArrayList userList = null;
			String strTempData = "";
			if(v_iconData!=null && z<=v_iconData.size()-1)
			{
				userList = (ArrayList)v_iconData.get(z);
			}
			for (int i=0;i<v_data.size();i++)
			{
				String strdata=v_data.get(i).toString();
				/*if (i==1)
				{
					strdata = (strdata == null || strdata.equals("")|| strdata.equals("-5.0")
					|| strdata.equals("-1.0"))? "-" : erUtils.round(Float.parseFloat(strdata),4);
				}
				else if (i==2)
				{
					strdata = (strdata == null || strdata.equals("")|| strdata.equals("-5.0")
						|| strdata.equals("-1.0"))? "-" : erUtils.round(Float.parseFloat(strdata),0);
				}
				else if(i>2)
				{
					strdata = (strdata == null || strdata.equals("")|| strdata.equals("-5.0")
					|| strdata.equals("-1.0"))? "-" : erUtils.round(Float.parseFloat(strdata),2);
				}*/
				if(strdata.indexOf(":NULL")>-1)
					strdata = strdata.substring(0,strdata.indexOf(":NULL"))+strdata.substring(strdata.indexOf(":NULL")+5);
				if(needGeoDetails)
				{
					if((groupByComponent!=null && groupByComponent.equalsIgnoreCase("Yes") && i == 2) || (groupByComponent!=null && groupByComponent.equalsIgnoreCase("no") && i == 1))
					{
						strTempData = strTempData + " - Unique User : "+strdata+"&nbsp;&nbsp;";
					}
					else if(groupByComponent!=null && groupByComponent.equalsIgnoreCase("Yes") && i==1)
					{
						strTempData += strdata;
					}								
				}
				if (i==0)
				{
					strTempData += strdata;
					if(groupByComponent!=null && groupByComponent.equalsIgnoreCase("Yes"))
					{
						strTempData += "\\";
					}
					lst_dat.add("\""+strdata+"\"");
					if(!needGeoDetails)
					{
			%>
				<tr>
					<td width="28%" align="left"><%=strdata%></td>
			<%
					}
				}
				else
				{
					//lst_dat.add(strdata);
					if(csvNameByRow!=null && csvNameByRow.equalsIgnoreCase("true"))
					{
						if(groupByComponent!=null && groupByComponent.equalsIgnoreCase("yes"))
						{
							if(strdata.indexOf(",")>=0)
							{
								StringTokenizer tokenizer=new StringTokenizer(strdata,",");
								int k=0;
								while(tokenizer.hasMoreTokens())
								{
									String str1=tokenizer.nextToken();
									 if(k==0)
										lst_dat.add("\""+str1+"\"");
									else
									{
										lst_dat.add("");
										lst_dat.add("");
										lst_dat.add("");
										lst_dat.add("\""+str1+"\"");
									}
									
									//k++;
									
									if(i == 3)
									{
										HashMap userMap = null;
										if(userList!=null)
										{
											userMap = (HashMap)userList.get(k);
										}
										k++;
										if(userMap!=null)
										{
											for(int cnt=0;cnt<aTempColList.size();cnt++)
											{
												lst_dat.add("\""+userMap.get((String)aTempColList.get(cnt))+"\"");
											}
										}
									}
								}
							}
							else
							{
								lst_dat.add("\""+strdata+"\"");
								HashMap aListMap = null;
								if(i == 3)
								{
									if(userList!=null && userList.size()>0)
									{
										aListMap = (HashMap)userList.get(0);
									}
										
									for(int cnt=0;cnt<aTempColList.size();cnt++)
									{
										lst_dat.add((String)aListMap.get(aTempColList.get(cnt)));
									}
								}
							}
						}
						else if(strdata.indexOf(",")>=0)
						{
							StringTokenizer tokenizer=new StringTokenizer(strdata,",");
							int k=0;
							while(tokenizer.hasMoreTokens())
							{
								String str1=tokenizer.nextToken();
								if(k==0)
									lst_dat.add("\""+str1+"\"");
								else
								{
									 lst_dat.add("");
									 lst_dat.add("");
									 lst_dat.add("\""+str1+"\"");
								}
								//k++;
								if(i == 2)
								{
									HashMap userMap = null;
									if(userList!=null)
									{
										userMap = (HashMap)userList.get(k);
									}
									 k++;
									if(userMap!=null)
									{
										for(int cnt=0;cnt<aTempColList.size();cnt++)
										{
											lst_dat.add("\""+userMap.get((String)aTempColList.get(cnt))+"\"");
										}
									}
								}
							}
						}
						else
						{
							lst_dat.add("\""+strdata+"\"");
							if(i == 2)
							{ 
								
								HashMap aListMap = null;
								if(userList!=null && userList.size()>0)
								{
									aListMap = (HashMap)userList.get(0);
								}
								if(aListMap!=null)
								{
									for(int cnt=0;cnt<aTempColList.size();cnt++)
									{
										lst_dat.add("\""+aListMap.get((String)aTempColList.get(cnt))+"\"");
									}
								}
							}
						}
					}
					else
					{
						lst_dat.add("\""+strdata+"\"");
					}
					String valueStr = strdata.toString();
					String pattern = "(^[\"]?\\d+[\"]?$)|(^[\"]?\\d+(\\.\\d*)[\"]?$)";
					Pattern r = Pattern.compile(pattern);
					Matcher m = r.matcher(valueStr);
					String textAlign = "left";
					if (m.find() || valueStr.equals("-")) {
						textAlign = "center";
					}
					if(!needGeoDetails)
					{
					
		%>
				<td width="9%" align="<%=textAlign%>"><%=strdata%></td>
		<%
					}
				}
				if(i == v_data.size()-1 && !needGeoDetails) {
		%>
			</tr>
	<%
				}
				
			}
			if(needGeoDetails)
				{
%>
				<div class="printOuterBox">
				<div class="printOuterBoxHeader"><%=strTempData%></div>
					<div class="newTable">
					<table width="100%" cellpadding="0" cellspacing="0" >
								<thead>
								<tr>
									
<% 
								for(int colCnt=0;colCnt<aColList.size();colCnt++)
								{
									String strColList = (String)aColList.get(colCnt);
%>
									<th style="text-transform:capitalize"><%=strColList%></th>
<%
								}
%>
								</tr>
								</thead>
								<tbody>
<%
					for(int vv=0;vv<userList.size();vv++)
					{
						HashMap userMap = (HashMap)userList.get(vv);
%>
									<tr>
<%
						for(int ii=0;ii<aColList.size();ii++)
						{
%>
										<td align="center"><%=userMap.get((String)aColList.get(ii))%></td>
<%
						}
%>
									</tr>
<%
					}
%>
								</tbody>
								</table>
					</div>
					</div>
				<br/>
<%
				}
		}
		if(!needGeoDetails)
		{
%>			</tbody>
		</table>
	</div>
</div>
<%
		}
					}
				}
			}
			else
			{
%>
<table width='100%' height='100%'>
	<tr>
		<td align='center' valign='middle'><img src='/images/Light/nomeasures_custom.png' /></td>
	</tr>
</table>
<%
		lst.add(intlmp.getTextDescription("reporter.common.No measures available for the current selection"));
			}
%>
				
<%
		}
		else if(apptop!=null && apptop.size() > 0&&s_server1.equals("-1")||apptop!=null && apptop.size() > 0&&!s_server1.equals("-1"))
		{
			String topparam  = (String)session.getAttribute("topparam");
			if(topparam == null)
			{
				topparam = request.getParameter("er_check");
			}
			if(st_apptopdata == null)
			{
				st_apptopdata = request.getParameter("er_application1");
			}
			String strColSpan = "2";
			if(apptop!=null && apptop.size() > 0)
			{
				if(topparam!=null&&topparam.equals("true"))
					strColSpan ="1";
%>
<table align="center" width='100%' cellspacing="0" cellpadding="0" border="0" class="printTable">
	<tr>
		<td class="printTableHeader" colspan="<%=strColSpan%>">
<%
				if(topparam!=null&&topparam.equals("true"))
				{
%>
			<egui:intnl text="reporter.common.Users in" />&nbsp;<%=st_apptopdata%>
<%
				}
				else
				{
%>
			Top&nbsp;<egui:intnl text="reporter.common.Users in" />&nbsp;<%=st_apptopdata%>
<%
				}
%>
		</td>
	</tr>
	<tr>
		<td class="printTableHeader2" align="center"><egui:intnl text="reporter.common.Username" /></td>
<%
				if(topparam.equalsIgnoreCase("null"))
				{
%>
		<td class="printTableHeader2" align="center" width="50%" wrap><egui:intnl text="reporter.common.No of Measurements with access to"/>&nbsp;<%=st_apptopdata.substring(st_apptopdata.indexOf("/")+1,st_apptopdata.length())%></td>
<%
				}
%>
	</tr>
	<tr>
<%
				int numTop = apptop.size();
				for(int n=0; n< numTop; n++)
				{
					HashMap data = (HashMap)apptop.get(n);
					String username = (String)data.get("user");
					String usercount = (String)data.get("usercount");
%>
		<td align="center" width="50%"><%=username%></td>
<%
					if(topparam.equalsIgnoreCase("null"))
					{
%>
		<td align="center" width="50%"><%=usercount%></td>
<%
					}
%>
	</tr>
<%
				}
%>
</table>
<%
			}
		}
						//ht.put(vec,lst_dat);
						sen1.put(vec,lst_dat);
						ht1.put(s_tit1,sen1);
						lst.add(ht1);
						session.setAttribute("ScheduleCSVData",lst);
	}


%>

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

}
catch(Throwable e)
{
	e.printStackTrace();
}
%>
<%!
	public List getComponentsForUserNotAccessAllComponents(User thisuser)
	{
		ErComponentsUtils compUtils = new ErComponentsUtils(thisuser.getLoginID());
		Vector v_CompTemp = compUtils.getAllUserComponents1();
		List tmpList = new ArrayList(compUtils.getTypeModifyComponents(v_CompTemp,2));
		if(tmpList!=null && tmpList.size()>0)
		{
			List userCompList_host=new LinkedList();
			for(int r=0; r<tmpList.size(); r++)
			{
				String s = (String) tmpList.get(r);
				if(s!=null && !s.endsWith(":NULL"))
				{
					StringTokenizer st=new StringTokenizer(s,":");
					String ctype=st.nextToken();
					String cname=st.nextToken();
					if(ctype!=null && cname!=null && ctype.trim().length()>0 && cname.trim().length()>0)
						userCompList_host.add(ctype+":"+cname+":NULL");
				}
			}
			if(userCompList_host!=null && userCompList_host.size()>0)
				tmpList.addAll(userCompList_host);
		}
		return tmpList;
	}

	public 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;
	}

	

%>

</body>
</html>

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

<%
// karthikeyan 

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

%>


<%!
	// karthikeyan 
    public  String customReplaceAll(String source,String toReplace,String replacement) {
        int idx = source.lastIndexOf(toReplace);
        if (idx != -1) {
            StringBuffer ret = new StringBuffer(source);
            ret.replace(idx, idx + toReplace.length(), replacement);
            while ((idx = source.lastIndexOf(toReplace, idx - 1)) != -1) {
                ret.replace(idx, idx + toReplace.length(), replacement);
            }
            source = ret.toString();
        }
        return source;
    }
    //

%>
