<%
/********************************************************************************************************
*	Name			:	endUserDashboardDataPrint.jsp
*	Purpose			:	To Save End User Dashboard Data as PDF
*	Version			:	eG 6.1.2 and Above
*	Creation Date	:	27/03/2016
*	Authtor			:	K N Raju and Saravanan.A
*	Design			:	Vijay 
*******************************************************************************************************/
%>
<%@ taglib prefix="egui" uri="../WEB-INF/eg-taglib.tld" %>
<%@ page errorPage = "EgProbsM.jsp" %>
<%@ page import = "java.util.*"%>
<%@ page import = "java.util.Map.Entry"%>
<%@ page import = "java.io.*"%>
<%@ page import = "com.egurkha.*"%>
<%@ page import = "com.egurkha.monitor.EgServerDashboardModel"%>
<%@ page import = "com.egurkha.monitor.EgDashBoardModel"%>
<%@ page import = "com.egurkha.monitor.MeasuresDAO"%>
<%@ page import = "com.egurkha.monitor.MonitorDAOFactory"%>
<%@ page import = "com.egurkha.util.*"%>
<%@ page import = "com.eg.*"%>
<%@ page import = "com.egurkha.monitor.VmDashboardHelper"%>
<%@ page language="java" contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" %>
<%@ page import = "com.eg.EgMappingInfo"%>
<%@ page import = "com.eg.EgURLEncoder"%>
<%@ page import = "com.eg.IniFile"%>
<%@ page import = "egurkha.reporter.ErUserData"%>
<%@ page import="com.eg.EgExternalInfo"%>
<%@ page import="com.egurkha.ini.*"%>
<%@ page import = "net.sf.json.*"%>
<%@ page import = "java.text.*" %>
<%@ page import = "java.math.*" %>
<%@ page import = "java.sql.Timestamp"%>
<%@ page import = "com.egurkha.EgTimeZoneConverter"%>
 
<%
	response.setHeader("Cache-Control","no-store");
	response.setHeader("Pragma","no-cache");
	response.setDateHeader ("Expires", -1);
	request.setCharacterEncoding("UTF-8");
%>

<!-- <link rel='stylesheet' type='text/css' href='/final/monitor/eg_styles/printPageStyles.css' /> -->
<%
try
{
	UserRegistry registry = UserRegistry.getInstance();
	User user = null; //registry.getUser(session.getId());
	String fromMenuStr = request.getParameter("fromMenu");
	boolean isFromMenu=false;
	if(fromMenuStr!=null && (fromMenuStr.equalsIgnoreCase("true") || fromMenuStr.equalsIgnoreCase("yes")))
		isFromMenu=true;
	if(isFromMenu)
		user = registry.getUser(session.getId(),true);
	else
		user = registry.getUser(session.getId());

	String showKeyUserStr = request.getParameter("showKeyUser");
	boolean showKeyUser=false;
	if(showKeyUserStr!=null && (showKeyUserStr.equalsIgnoreCase("true") || showKeyUserStr.equalsIgnoreCase("yes")))
		showKeyUser=true;

	String overviewType = request.getParameter("overviewType");

	String updateUserAssociateStr = request.getParameter("updateUserAssociate");
	boolean updateUserAssociateFlag=false;
	if(showKeyUser && updateUserAssociateStr!=null && (updateUserAssociateStr.equalsIgnoreCase("true") || updateUserAssociateStr.equalsIgnoreCase("yes")))
		updateUserAssociateFlag=true;

	//JSONObject jsonRoot = new JSONObject();
	EgUserRole userRole = null;
	boolean isAllCompAccess=false;
	boolean isDataManagerLogin=false;
	String userName = "admin";

	String file = "eg_endUserDetails.ini";
	String dir = EgInstallInfo.getInstallDir()+ "/manager/config/";
	IniFile ini = new IniFile(dir + file);
	IniFile uiIni = new IniFile(dir + "eg_ui.ini");

	boolean isDebugEnabled = false;
	int logFileSize = 30;

	String userExpLogging = ini.getValue("Logging","enableLogging");
	if(userExpLogging!=null && (userExpLogging.equalsIgnoreCase("true") || userExpLogging.equalsIgnoreCase("yes")))
		isDebugEnabled = true;

	if(isDebugEnabled){
		String fileSize = ini.getValue("Logging","fileSize");
		try{
			if(fileSize != null && fileSize.trim().length() > 0)
				logFileSize = Integer.parseInt(fileSize);

		}catch(Exception e){
			logFileSize = 30;
		}
	}
	String strEGManagerUser=ini.getValue("END_USER_DASHBOARD_SETTINGS","eGManagerUser");
	strEGManagerUser=(strEGManagerUser==null || strEGManagerUser.trim().length()==0)?"false":strEGManagerUser;
	boolean isEGManagerUser = strEGManagerUser.equalsIgnoreCase("true")?true:false;

	String show_app_overview = ini.getValue("END_USER_DASHBOARD_SETTINGS","ShowApplicationsOverview");

	String userType = request.getParameter("userType");
	if(user==null && (!isFromMenu))
	{
		String login_user ="";
		if(isEGManagerUser)
			login_user = request.getParameter("user");

		userName=(login_user==null || login_user.trim().length()==0)?"admin":login_user;
		ErUserData userData = new ErUserData(userName,false);
		if(userData==null)
		{
			userName="admin";
			userData = new ErUserData(userName,false);
			user = userData.usr;
		}
		else if(userData!=null)
			user = userData.usr;

		if(user!=null)
		{
			userRole = user.getUserRole();
			isAllCompAccess = userRole.hasAllComponentAccess();
		}
	}
	else if(user!=null)
	{
		userName = user.getLoginID();
		userRole = user.getUserRole();
		isAllCompAccess = userRole.hasAllComponentAccess();
		isDataManagerLogin = true;
	}

	boolean isOnlyVMAssigned=false;
	boolean isVMAssigned=false;
	if(user!=null && user.isOnlyVMAssigned() && (!user.isVMAssigned()) && user.getOnlyVMs().size()>0 && userType!=null && userType.equalsIgnoreCase("VDI"))
		isOnlyVMAssigned=true;
	else if(user!=null && (!user.isOnlyVMAssigned()) && user.isVMAssigned() && user.getOnlyVMs().size()>0 && userType!=null && userType.equalsIgnoreCase("VDI"))
		isVMAssigned=true;
	else if(user!=null && user.isOnlyVMAssigned() && user.isVMAssigned() && user.getOnlyVMs().size()>0 && userType!=null && userType.equalsIgnoreCase("VDI"))
	{
		isOnlyVMAssigned=true;
		isVMAssigned=true;
	}
	EgTimeZoneConverter convert = null;
	writeLog(" userName  "+userName,isDebugEnabled,logFileSize);
	StringBuffer buf = new StringBuffer();
	IniUI ui = IniUI.getInstance();
	IniFile egEx = new IniFile(EgInstallInfo.getInstallDir()+ "/manager/config/eg_external.ini");
	IniFile egFormat  = new IniFile(EgInstallInfo.getInstallDir()+ "/manager/config/eg_format.ini");
	EgTablesInfo tablesInfo = new EgTablesInfo("manager");
	EgDbInfo Dbdata = new EgDbInfo("manager");
	EgSpecsInfo specsInfo = new EgSpecsInfo("manager");
	EgExternalInfo egExternalInfo=new EgExternalInfo("manager");
	EgGroupInfo groupInfo = new EgGroupInfo();
	EgServerDashboardModel dashboardModel = new EgServerDashboardModel();
	EgDashBoardModel egDashboard=new  EgDashBoardModel();
	String thisLanguage = ui.getDefaultLanguage();
	if(user!=null)
	{
		user.setUserLanguageAndSkins();
		String userLang = user.getLanguage();
		if (userLang!=null && !userLang.equalsIgnoreCase("NULL"))
			thisLanguage=userLang;
	}
	EgMappingInfo mappingInfo = new EgMappingInfo(thisLanguage);
	String monitor_Skin = user.getMonitorSkin();
	VmDashboardHelper vmDashHelper=new VmDashboardHelper(user);
	List VmsList = new ArrayList();
	EgList egList=new EgList();
	String noOfInfoToDisplay = ""+10;
	EgList vdiDesktopsList= new EgList();
	int vdiDesktopsListTotalCount=0;
	int groupByUserCount = 0;
	Hashtable finalDesktopVmsHash=new Hashtable();
	Hashtable infosCompHash=new Hashtable();
	ArrayList infolist = new ArrayList();
	ArrayList infolist1 = new ArrayList();
	ArrayList dbinfolist = new ArrayList();

	List resTypeList = new LinkedList();
	/*List resCnameList = new LinkedList();
	List resCompsList = new LinkedList();
	List resNickList = new LinkedList();
	List resPortList = new LinkedList();*/

	//Hashtable typeCompInfoHash=new Hashtable();
	//Hashtable componentsInfo = new Hashtable();
	//Hashtable measuresInfo = new Hashtable();
	Hashtable measureValues = new Hashtable();
	//Hashtable user_count_hash = new Hashtable();
	ArrayList groupByUserKeys = new ArrayList();
	Hashtable finalGroupByUserTab = new Hashtable();
	//Hashtable groupByUser = new Hashtable();
	String maxUser="";
	//List componentTypeList=new ArrayList();
	List measureList = new ArrayList();
	String desktopUserName = request.getParameter("username");
	String isFromVCDS = request.getParameter("isFromVCDS");
	String searchString = (desktopUserName!=null && !desktopUserName.equalsIgnoreCase("") && desktopUserName.length()>0)?desktopUserName:request.getParameter("searchString");
	searchString=(searchString==null || searchString.trim().length()==0)?"":searchString;
	searchString = com.egurkha.util.StringUtils.decodeSecurityChar(searchString);
	boolean isAdtnlSearch = false;
	boolean addtionalSearchFlag = false;
	String adtnlSearchColumns = "";
	String adtnlSearchStr_EN = "";
	ArrayList addSearchColList = null;
	String adtnlSearchStr = request.getParameter("adtnlSearchStr");
	adtnlSearchStr = (adtnlSearchStr==null || adtnlSearchStr.trim().length()==0 || adtnlSearchStr.equalsIgnoreCase("NULL"))?"":adtnlSearchStr;
	String addSeachSubject = "Additional_Search";
	String additionalSearch = ini.getValue(addSeachSubject,"EnableAddtionalSearch");
	String adtnlSearchText = "";
	if (additionalSearch!=null && additionalSearch.trim().length()>0 && (additionalSearch.equalsIgnoreCase("true") || additionalSearch.equalsIgnoreCase("yes")))
	{
		if (adtnlSearchStr!=null && adtnlSearchStr.trim().length()>0 && !adtnlSearchStr.equalsIgnoreCase("NULL"))
		{
			isAdtnlSearch = true;
			adtnlSearchStr_EN = com.egurkha.util.StringUtils.encodeSecurityChar(adtnlSearchStr);
		}
		adtnlSearchColumns = ini.getValue(addSeachSubject,userType+":SelectedSearchColumn");
		if (adtnlSearchColumns!=null && adtnlSearchColumns.trim().length()>0 && !adtnlSearchColumns.equalsIgnoreCase("NULL"))
		{
			addSearchColList = (ArrayList)com.egurkha.util.StringUtils.egTokenizer(adtnlSearchColumns, ",",false,false,true);		//param 3-->includeEmpty,4-->unique,5-->trim
		}
		if(addSearchColList!=null && addSearchColList.size()>0)
		{
			Iterator addSearColItr = addSearchColList.iterator();
			StringBuffer addSearchBuf = new StringBuffer();
			while(addSearColItr.hasNext())
			{
				String tmpSearchCol = (String)addSearColItr.next();
				if(tmpSearchCol!=null && tmpSearchCol.trim().length()>0 && tmpSearchCol.indexOf(":")!=-1)
					addSearchBuf.append(tmpSearchCol.substring(tmpSearchCol.lastIndexOf(":")+1) +",");
			}
			if(addSearchBuf!=null){
				adtnlSearchText = addSearchBuf.toString();
				if(adtnlSearchText!=null && adtnlSearchText.endsWith(","))
					adtnlSearchText = adtnlSearchText.substring(0,adtnlSearchText.lastIndexOf(","));
				if(adtnlSearchText!=null && adtnlSearchText.trim().length()>0 && !adtnlSearchText.equalsIgnoreCase("NULL"))
					adtnlSearchText = mappingInfo.getTextDescription("monitor.endUserDashboard."+adtnlSearchText);
			}
		}
	}
	String searchStringVCDS ="";
	if(userType!=null && userType.equalsIgnoreCase("VDIESX"))
	{
		searchStringVCDS = searchString;
		if(isFromVCDS==null || isFromVCDS.trim().length()==0)
			searchString="";
	}

	String priority = request.getParameter("priority");
	priority=(priority==null || priority.trim().length()==0)?"ALL":priority;
	String tmp_priority=priority;

	String vdiType = request.getParameter("vdiType");
	vdiType=(vdiType==null || vdiType.trim().length()==0)?"":vdiType;

	String orderBy =request.getParameter("orderBy");
	orderBy=(orderBy==null || orderBy.trim().length()==0)?"desc":orderBy;
	if(orderBy==null || orderBy.trim().length()==0 || orderBy.equalsIgnoreCase("null"))
	{
		orderBy="desc";
	}

	String dsInfo = request.getParameter("dsInfo");
	if(dsInfo!=null && dsInfo.trim().length()>0)
		dsInfo =com.egurkha.util.StringUtils.decodeSecurityChar(dsInfo);
	String showDSInfo=null;
	Hashtable vmsHash = new Hashtable();
	String dscomp = request.getParameter("dscomp");
	String dscomptype = request.getParameter("dscomptype");
	
	String dsmsmt_host = request.getParameter("dsmsmt_host");

	if(isFromVCDS!=null && (isFromVCDS.equalsIgnoreCase("true") || isFromVCDS.equalsIgnoreCase("yes")))
	{
		showDSInfo = dsInfo;
		if(dsInfo!=null && dsInfo.trim().length()>0 && (dsInfo.startsWith("+") || dsInfo.startsWith("*")))
			showDSInfo = dsInfo.substring(1);

		vmsHash = (Hashtable)vmDashHelper.getVMsFromVCDatastore("VCDataStore",userType,dscomp,dscomptype,dsInfo,dsmsmt_host);
		if(vmsHash==null)
			vmsHash=new Hashtable();
	}
	boolean isFromGeo=false;
	String fromGeoStr = request.getParameter("fromGeo");
	if(fromGeoStr!=null && (fromGeoStr.equalsIgnoreCase("true") || fromGeoStr.equalsIgnoreCase("yes")))
		isFromGeo=true;

	String iniName = null,user_name = null,isUserBased = null,dashboard_name = null,view_name = null,time_line = null,geoInfo = null,usercountval = null,dashboard_mapping = null,fromServiceHomePage = null,fromZonePage = null,selectedTest=null,selectedMeasure=null,selectedTestMea=null;
	int userTotalCount = 0;
	if(isFromGeo)
	{
		iniName = request.getParameter("iniName");
		user_name = request.getParameter("user_name");
		isUserBased = request.getParameter("isUserBased");
		dashboard_name = request.getParameter("dashboard_name");
		view_name = request.getParameter("view_name");
		time_line = request.getParameter("time_line");
		geoInfo = request.getParameter("ginfo");
		usercountval = request.getParameter("usercountval");
		dashboard_mapping = request.getParameter("dashboard_mapping");
		fromServiceHomePage = request.getParameter("fromServiceHomePage");
		fromZonePage = request.getParameter("fromZonePage");
		selectedTest = request.getParameter("selectedTest");
		selectedTest=(selectedTest==null)?"":selectedTest;
		selectedMeasure = request.getParameter("selectedMeasure");
		selectedMeasure=(selectedMeasure==null)?"":selectedMeasure;

		if(selectedTest!=null && selectedTest.trim().length()>0 && selectedMeasure!=null && selectedMeasure.trim().length()>0)
			selectedTestMea=selectedTest+":"+selectedMeasure;
	}

	String enableBackButton = request.getParameter("enableBackButton");
	enableBackButton=(enableBackButton==null || enableBackButton.trim().length()==0)?"false":enableBackButton;

	String orderByColumnName = request.getParameter("orderByColumn");
	String isCsv_str = request.getParameter("isCSV");
	boolean isCSV=false;
	if(isCsv_str!=null && (isCsv_str.equalsIgnoreCase("true") || isCsv_str.equalsIgnoreCase("yes")))
	{
		isCSV=true;
	}

	String defaultOrderMeasure = ini.getValue("USER_DESKTOP_METRICS_DEFAULT_ORDER_MEASURE",userType);
	if(defaultOrderMeasure!=null && defaultOrderMeasure.trim().length()>0)
	{
		String deTest=defaultOrderMeasure.substring(0,defaultOrderMeasure.indexOf(":"));
		String deMea=defaultOrderMeasure.substring(defaultOrderMeasure.indexOf(":")+1);
		defaultOrderMeasure = Dbdata.getColumnForMeasure(deTest,deMea);
	}
	if((orderByColumnName==null || orderByColumnName.equals("null")) && defaultOrderMeasure!=null && defaultOrderMeasure.trim().length()>0)
		orderByColumnName=defaultOrderMeasure;

	String columnDispName = request.getParameter("columnDispName");
	String pageNoReq = request.getParameter("pageNo");
	if(pageNoReq==null || pageNoReq.trim().length()==0)
		pageNoReq = "0";

	int pageNo = Integer.parseInt(pageNoReq);

	userType = request.getParameter("userType");
	String searchFrom = request.getParameter("searchFrom");
	if(userType==null || userType.trim().length()==0)
		userType = request.getParameter("usertype");
	userType=(userType==null || userType.trim().length()==0)?"VDI":userType;
	if (selectedTest!=null && selectedTest.trim().length()>0 && selectedTest.equalsIgnoreCase("AppLaunchTest_DDD"))
	{
		//userType = "AppLaunchDDXenApp7";
		if(selectedTest.endsWith("_DDD"))
			selectedTest = selectedTest.substring(0,selectedTest.indexOf("_DDD"));
	}
	boolean isEndUserOverview = false;
	String endUserDashOverview = request.getParameter("endUserDashOverview");
	endUserDashOverview = (endUserDashOverview==null || endUserDashOverview.trim().length()==0)?"":endUserDashOverview;
	if(endUserDashOverview!=null && endUserDashOverview.trim().length()>0 && (endUserDashOverview.equalsIgnoreCase("true")||endUserDashOverview.equalsIgnoreCase("yes")))
		isEndUserOverview = true;
	boolean isFromUEDSort = false;
	String fromuedsort = request.getParameter("isfromuedsort");
	fromuedsort = (fromuedsort==null || fromuedsort.trim().length()==0)?"":fromuedsort;
	if(fromuedsort!=null && fromuedsort.trim().length()>0 && (fromuedsort.equalsIgnoreCase("true")||fromuedsort.equalsIgnoreCase("yes")))
		isFromUEDSort = true;
	String overviewSearchStr = request.getParameter("overviewsearchstr");
	overviewSearchStr = (overviewSearchStr==null || overviewSearchStr.trim().length()==0)?"":overviewSearchStr;
	String isFromUEDOverview = request.getParameter("isfromuedoverview");
	isFromUEDOverview = (isFromUEDOverview==null || isFromUEDOverview.trim().length()==0)?"":isFromUEDOverview;
	
	String aduserFilter = request.getParameter("aduserFilter");
	if(aduserFilter != null)
		aduserFilter=  com.egurkha.util.StringUtils.replace(aduserFilter,"|eq|","=");

	boolean defaultAdCase = false;
	if(aduserFilter != null && aduserFilter.equalsIgnoreCase("default")){
		aduserFilter ="All";
		defaultAdCase = true;
	}

	String showUserLocations = ini.getValue("GEO_LOCATION_SETTINGS",userType+":ShowUserLocations");
	String strSeparator = ini.getValue("GEO_LOCATION_SETTINGS",userType+":Separator");
	String strReplaceSep = ini.getValue("GEO_LOCATION_SETTINGS",userType+":ReplaceSeparatorTo");
	showUserLocations = (showUserLocations==null || showUserLocations.trim().length()==0)?"":showUserLocations;
	boolean isShowUserLocation = false;
	if(showUserLocations!=null && showUserLocations.trim().length()>0 && (showUserLocations.equalsIgnoreCase("true") || showUserLocations.equalsIgnoreCase("yes")))
		isShowUserLocation = true;

	String col_Type = request.getParameter("columnType");
	String strUDSortByAllValue=ini.getValue("END_USER_DASHBOARD_SETTINGS","SortByAllMeasureValue");
	strUDSortByAllValue=(strUDSortByAllValue==null || strUDSortByAllValue.trim().length()==0)?"false":strUDSortByAllValue;
	boolean isUDSortByAllValue = (strUDSortByAllValue.equalsIgnoreCase("true") || strUDSortByAllValue.equalsIgnoreCase("yes"))?true:false;

	String strMValueOrder=ini.getValue("END_USER_DASHBOARD_SETTINGS","SortByAllMeasureValueOrder");
	strMValueOrder=(strMValueOrder==null || strMValueOrder.trim().length()==0)?"asc":strMValueOrder;
	
	IniFile dashIni = new IniFile(EgInstallInfo.getInstallDir()+"/manager/config/eg_dashboardConfig.ini",true);
	boolean isDetailsFromADOnly = false;
	String locStr = dashIni.getValue("USER_LOCATION_TEST_CONFIG",userType+":ShowLocationFromADOnly");
	if(locStr != null && locStr.trim().length() > 0 && (locStr.equalsIgnoreCase("true") || locStr.equalsIgnoreCase("yes"))){
		isDetailsFromADOnly = true;
	}

	String defaultFilter = ini.getValue("END_USER_DASHBOARD_SETTINGS","defaultFilter");
	ArrayList subFilterList = null;
	String subFilter = ini.getValue("END_USER_DASHBOARD_SETTINGS","subFilter");
	if(subFilter != null && subFilter.trim().length() > 0)
		subFilterList = com.egurkha.util.StringUtils.egTokenizer(subFilter, ",", true,false,true);

	ArrayList excludedTestList = new ArrayList();
	String excluded_str = ini.getValue("EXCLUDED_CUT_OFF_FACTOR",userType);
	if(excluded_str != null && excluded_str.trim().length() > 0)
		excludedTestList = com.egurkha.util.StringUtils.egTokenizer(excluded_str, ",", true,false,true);

	String decimalFormatMeasure = ini.getValue("USER_DESKTOP_METRICS_DECIMAL_FORMAT_MEASURES",userType);
	ArrayList decimalFormatTestMeasureList = (ArrayList)getTokenList(decimalFormatMeasure,",");

	String convertToDaysMeasure = ini.getValue("USER_DESKTOP_METRICS_CONVERT_TO_DAYS_MEASURES",userType);
	ArrayList convertToDaysTestMeasureList =(ArrayList)getTokenList(convertToDaysMeasure,",");

	String udm_hide_unit = ini.getValue("USER_DESKTOP_METRICS_HIDE_UNIT",userType);
	ArrayList udm_hide_unit_list = (ArrayList)getTokenList(udm_hide_unit,",");

	String default_Filter=ini.getValue("END_USER_DASHBOARD_SETTINGS","defaultFilter");
	String sub_Filter=ini.getValue("END_USER_DASHBOARD_SETTINGS","subFilter");
	ArrayList tmpSubFilList = (ArrayList)getTokenList(sub_Filter,",");

	boolean isRetrieveFDB=false;
	String isRetrieveUserExpDatafromDB = ini.getValue("END_USER_DASHBOARD_SETTINGS","RetrieveUserExpDatafromDB");
	if(isRetrieveUserExpDatafromDB!=null && isRetrieveUserExpDatafromDB.length()>0 && (isRetrieveUserExpDatafromDB.equalsIgnoreCase("true") || isRetrieveUserExpDatafromDB.equalsIgnoreCase("yes")))
		isRetrieveFDB=true;


	JSONObject isEnableFilterJson = new JSONObject();
	String tmp_metrics = ini.getValue("USER_DESKTOP_METRICS",userName+":"+userType);
	if(tmp_metrics==null || tmp_metrics.trim().length()==0)
	{
		String tmp_metricsD = ini.getValue("USER_DESKTOP_METRICS","DEFAULT_"+userType);
		String tmp_metricsT = ini.getValue("USER_DESKTOP_METRICS",userType);
		if(tmp_metricsD != null && tmp_metricsD.trim().length() > 0)
			tmp_metrics = (String)getMeasureForUI(tmp_metricsD,tmp_metricsT);
		else
			tmp_metrics = tmp_metricsT;
	}
	ArrayList tmp_metricsList = new ArrayList();
	ArrayList filterList = new ArrayList();
	if(tmp_metrics != null && tmp_metrics.trim().length() > 0){
		tmp_metricsList = com.egurkha.util.StringUtils.egTokenizer(tmp_metrics, ",", true,false,true);
		if(tmp_metricsList != null && tmp_metricsList.size() > 0){
			for(int i=0;i<tmp_metricsList.size();i++){
				String met = (String)tmp_metricsList.get(i);
				if(met == null || met.trim().length() == 0)
					continue;

				ArrayList check = com.egurkha.util.StringUtils.egTokenizer(met, ":", true,false,true);
				if(check != null && check.size() ==2){
					String geoCheck = (String)check.get(0);
					String geoCheckValue = (String)check.get(1);

					if(geoCheck != null && geoCheck.trim().length()  > 0)
					{
						if(geoCheck.equalsIgnoreCase("GeoDetails") )
						{
							ArrayList valList = com.egurkha.util.StringUtils.egTokenizer(geoCheckValue, "~$~", true,false,true);

							if(valList != null && valList.size() ==2){
								filterList.add((String)valList.get(0));
							}
						}
					}
				}
			}
		}
	}


	String tmpOrderByColumnName=orderByColumnName;
	if(columnDispName!=null && columnDispName.trim().length()>0 && !columnDispName.equalsIgnoreCase("null"))
	{
		ArrayList metricsList = (ArrayList)getTokenList(tmp_metrics,",");

		String newObCN = (String)getRelavantOrderByColumnNames(metricsList,columnDispName,Dbdata);

		//if(newObCN!=null && newObCN.trim().length()>0)
			//tmpOrderByColumnName = newObCN;
	}

	boolean isdefaultFilter=false;
	boolean istmpSubFilter=false;
	boolean istmpnextSubFilter=false;
	if(filterList!=null && filterList.size()>0)
	{
		if(default_Filter!=null && default_Filter.length()>0 && filterList.contains(default_Filter))
			isdefaultFilter=true;
	}
	
	isEnableFilterJson.put("isdefaultFilter",isdefaultFilter);
	if(tmpSubFilList!=null && tmpSubFilList.size()>0)
	{
		String tmp_Sub_Val=(String)tmpSubFilList.get(0);
		if(tmp_Sub_Val!=null && tmp_Sub_Val.length()>0 && filterList.contains(tmp_Sub_Val))
			istmpSubFilter = true;
		
		if(tmpSubFilList.size()>1)
		{
			String tmp_Sub_Val_2=(String)tmpSubFilList.get(1);
			if(tmp_Sub_Val_2!=null && tmp_Sub_Val_2.length()>0 && filterList.contains(tmp_Sub_Val_2))
				istmpnextSubFilter=true;
		}
	}
	isEnableFilterJson.put("istmpSubFilter",istmpSubFilter);
	isEnableFilterJson.put("istmpnextSubFilter",istmpnextSubFilter);

	Hashtable finalEndUserDatas = (Hashtable)vmDashHelper.getEndUserDatas(userType);
	Hashtable infoResHash = new Hashtable();
	Hashtable dataResHash = new Hashtable();
	Hashtable fullInfoHash = new Hashtable();
	boolean orderByCol_flag=false;
	boolean isDataAvailable = false;

	List listData = new LinkedList();
	int measuresCount = 0;
	if(finalEndUserDatas!=null && finalEndUserDatas.size()>0)
	{
		//if(!showKeyUser)
		{
			infoResHash = (Hashtable)finalEndUserDatas.get("users");
			dataResHash = (Hashtable)finalEndUserDatas.get("usersDetails");
		}
	}

	if(orderByColumnName!=null && orderByColumnName.trim().length()>0 && !orderByColumnName.equalsIgnoreCase("null"))
	{
		tmp_priority="ALL";
		orderByCol_flag=true;
	}
	else if(isUDSortByAllValue || isAdtnlSearch || isEndUserOverview)
		tmp_priority="ALL";

	String keyUserUED = ini.getValue("END_USER_DASHBOARD_SETTINGS","HighUserProfileExpDashboard");
	keyUserUED = (keyUserUED==null || keyUserUED.trim().length()==0)?"":keyUserUED;
	boolean isKeyUserUED = false;
	if(keyUserUED!=null && keyUserUED.trim().length()>0 && (keyUserUED.equalsIgnoreCase("true") || keyUserUED.equalsIgnoreCase("yes")))
	{
		isKeyUserUED = true;
	}

	boolean isShowUniqueUserCountInUI = false;
	String showUniqueUserCountInUI=ini.getValue("END_USER_DASHBOARD_SETTINGS","ShowUniqueUserCountInUI");
	showUniqueUserCountInUI=(showUniqueUserCountInUI==null || showUniqueUserCountInUI.trim().length()==0)?"false":showUniqueUserCountInUI;
	if(showUniqueUserCountInUI != null && showUniqueUserCountInUI.trim().length() > 0 && (showUniqueUserCountInUI.equalsIgnoreCase("true") || showUniqueUserCountInUI.equalsIgnoreCase("yes")))
		isShowUniqueUserCountInUI = true;

	boolean liveDataFromVirtualApps = false;
	String strliveDataFromVirtualApps=ini.getValue("END_USER_DASHBOARD_SETTINGS","LiveDataFromVirtualApps");
	strliveDataFromVirtualApps=(strliveDataFromVirtualApps==null || strliveDataFromVirtualApps.trim().length()==0)?"false":strliveDataFromVirtualApps;
	if(strliveDataFromVirtualApps != null && strliveDataFromVirtualApps.trim().length() > 0 && (strliveDataFromVirtualApps.equalsIgnoreCase("true") || strliveDataFromVirtualApps.equalsIgnoreCase("yes")))
		liveDataFromVirtualApps = true;

	String groupByStr = ini.getValue("LOC_USER_DESKTOP_METRICS",userType+":GroupBy");
	ArrayList groupByList = new ArrayList();
	if(groupByStr!=null && groupByStr.trim().length()>0)
		groupByList = StringUtils.egTokenizer(groupByStr,",",false,true,true);		//param 3-->includeEmpty,4-->unique,5-->trim
	String filterFlag = request.getParameter("filterFlag");
	ArrayList filterInfo = null;
	Hashtable filterInfoHash = null;

	String compDispName = request.getParameter("compDispName");
	compDispName = (compDispName!= null && compDispName.trim().length()>0 && compDispName.equalsIgnoreCase("components"))?"Component(s)":compDispName;
	String showComFilterVal = request.getParameter("showComFilter");
	boolean showComFilter = (showComFilterVal!=null && showComFilterVal.trim().length()>0 && showComFilterVal.equals("true"))?true:false;
	String detail = request.getParameter("detail");
	if(detail != null && detail.equals("ComponentType"))
		detail = "componentType";
	String compCombo = request.getParameter("compCombo");
	//detail = (detail!=null && detail.trim().length()>0 && detail.equalsIgnoreCase("componentType"))?"Component":detail;
	String filterBy = "";
	String searchFilter = "";
	String nextSearch = "";
	String nextSubSearch = "";
	String filterlabel1 = "", filterlabel2 = "", filterlabel3 = "";
	String priorityFilter = request.getParameter("priorityFilter");
	String gatewayFilter = request.getParameter("gatewayFilter");
	priorityFilter = (priorityFilter==null || priorityFilter.trim().length()==0||priorityFilter.equalsIgnoreCase("NULL"))?"":priorityFilter;
	gatewayFilter = (gatewayFilter==null || gatewayFilter.trim().length()==0||gatewayFilter.equalsIgnoreCase("NULL"))?"":gatewayFilter;
	String searchFilDispTxt = request.getParameter("searchFilDispTxt");
	String nextSearchFilDispTxt = request.getParameter("nextSearchFilDispTxt");
	filterBy = request.getParameter("filterBy");
	String filterByDisplay=filterBy;
	searchFilter = request.getParameter("searchFilter");
	searchFilter = (searchFilter==null || searchFilter.trim().length()==0 || searchFilter.equalsIgnoreCase("NULL"))?"":searchFilter;
	if(searchFilter != null && searchFilter.trim().length() > 0)
		searchFilter = searchFilter.trim();
	nextSearch = request.getParameter("nextSearch");
	nextSearch = (nextSearch==null || nextSearch.trim().length()==0 || nextSearch.equalsIgnoreCase("NULL"))?"":nextSearch;
	if(nextSearch != null && nextSearch.trim().length() > 0)
		nextSearch = nextSearch.trim();
	nextSubSearch = request.getParameter("nextSubSearch");
	nextSubSearch = (nextSubSearch==null || nextSubSearch.trim().length()==0 || nextSubSearch.equalsIgnoreCase("NULL"))?"":nextSubSearch;
	if(nextSubSearch != null && nextSubSearch.trim().length() > 0)
		nextSubSearch = nextSubSearch.trim();
	Hashtable statesList = null;

	JSONObject fil_json = new JSONObject();
	JSONObject json  = new JSONObject();
	if(filterFlag != null && filterFlag.equalsIgnoreCase("true"))
	{
		filterInfo = new ArrayList();
		filterInfoHash =  new Hashtable();

		Hashtable InfoSession = (Hashtable)session.getAttribute(userType+"InfoSession");
		Hashtable InfoFilterSession = (Hashtable)session.getAttribute(userType+"InfoFilterSession");
		Hashtable geoLocMapInfos = (Hashtable)session.getAttribute(userType+"geoLocMapInfos");

		filterInfoHash.put("detail",detail);
		filterInfoHash.put("compCombo",compCombo);
		
		fil_json.put("detail",detail);
		fil_json.put("compCombo",compCombo);
		fil_json.put("filterBy",filterBy);

		json.put("fil_json",fil_json);
		if(detail != null && (detail.equalsIgnoreCase("componentType") || detail.equalsIgnoreCase("Component")))
		{
			if(filterBy !=null && filterBy.equalsIgnoreCase("Virtual_Machine"))
			{
				ArrayList allNickForVms = new ArrayList();
				ArrayList allNickForVmComp = new ArrayList();
				List temp_listComps = user.getOnlyVMServers();
				if(temp_listComps!=null && temp_listComps.size()>0)
				{
					for(int l=0;l<temp_listComps.size();l++)
					{
						String compDetails = (String)temp_listComps.get(l);
						allNickForVmComp.add(compDetails);
						/*String u_comp_type = "";
						String u_comp_name = "";
						if(compDetails!=null && compDetails.indexOf(":")>-1)
						{
							u_comp_type = compDetails.substring(0,compDetails.indexOf(":"));
							u_comp_name = compDetails.substring(compDetails.indexOf(":")+1);

							String u_vm_comp=u_comp_name+":"+u_comp_type;
							ArrayList vmsForHostList=(ArrayList)user.getHostVMList(u_vm_comp);
							if(vmsForHostList!=null && vmsForHostList.size()>0)
								allNickForVms.addAll(vmsForHostList);
						}*/
					}

					filterInfoHash.put("allNickForVMComp",allNickForVmComp);
					//filterInfoHash.put("allNickForVMList",allNickForVms);
				}

				filterByDisplay = mappingInfo.getComponentTypeDescription(filterByDisplay);
			}
			else if(filterBy !=null && !filterBy.equalsIgnoreCase("All"))
			{
				ArrayList allNickForComp = new ArrayList();
				List temp_listComps = user.getServers(false);
				for(int l=0;l<temp_listComps.size();l++)
				{
					String compDetails = (String)temp_listComps.get(l);
					if(compDetails.indexOf(filterBy) != -1)
						allNickForComp.add(compDetails);
				}
				filterInfoHash.put("allNickForComp",allNickForComp);

				filterByDisplay = mappingInfo.getComponentTypeDescription(filterByDisplay);
			}
		}

		if(defaultFilter != null && defaultFilter.trim().length() > 0)
			filterlabel1 = defaultFilter;
		if(subFilterList != null && subFilterList.size() > 0){
			if(subFilterList.size() == 1){
				filterlabel2 = (String)subFilterList.get(0);
			}
			else if(subFilterList.size() > 1){
				filterlabel2 = (String)subFilterList.get(0);
				filterlabel3 = (String)subFilterList.get(1);
			}
		}
		else if(!isDetailsFromADOnly && InfoSession != null && InfoSession.size() > 0 && InfoSession.containsKey("Filters")){
			Set filset = (HashSet)InfoSession.get("Filters");
			ArrayList list1 = new ArrayList(filset);
			if(list1 != null && list1.size() > 0){
				if(filterlabel1 == null || filterlabel1.trim().length() == 0)
					filterlabel1 = (String)list1.get(0);

				if(list1.size() == 2){
					filterlabel2 = (String)list1.get(1);
				}
				else if(list1.size() > 2){
					filterlabel2 = (String)list1.get(1);
					filterlabel3 = (String)list1.get(2);
				}
			}
		}
		
		filterInfoHash.put("filterBy",filterBy);
		filterInfoHash.put("searchFilter",searchFilter);
		filterInfoHash.put("nextSearch",nextSearch);
		if(isFromGeo && nextSearch!=null && nextSearch.trim().length()==0)
			filterInfoHash.put("nextSearch","All");
		if(nextSubSearch!=null && nextSubSearch.trim().length()>0)
			filterInfoHash.put("nextSubSearch",nextSubSearch);
		if(isFromGeo && nextSubSearch!=null && nextSubSearch.trim().length()==0)
			filterInfoHash.put("nextSubSearch","All");
		filterInfoHash.put("priorityFilter",priorityFilter);
		filterInfoHash.put("gatewayFilter",gatewayFilter);
		if(InfoSession == null)
			InfoSession = new Hashtable();
		filterInfoHash.put("InfoSession",InfoSession);
		if(InfoFilterSession == null)
			InfoFilterSession = new Hashtable();
		filterInfoHash.put("InfoFilterSession",InfoFilterSession);
		if(geoLocMapInfos == null)
			geoLocMapInfos = new Hashtable();
		filterInfoHash.put("geoLocMapInfos",geoLocMapInfos);

		List temp_listZone = user.getZones();
		ArrayList notZoneList = new ArrayList();
		if(temp_listZone != null && temp_listZone.size() > 0){
			for(int l=0;l<temp_listZone.size();l++){
				String zone1 = (String) temp_listZone.get(l);
				List temp_zoneComps = groupInfo.getAllComponentsUnderZone(zone1,true);
				if(temp_zoneComps != null && temp_zoneComps.size() > 0){
					for(int p=0;p<temp_zoneComps.size();p++){
						String compType = (String)temp_zoneComps.get(p);
						notZoneList.add(compType);
					}
				}
			}
		}
		
		filterInfoHash.put("notZoneList",notZoneList);

		if(isFromVCDS!=null && (isFromVCDS.equalsIgnoreCase("true") || isFromVCDS.equalsIgnoreCase("yes")))
		{
			if(vmsHash!=null)
				filterInfoHash.put("isFromVCDSHash",(Hashtable)vmsHash);
		}
	}
	else if(isFromVCDS!=null && (isFromVCDS.equalsIgnoreCase("true") || isFromVCDS.equalsIgnoreCase("yes")))
	{
		filterInfoHash =  new Hashtable();
		if(vmsHash!=null)
			filterInfoHash.put("isFromVCDSHash",(Hashtable)vmsHash);
	}

	String isfromctx = request.getParameter("fromctx");
	boolean isFromctx = false;
	if(isfromctx != null && isfromctx.equalsIgnoreCase("true"))
		isFromctx =true;
	String host_comp_type="";
	if(isFromctx)
	{
		infoResHash = new Hashtable();
		dataResHash = new Hashtable();
		if(filterInfoHash == null)
			filterInfoHash = new Hashtable();

		filterInfoHash.put("isFromHost","true");
	}

	if(searchFrom!=null && !searchFrom.equals("") && searchFrom.equalsIgnoreCase("InsideEndUserDashboard"))
	{
		String searchStringData = request.getParameter("searchStringData");
		desktopUserName = searchStringData;
		searchString = searchStringData;
		if(infoResHash!=null && infoResHash.size()>0)
		{
			finalDesktopVmsHash = (Hashtable)vmDashHelper.getAllUsersDesktopsForUED(searchString,tmp_priority,userType,vdiType,pageNo,infoResHash,searchFrom,aduserFilter,filterInfoHash);
		}
		else
		{
			finalDesktopVmsHash = (Hashtable)vmDashHelper.getVmDesktopsForTheComponentForGenericEUD(searchStringData,tmp_priority,userType,vdiType,pageNo,searchFrom,aduserFilter,filterInfoHash);
		}
	}
	else
	{
		if(isEndUserOverview || isFromUEDSort)
		{
			finalDesktopVmsHash = (Hashtable)vmDashHelper.getVmDesktopsForTheComponentForGenericEUD(null,tmp_priority,userType,vdiType,pageNo,aduserFilter,filterInfoHash);
		}
		else if(infoResHash!=null && infoResHash.size()>0)
		{
			finalDesktopVmsHash = (Hashtable)vmDashHelper.getAllUsersDesktopsForUED(searchString,tmp_priority,userType,vdiType,pageNo,infoResHash,null,aduserFilter,filterInfoHash);
		}
		else
		{
			finalDesktopVmsHash = (Hashtable)vmDashHelper.getVmDesktopsForTheComponentForGenericEUD(searchString,tmp_priority,userType,vdiType,pageNo,aduserFilter,filterInfoHash);
		}
	}

	String adFilter = "";
	ArrayList adFilterKeys = new ArrayList();
	Hashtable userRelatedAd = new Hashtable();
	boolean isGetLiveData=false;
	Integer uniqueUserCount=new Integer(0);
	Hashtable keyStateCountHash = new Hashtable();

	int high_int=0;
	int inter_int=0;
	int low_int=0;
	int unknown_int=0;
	int good_int=0;

	if(finalDesktopVmsHash!=null && finalDesktopVmsHash.size()>0)
	{
		vdiDesktopsList = (EgList)finalDesktopVmsHash.get("EgList");
		vdiDesktopsListTotalCount = (Integer)finalDesktopVmsHash.get("EgListCount");

		uniqueUserCount = (Integer)finalDesktopVmsHash.get("UniqueUserCount");
		
		if((userType.equals("OverviewAppXenApp7") || userType.equals("OverviewAppVDI")) && show_app_overview!=null && (show_app_overview.equalsIgnoreCase("true") || show_app_overview.equalsIgnoreCase("yes")))
		{
			vdiDesktopsList = (EgList)finalDesktopVmsHash.get("OverviewEgList");
			vdiDesktopsListTotalCount = (Integer)finalDesktopVmsHash.get("OverviewEgListCount");
		}

		if(showKeyUser && isKeyUserUED)
		{
			vdiDesktopsList = (EgList)finalDesktopVmsHash.get("KeyEgList");
			vdiDesktopsListTotalCount = (Integer)finalDesktopVmsHash.get("KeyEgListCount");
			keyStateCountHash = (Hashtable)finalDesktopVmsHash.get("KeyEgStateCount");
			if(keyStateCountHash!=null)
			{
				high_int = ((Integer)keyStateCountHash.get("HIGH")).intValue();
				inter_int = ((Integer)keyStateCountHash.get("INTER")).intValue();
				low_int = ((Integer)keyStateCountHash.get("LOW")).intValue();
				unknown_int = ((Integer)keyStateCountHash.get("UNKNOWN")).intValue();
				good_int = ((Integer)keyStateCountHash.get("GOOD")).intValue();
			}
		}

		statesList = (Hashtable)finalDesktopVmsHash.get("statesList");
		infosCompHash = (Hashtable)finalDesktopVmsHash.get("INFOS_COMP");
		Hashtable tmp_CTHash = (Hashtable)finalDesktopVmsHash.get("TYPE_COMP_INFO");
		//typeCompInfoHash = tmp_CTHash;

		if(liveDataFromVirtualApps && isFromGeo && usercountval != null && usercountval.trim().length() > 0 && !usercountval.equalsIgnoreCase("null"))
		{
			try
			{
				userTotalCount = Integer.parseInt(usercountval);
			}
			catch(Exception ee)
			{
				usercountval = null;
			}
			//if(vdiDesktopsListTotalCount!=userTotalCount && geoInfo!=null && geoInfo.equalsIgnoreCase("All") && userTotalCount!=0)
			if(vdiDesktopsListTotalCount!=userTotalCount && userTotalCount!=0)
			{
				finalDesktopVmsHash=new Hashtable();
				if(isEndUserOverview||isFromUEDSort)
				{
					finalDesktopVmsHash = (Hashtable)vmDashHelper.getVmDesktopsForTheComponentForGenericEUD(null,tmp_priority,userType,vdiType,pageNo,aduserFilter,filterInfoHash);
				}
				else
				{
					finalDesktopVmsHash = (Hashtable)vmDashHelper.getVmDesktopsForTheComponentForGenericEUD(searchString,tmp_priority,userType,vdiType,pageNo,aduserFilter,filterInfoHash);
				}

				if(finalDesktopVmsHash!=null && finalDesktopVmsHash.size()>0)
				{
					isGetLiveData=true;
					vdiDesktopsList = (EgList)finalDesktopVmsHash.get("EgList");
					vdiDesktopsListTotalCount = (Integer)finalDesktopVmsHash.get("EgListCount");

					uniqueUserCount = (Integer)finalDesktopVmsHash.get("UniqueUserCount");

					if((userType.equals("OverviewAppXenApp7") || userType.equals("OverviewAppVDI")) && show_app_overview!=null && (show_app_overview.equalsIgnoreCase("true") || show_app_overview.equalsIgnoreCase("yes")))
					{
						vdiDesktopsList = (EgList)finalDesktopVmsHash.get("OverviewEgList");
						vdiDesktopsListTotalCount = (Integer)finalDesktopVmsHash.get("OverviewEgListCount");
					}

					infosCompHash = (Hashtable)finalDesktopVmsHash.get("INFOS_COMP");
					tmp_CTHash = (Hashtable)finalDesktopVmsHash.get("TYPE_COMP_INFO");
					//typeCompInfoHash = tmp_CTHash;

					try
					{
						if(isFromGeo && usercountval != null && usercountval.trim().length() > 0 && !usercountval.equalsIgnoreCase("null"))
						{
							//userTotalCount = Integer.parseInt(usercountval);
							userTotalCount = vdiDesktopsListTotalCount;
						}
					}
					catch(Exception ee)
					{
						usercountval = null;
					}

					if(userType!=null && (userType.equalsIgnoreCase("AppXenApp7") || userType.equalsIgnoreCase("AppDDXenApp7") || userType.equalsIgnoreCase("AppVDI") || userType.equalsIgnoreCase("AppDDVDI") || userType.equalsIgnoreCase("AppLaunchDDXenApp7") || userType.equals("OverviewAppXenApp7") || userType.equals("OverviewAppVDI")))
					{
						userTotalCount = vdiDesktopsListTotalCount;
					}
					else
					{
						if(isFromGeo && usercountval != null && usercountval.trim().length() > 0 && !usercountval.equalsIgnoreCase("null"))
						{
							//userTotalCount = Integer.parseInt(usercountval);
							userTotalCount = vdiDesktopsListTotalCount;
						}
						else
						{
							if(isRetrieveFDB)
							{
								//userTotalCount=vdiDesktopsListTotalCount;
								infolist1 = (ArrayList)finalDesktopVmsHash.get("TMPINFOS");
								if((tmp_priority!=null && (!tmp_priority.equals("ALL"))) || (priorityFilter!=null && !priorityFilter.equalsIgnoreCase("All")) || (gatewayFilter!=null && !gatewayFilter.equalsIgnoreCase("All")))
									userTotalCount=vdiDesktopsListTotalCount;
								else if(infolist1!=null && infolist1.size()>0)
									userTotalCount=infolist1.size();
								else
									userTotalCount=vdiDesktopsListTotalCount;
							}
							else
							{
								infolist = (ArrayList)finalDesktopVmsHash.get("INFOS");
								if((tmp_priority!=null && (!tmp_priority.equals("ALL"))) || (priorityFilter!=null && !priorityFilter.equalsIgnoreCase("All")) || (gatewayFilter!=null && !gatewayFilter.equalsIgnoreCase("All")))
									userTotalCount=vdiDesktopsListTotalCount;
								else if(infolist!=null && infolist.size()>0)
									userTotalCount=infolist.size();
							}
						}
					}
				}
			}
			//else if(vdiDesktopsListTotalCount!=userTotalCount && geoInfo!=null && !geoInfo.equalsIgnoreCase("All"))
			//{
				//if(isFromGeo && usercountval != null && usercountval.trim().length() > 0 && !usercountval.equalsIgnoreCase("null"))
					//userTotalCount = vdiDesktopsListTotalCount;

			//}
		}
		else
		{
			if(isRetrieveFDB)
			{
				//userTotalCount=vdiDesktopsListTotalCount;
				infolist1 = (ArrayList)finalDesktopVmsHash.get("TMPINFOS");
				if((tmp_priority!=null && (!tmp_priority.equals("ALL"))) || (priorityFilter!=null && !priorityFilter.equalsIgnoreCase("All")) || (gatewayFilter!=null && !gatewayFilter.equalsIgnoreCase("All")))
					userTotalCount=vdiDesktopsListTotalCount;
				else if(infolist1!=null && infolist1.size()>0)
					userTotalCount=infolist1.size();
				else
					userTotalCount=vdiDesktopsListTotalCount;
			}
			else
			{
				infolist = (ArrayList)finalDesktopVmsHash.get("INFOS");
				if((tmp_priority!=null && (!tmp_priority.equals("ALL"))) || (priorityFilter!=null && !priorityFilter.equalsIgnoreCase("All")) || (gatewayFilter!=null && !gatewayFilter.equalsIgnoreCase("All")))
					userTotalCount=vdiDesktopsListTotalCount;
				else if(infolist!=null && infolist.size()>0)
					userTotalCount=infolist.size();
			}
		}

		if(isShowUniqueUserCountInUI && uniqueUserCount!=null && uniqueUserCount>0)
			userTotalCount = uniqueUserCount;

		infolist = (ArrayList)finalDesktopVmsHash.get("INFOS");
		dbinfolist = (ArrayList)finalDesktopVmsHash.get("DBINFOS");

		resTypeList = (List)finalDesktopVmsHash.get("CTYPE");
		//componentTypeList = resTypeList;
		/*resCnameList = (List)finalDesktopVmsHash.get("CNAME");
		resCompsList = (List)finalDesktopVmsHash.get("COMPS");
		resNickList = (List)finalDesktopVmsHash.get("NICKS");
		resPortList = (List)finalDesktopVmsHash.get("PORTS");*/

		fullInfoHash = (Hashtable)finalDesktopVmsHash.get("FULLINFOS");
		maxUser = (String)finalDesktopVmsHash.get("MAX_USER");
		//user_count_hash = (Hashtable)finalDesktopVmsHash.get("MAX_USER_HASH");

		if(finalDesktopVmsHash.containsKey("adFilter"))
			adFilter = (String)finalDesktopVmsHash.get("adFilter");
		if(finalDesktopVmsHash.containsKey("adFilterKeys"))
			adFilterKeys = (ArrayList)finalDesktopVmsHash.get("adFilterKeys");
		if(finalDesktopVmsHash.containsKey("userRelatedAd"))
			userRelatedAd = (Hashtable)finalDesktopVmsHash.get("userRelatedAd");
		if(finalDesktopVmsHash.containsKey("groupByUserKeys"))
		groupByUserKeys = (ArrayList)finalDesktopVmsHash.get("groupByUserKeys");
		if(groupByUserKeys==null||groupByUserKeys.size()==0)
			isEndUserOverview = false;
	}
	
	String inner_header="";
	String header_display="";
	String header_display_icon="";
	String is_Header_DispName=ini.getValue("END_USER_DASHBOARD_SETTINGS","ShowUserCountInUI");
	String skipDesktopsForUserType = ini.getValue("END_USER_DASHBOARD_SETTINGS","SkipDesktopsFor"+userType);
	boolean check_Header_DispName = false;
	if(is_Header_DispName!=null && (is_Header_DispName.equalsIgnoreCase("true") || is_Header_DispName.equalsIgnoreCase("yes")))
	{
		check_Header_DispName=true;
		if(!isEndUserOverview && vdiDesktopsListTotalCount>0)
		{
			if(showKeyUser && isKeyUserUED)
			{
				if(userType!=null && (userType.equalsIgnoreCase("VDI") || userType.equalsIgnoreCase("VDIESX")))
				{
					String countHeader = (skipDesktopsForUserType!=null && skipDesktopsForUserType.equalsIgnoreCase("true"))?"Unique Users":"Unique Users/Desktops";

					if(userType.equalsIgnoreCase("VDIESX"))
					{
						countHeader = "Total Users/VMs";
						header_display=mappingInfo.getTextDescription("monitor.endUserDashboard.Users/Desktops Overview for Datastore")+" '"+showDSInfo+"' - ("+countHeader+": "+vdiDesktopsListTotalCount+")";
					}
					else
						header_display=mappingInfo.getTextDescription("monitor.endUserDashboard.User Experience Overview for High Profile "+userType+" Users ("+countHeader+": "+vdiDesktopsListTotalCount+")");
				}
				else
				{
					String countHeader = (isFromGeo && (selectedMeasure!=null && selectedMeasure.trim().length()>0 && selectedMeasure.equalsIgnoreCase("UniqueSessionCount")))?"Sessions":"Unique Users";

					String text_UserType=userType;
					header_display=mappingInfo.getTextDescription("monitor.endUserDashboard.User Experience Overview for High Profile "+text_UserType+" Users ("+countHeader+": "+vdiDesktopsListTotalCount+")");
				}
			}
			else
			{
				//header_display=mappingInfo.getTextDescription("monitor.endUserDashboard.User Experience Overview for "+userType+" (Total users: "+vdiDesktopsListTotalCount+")");
				if(userType!=null && userType.equalsIgnoreCase("ESX"))
				{
					header_display=mappingInfo.getTextDescription("monitor.endUserDashboard.Performance Metrics for VMs (Total VMs : "+vdiDesktopsListTotalCount+")");
				}
				else if(userType!=null && userType.equalsIgnoreCase("VCDataStore"))
					header_display=mappingInfo.getTextDescription("monitor.endUserDashboard.VC - Datastores View")+" (Total Datastores :"+vdiDesktopsListTotalCount+")";
				else if(userType!=null && (userType.equalsIgnoreCase("VDI") || userType.equalsIgnoreCase("VDIESX")))
				{
					String countHeader = (skipDesktopsForUserType!=null && skipDesktopsForUserType.equalsIgnoreCase("true"))?"Unique Users":"Unique Users/Desktops";
					if(userType.equalsIgnoreCase("VDIESX"))
					{
						countHeader = "Total Users/VMs";
						header_display=mappingInfo.getTextDescription("monitor.endUserDashboard.Users/Desktops Overview for Datastore")+" '"+showDSInfo+"' - ("+countHeader+": "+vdiDesktopsListTotalCount+")";
					}
					else
						header_display=mappingInfo.getTextDescription("monitor.endUserDashboard.User Experience Overview for "+userType+" ("+countHeader+": "+vdiDesktopsListTotalCount+")");
				}
				else if(userType.equalsIgnoreCase("AppVDI") || userType.equalsIgnoreCase("AppDDVDI") || userType.equals("OverviewAppVDI"))
				{
					String countHeader = (skipDesktopsForUserType!=null && skipDesktopsForUserType.equalsIgnoreCase("true"))?"Unique Users":"Unique Users/Desktops";

					if(userType.equals("OverviewAppVDI"))
					{
						header_display=mappingInfo.getTextDescription("monitor.endUserDashboard.Applications Statistics for VDI"+" ("+countHeader+": "+vdiDesktopsListTotalCount+")");
					}
					else if(userType.equals("AppVDI") && overviewType!=null && overviewType.equals("OverviewAppVDI") && searchString!=null && searchString.trim().length()>0)
					{
						header_display=mappingInfo.getTextDescription("monitor.endUserDashboard.Users using '"+searchString+"' Application for VDI");
					}
					else
						header_display=mappingInfo.getTextDescription("monitor.endUserDashboard.Applications Overview for VDI"+" ("+countHeader+": "+vdiDesktopsListTotalCount+")");
				}
				else
				{
					String countHeader = (isFromGeo && (selectedMeasure!=null && selectedMeasure.trim().length()>0 && selectedMeasure.equalsIgnoreCase("UniqueSessionCount")))?"Sessions":"Unique Users";

					String text_UserType=userType;
					if(userType!=null && (userType.equals("AppXenApp7") || userType.equals("AppDDXenApp7") || userType.equals("AppLaunchDDXenApp7") || userType.equals("OverviewAppXenApp7")))
					{
						countHeader="Unique Applications";
						text_UserType = "XenApp7";

						if(userType.equals("OverviewAppXenApp7"))
						{
							header_display=mappingInfo.getTextDescription("monitor.endUserDashboard.Applications Statistics for "+text_UserType+" ("+countHeader+": "+userTotalCount+")");
						}
						else if(userType.equals("AppXenApp7") && overviewType!=null && overviewType.equals("OverviewAppXenApp7") && searchString!=null && searchString.trim().length()>0)
						{
							header_display=mappingInfo.getTextDescription("monitor.endUserDashboard.Users using '"+searchString.replace(".","&#46")+"' Application for "+text_UserType);
						}
						else
						{
							header_display=mappingInfo.getTextDescription("monitor.endUserDashboard.Applications Overview for "+text_UserType+" ("+countHeader+": "+vdiDesktopsListTotalCount+")");
						}
					}
					else
					{
						header_display=mappingInfo.getTextDescription("monitor.endUserDashboard.User Experience Overview for "+text_UserType+" ("+countHeader+": "+vdiDesktopsListTotalCount+")");
					}
				}
			}
			//jsonRoot.put("header_display",header_display);
			//jsonRoot.put("isShowLocColumn",isShowUserLocation);
		}
		else if(isEndUserOverview)
		{
			header_display=mappingInfo.getTextDescription("monitor.endUserDashboard.Citrix User Experience By Location for")+" "+userType;
			//jsonRoot.put("header_display",header_display);
		}
	}
	else
	{
		if(!isEndUserOverview)
		{
			if(showKeyUser && isKeyUserUED)
			{
				header_display=mappingInfo.getTextDescription("monitor.endUserDashboard.User Experience Overview for High Profile "+userType+" Users");
			}
			else
			{
				if(userType!=null && userType.equalsIgnoreCase("ESX"))
				{
					header_display=mappingInfo.getTextDescription("monitor.endUserDashboard.Performance Metrics for VMs ");
				}
				else if(userType!=null && userType.equalsIgnoreCase("VCDataStore"))
					header_display=mappingInfo.getTextDescription("monitor.endUserDashboard.VC - Datastores View");
				else if(userType.equalsIgnoreCase("VDIESX"))
				{
					header_display=mappingInfo.getTextDescription("monitor.endUserDashboard.Users/Desktops Overview for Datastore")+" '"+showDSInfo+"'";
				}
				else if(userType!=null && (userType.equals("AppXenApp7") || userType.equals("AppDDXenApp7") || userType.equals("AppLaunchDDXenApp7") || userType.equals("OverviewAppXenApp7")))
				{
					if(userType.equals("OverviewAppXenApp7"))
						header_display=mappingInfo.getTextDescription("monitor.endUserDashboard.Applications Statistics for XenApp7");
					else if(userType.equals("AppXenApp7") && overviewType!=null && overviewType.equals("OverviewAppXenApp7") && searchString!=null && searchString.trim().length()>0)
					{
						header_display=mappingInfo.getTextDescription("monitor.endUserDashboard.Users using '"+searchString.replace(".","&#46")+"' Application for XenApp7");
					}
					else
						header_display=mappingInfo.getTextDescription("monitor.endUserDashboard.Applications Overview for XenApp7");
				}
				else if(userType!=null && (userType.equalsIgnoreCase("AppVDI") || userType.equalsIgnoreCase("AppDDVDI") || userType.equals("OverviewAppVDI")))
				{
					if(userType.equals("OverviewAppVDI"))
						header_display=mappingInfo.getTextDescription("monitor.endUserDashboard.Applications Statistics for VDI");
					else if(userType.equals("AppVDI") && overviewType!=null && overviewType.equals("OverviewAppVDI") && searchString!=null && searchString.trim().length()>0)
					{
						header_display=mappingInfo.getTextDescription("monitor.endUserDashboard.Users using '"+searchString+"' Application for VDI");
					}
					else
						header_display=mappingInfo.getTextDescription("monitor.endUserDashboard.Applications Overview for VDI");
				}
				else
				{
					header_display=mappingInfo.getTextDescription("monitor.endUserDashboard.User Experience Overview for "+userType);
				}
			}
			//jsonRoot.put("header_display",header_display);
			//jsonRoot.put("isShowLocColumn",isShowUserLocation);
		}
		else if(isEndUserOverview)
		{
			header_display=mappingInfo.getTextDescription("monitor.endUserDashboard.Citrix User Experience By Location for")+" "+userType;
			//jsonRoot.put("header_display",header_display);
		}
	}

	if(vdiType != null && vdiType.indexOf(":") != -1)
		host_comp_type = vdiType.substring(0,vdiType.indexOf(":"));

	Hashtable TotalMeasureInfo = new Hashtable();
	//session.removeAttribute(userType+"InfoSession");
	//session.removeAttribute(userType+"InfoFilterSession");
	JSONArray fil = new JSONArray();
	if(searchFrom==null || searchFrom.trim().length()==0)
	{
		if((!isGetLiveData) && dataResHash!=null && dataResHash.size()>0 && ((vdiDesktopsList!=null && vdiDesktopsList.size()>0 && vdiDesktopsListTotalCount>0)||(groupByUserKeys!=null && groupByUserKeys.size()>0)))
		{
			TotalMeasureInfo=(Hashtable)dataResHash.clone();
		}
		else if((vdiDesktopsList!=null && vdiDesktopsList.size()>0 && vdiDesktopsListTotalCount>0)||(groupByUserKeys!=null && groupByUserKeys.size()>0))
		{
			String temp_user_type = userType;
			if(isFromctx)
			{
				if(finalDesktopVmsHash == null)
					finalDesktopVmsHash = new Hashtable();

				temp_user_type = temp_user_type+":"+host_comp_type;
				finalDesktopVmsHash.put("isFromHost","true");
			}
			else if(isFromGeo)
				finalDesktopVmsHash.put("isFromGeo","true");
			//TotalMeasureInfo = vmDashHelper.getAllDesktopVmsMeasureDataForGenericEUD(finalDesktopVmsHash,userType);
			//TotalMeasureInfo = vmDashHelper.getAllDesktopVmsMeasureDataForGenericEUD(finalDesktopVmsHash,userType,userName);
			TotalMeasureInfo = vmDashHelper.getAllDesktopVmsMeasureDataForGenericEUD(finalDesktopVmsHash,temp_user_type,userName);
		}
		
		if(TotalMeasureInfo != null && TotalMeasureInfo.containsKey("InfoSession") && TotalMeasureInfo.containsKey("InfoFilterSession"))
		{
			Hashtable geoMapInfo = (Hashtable)TotalMeasureInfo.get("InfoSession");
			Hashtable InfoFilterSession = (Hashtable)TotalMeasureInfo.get("InfoFilterSession");
			Hashtable geoLocMapInfos = (Hashtable)TotalMeasureInfo.get("geoLocMapInfos");

			TotalMeasureInfo.remove("InfoSession");
			TotalMeasureInfo.remove("InfoFilterSession");
			TotalMeasureInfo.remove("geoLocMapInfos");

			if(geoMapInfo != null && geoMapInfo.size() > 0)
			{
				Iterator it = geoMapInfo.entrySet().iterator();
				while(it.hasNext()){
					Entry en = (Entry)it.next();
					Set set = (HashSet)en.getValue();
					ArrayList list = new ArrayList(set);
					if(list != null && list.size() > 0)
						fil.add((String)en.getKey());
				}
				session.setAttribute(userType+"InfoSession",geoMapInfo);
				session.setAttribute(userType+"tmpInfoSession",geoMapInfo);
				session.setAttribute(userType+"geoLocMapInfos",geoLocMapInfos);
				//session.setAttribute("statesList",statesList);
			}
			if(InfoFilterSession != null && InfoFilterSession.size() > 0)
				session.setAttribute(userType+"InfoFilterSession",InfoFilterSession);
		}
		if(statesList!=null && statesList.size()>0)
			session.setAttribute("statesList",statesList);
		if(TotalMeasureInfo!=null && TotalMeasureInfo.containsKey("finalGroupByUserTab"))
			finalGroupByUserTab = (Hashtable) TotalMeasureInfo.get("finalGroupByUserTab");

		if(tmpOrderByColumnName!=null && tmpOrderByColumnName.trim().length()>0 && !tmpOrderByColumnName.equalsIgnoreCase("null") && !tmpOrderByColumnName.equalsIgnoreCase("default"))
		{
			if(col_Type!=null && col_Type.trim().length()>0 && (!col_Type.equalsIgnoreCase("NULL")))
			{
				if(isFromUEDSort)
					groupByUserKeys = (ArrayList)vmDashHelper.getSortedListForUEDOverview(groupByUserKeys,TotalMeasureInfo,"enduseroverview",tmpOrderByColumnName,orderBy,col_Type);
				else
					vdiDesktopsList=vmDashHelper.getSortedList(vdiDesktopsList,TotalMeasureInfo,"virtual",tmpOrderByColumnName,orderBy,col_Type);
			}
			else
			{
				if(tmpOrderByColumnName.equalsIgnoreCase("HOST"))
				{
					columnDispName="Host";
					vdiDesktopsList=vmDashHelper.getSortedList(vdiDesktopsList,tmpOrderByColumnName,null,orderBy);
				}
				else
					vdiDesktopsList=vmDashHelper.getSortedList(vdiDesktopsList,TotalMeasureInfo,"virtual",tmpOrderByColumnName,orderBy);
			}
			if(priority!=null && !priority.equalsIgnoreCase("ALL"))
				vdiDesktopsList = vmDashHelper.getSubList(vdiDesktopsList,priority,pageNo);
		}
		else if(isUDSortByAllValue)
		{
			vdiDesktopsList=vmDashHelper.getAllMeasureValueBasedSortedList(vdiDesktopsList,TotalMeasureInfo,userType,strMValueOrder);
			if(priority!=null && !priority.equalsIgnoreCase("ALL"))
				vdiDesktopsList = vmDashHelper.getSubList(vdiDesktopsList,priority,pageNo);
		}
	}
	if(groupByUserKeys!=null && groupByUserKeys.size()>0)
		groupByUserCount = groupByUserKeys.size();
	if(isAdtnlSearch)
	{
		boolean isOnlyStartsWithCheck = false;
		String startsWithCheck=ini.getValue("Additional_Search","EnableStartsWithSearch");
		if(startsWithCheck != null && startsWithCheck.trim().length()>0 && startsWithCheck.equalsIgnoreCase("true"))
			isOnlyStartsWithCheck = true;
		vdiDesktopsList = (EgList)vmDashHelper.getAdditionalSearchVdiDesktopsList(vdiDesktopsList,TotalMeasureInfo,adtnlSearchStr,adtnlSearchColumns,isOnlyStartsWithCheck);
		if(vdiDesktopsList!=null && vdiDesktopsList.size()>0)
			userTotalCount = vdiDesktopsList.size();
	}
	if(isDetailsFromADOnly)
	{
		if(searchFilter!=null && searchFilter.trim().length()>0 && !searchFilter.equalsIgnoreCase("All") && nextSearch!=null && nextSearch.trim().length()>0 && !nextSearch.equalsIgnoreCase("All"))
		{
			vdiDesktopsList = (EgList)vmDashHelper.getFilteredVdiDesktopsListWithLocation(vdiDesktopsList,TotalMeasureInfo,nextSearch,searchFilter);
			/*if(vdiDesktopsList!=null && vdiDesktopsList.size()>0)
			{
				if(isShowUniqueUserCountInUI)
				{
					ArrayList uniquUserList =(ArrayList) getUniqueUserList(vdiDesktopsList);
					if(uniquUserList!=null)
						userTotalCount = uniquUserList.size();
				}
				else
					userTotalCount = vdiDesktopsList.size();
			}
			if(priority!=null && !priority.equalsIgnoreCase("ALL"))
				vdiDesktopsList = vmDashHelper.getSubList(vdiDesktopsList,priority,pageNo);*/
		}
	}
	String searchByText = "";
	if(userType!=null && userType.equalsIgnoreCase("VDI"))
		searchByText = mappingInfo.getTextDescription("monitor.VirtualDashboard.Users/Desktops");
	else if(userType!=null && userType.equalsIgnoreCase("ESX"))
		searchByText = mappingInfo.getTextDescription("monitor.VirtualDashboard.VMs");
	else if(userType!=null && userType.equalsIgnoreCase("AppXenApp7") || userType.equalsIgnoreCase("AppDDXenApp7") || userType.equals("OverviewAppXenApp7") || userType.equals("OverviewAppVDI"))
			searchByText = mappingInfo.getTextDescription("monitor.VirtualDashboard.Applications");
	else
		searchByText = mappingInfo.getTextDescription("monitor.VirtualDashboard.Users");

	if(TotalMeasureInfo!=null && TotalMeasureInfo.size()>0)
	{
		buf.append("<link rel='stylesheet' type='text/css' href='/final/styles/eGLightThemeIcons.css' />");
		buf.append("<link rel='stylesheet' type='text/css' href='eg_styles/printPageStyles.css' />");

		//buf.append("<style>@media print {body {-webkit-print-color-adjust: exact;}}");
		////buf.append("@font-face{font-family:'LucidaGrandeRegular';src:url('/final/fonts/6216/6216.woff') format('woff')}");
		////buf.append("@font-face{font-family:'LucidaGrandeBold';src:url('/final/fonts/6215/6215.woff') format('woff')}");
		////buf.append("body{font-family:'LucidaGrandeRegular';font-size:11px;line-height:1.5em;color:#2a292a;}");
		////buf.append("header{font-family:'LucidaGrandeRegular';font-size:15px;}");
		//buf.append(".formLabel {font-family:'LucidaGrandeRegular';font-size:12px;line-height:14px;}");
		//buf.append(".formValue {font-family:'LucidaGrandeBold';font-size:12px;line-height:14px;} b{font-family:'LucidaGrandeBold';font-size:11px;}");
		////buf.append("table tr td{font-family:'LucidaGrandeRegular';font-size:11px;padding:4px;}");
		//buf.append(".printTable{border: 1px solid #c3c3c3; border-collapse:collapse;word-break:break-all;}");
		//buf.append(".printTableHeader{font-family:'LucidaGrandeBold';border: 1px solid #c3c3c3;text-align:center;background-color:#cdcdcd;padding:4px;}");
		//buf.append(".printTable tr td{border: 1px solid #c3c3c3;}");
		//buf.append(".printTable tbody tr td{border: 1px solid #c3c3c3;}");
		//buf.append(".printTable tbody tr td table tr td{border: 0px solid #c3c3c3 !important;}");
		//buf.append(".printTable div{word-break:break-all;	}");
		//buf.append(".printTable thead{font-family:'LucidaGrandeBold';border: 1px solid #c3c3c3;text-align:center;background-color:#cdcdcd;padding:4px;}");
		//buf.append(".printTableHeader2{font-family:'LucidaGrandeBold';border: 1px solid #c3c3c3;text-align:center;background-color:#dcdcdc;padding:4px;}</style>");
		
		IniUI img1=IniUI.getInstance();
		String logo=img1.getMonitorHomeLogo();
		if(img1.isHKTThemeEnabled())
		{
			logo = img1.getHKTReporterLogo();
		}

		if((!isEndUserOverview) && adFilter != null && aduserFilter != null)
		{
			//String mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.User Experience Dashboard for "+userType);
			String mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.User Experience Overview for "+userType);

			if(showKeyUser && isKeyUserUED)
			{
				mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.User Experience Overview for High Profile "+userType+" Users");
			}
			
			/*if(userType!=null && userType.equals("ESX"))
			{
				mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.Performance Metrics for VMs");
			}*/

			//String countHeader = (userType.equals("XenApp7") || userType.equals("XenApp"))?"Unique Users":"Unique Users/Desktops";
			if(check_Header_DispName && userTotalCount>0)
			{
				if(showKeyUser && isKeyUserUED)
				{
					if(userType!=null && userType.equalsIgnoreCase("VDI"))
					{
						String countHeader = (skipDesktopsForUserType!=null && skipDesktopsForUserType.equalsIgnoreCase("true"))?"Unique Users":"Unique Users/Desktops";
						mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.User Experience Overview for High Profile "+userType+" Users ("+countHeader+": "+userTotalCount+")");
					}
					else if(userType!=null && (userType.equalsIgnoreCase("XenApp") || userType.equalsIgnoreCase("XenApp7")))
					{
						String countHeader = (isFromGeo && (selectedMeasure!=null && selectedMeasure.trim().length()>0 && selectedMeasure.equalsIgnoreCase("UniqueSessionCount")))?"Sessions":"Unique Users";
						mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.User Experience Overview for High Profile "+userType+" Users ("+countHeader+": "+userTotalCount+")");
					}
					else
					{
						mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.User Experience Overview for High Profile "+userType+" Users (Total users: "+userTotalCount+")");
					}
				}
				else
				{
					if(userType!=null && userType.equalsIgnoreCase("ESX"))
					{
						mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.Performance Metrics for VMs (Total VMs : "+userTotalCount+")");
					}
					else if(userType!=null && userType.equalsIgnoreCase("VCDataStore"))
					{
						mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.VC - Datastores View (Total Datastores : "+userTotalCount+")");
					}
					else if(userType.equalsIgnoreCase("VDIESX"))
					{
						mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.Users/Desktops Overview for Datastore")+" '"+showDSInfo+"' - (Total Users/VMs : "+userTotalCount+")";
					}
					else if(userType!=null && userType.equalsIgnoreCase("VDI"))
					{
						String countHeader = (skipDesktopsForUserType!=null && skipDesktopsForUserType.equalsIgnoreCase("true"))?"Unique Users":"Unique Users/Desktops";
						mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.User Experience Overview for "+userType+" ("+countHeader+": "+userTotalCount+")");
					}
					else if(userType!=null && (userType.equals("AppXenApp7") || userType.equals("AppDDXenApp7") || userType.equals("AppLaunchDDXenApp7") || userType.equals("OverviewAppXenApp7")))
					{
						String countHeader="Unique Applications";
						String text_UserType = "XenApp7";

						if(userType.equals("OverviewAppXenApp7"))
						{
							mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.Applications Statistics for "+text_UserType+" ("+countHeader+": "+userTotalCount+")");
						}
						else if(userType.equals("AppXenApp7") && overviewType!=null && overviewType.equals("OverviewAppXenApp7") && searchString!=null && searchString.trim().length()>0)
						{
							mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.Users using '"+searchString.replace(".","&#46")+"' Application for "+text_UserType);
						}
						else
						{
							mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.Applications Overview for "+text_UserType+" ("+countHeader+": "+userTotalCount+")");
						}
					}
					else if(userType!=null && (userType.equals("AppVDI") || userType.equals("AppDDVDI") || userType.equals("OverviewAppVDI"))){
						String countHeader="Unique Applications";
						String text_UserType = "VDI";

						if(userType.equals("OverviewAppVDI"))
						{
							mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.Applications Statistics for "+text_UserType+" ("+countHeader+": "+userTotalCount+")");
						}
						else if(userType.equals("AppVDI") && overviewType!=null && overviewType.equals("OverviewAppVDI") && searchString!=null && searchString.trim().length()>0)
						{
							mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.Users using '"+searchString+"' Application for "+text_UserType);
						}
						else
							mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.Applications Overview for "+text_UserType+" ("+countHeader+": "+userTotalCount+")");
					}
					else if(userType!=null && (userType.equalsIgnoreCase("XenApp") || userType.equalsIgnoreCase("XenApp7")))
					{
						String countHeader = (isFromGeo && (selectedMeasure!=null && selectedMeasure.trim().length()>0 && selectedMeasure.equalsIgnoreCase("UniqueSessionCount")))?"Sessions":"Unique Users";
						mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.User Experience Overview for "+userType+" ("+countHeader+": "+userTotalCount+")");
					}
					else
					{
						mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.User Experience Overview for "+userType+" (Total users: "+userTotalCount+")");
					}
				}
			}
			else if(check_Header_DispName && vdiDesktopsListTotalCount>0)
			{
				/*mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.User Experience Overview for "+userType+" ("+countHeader+" : "+vdiDesktopsListTotalCount+")");
				if(userType!=null && userType.equals("ESX"))
				{
					mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.Performance Metrics for VMs (Total VMs : "+vdiDesktopsListTotalCount+")");
				}*/
				if(showKeyUser && isKeyUserUED)
				{
					if(userType!=null && userType.equalsIgnoreCase("VDI"))
					{
						String countHeader = (skipDesktopsForUserType!=null && skipDesktopsForUserType.equalsIgnoreCase("true"))?"Unique Users":"Unique Users/Desktops";
						mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.User Experience Overview for High Profile "+userType+" Users ("+countHeader+": "+vdiDesktopsListTotalCount+")");
					}
					else if(userType!=null && (userType.equalsIgnoreCase("XenApp") || userType.equalsIgnoreCase("XenApp7")))
					{
						String countHeader = (isFromGeo && (selectedMeasure!=null && selectedMeasure.trim().length()>0 && selectedMeasure.equalsIgnoreCase("UniqueSessionCount")))?"Sessions":"Unique Users";
						mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.User Experience Overview for High Profile "+userType+" Users ("+countHeader+": "+vdiDesktopsListTotalCount+")");
					}
					else
					{
						mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.User Experience Overview for High Profile "+userType+" Users (Total users: "+vdiDesktopsListTotalCount+")");
					}
				}
				else
				{
					if(userType!=null && userType.equalsIgnoreCase("ESX"))
					{
						mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.Performance Metrics for VMs (Total VMs : "+vdiDesktopsListTotalCount+")");
					}
					else if(userType!=null && userType.equalsIgnoreCase("VCDataStore"))
					{
						mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.VC - Datastores View (Total Datastores : "+vdiDesktopsListTotalCount+")");
					}
					else if(userType.equalsIgnoreCase("VDIESX"))
					{
						mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.Users/Desktops Overview for Datastore")+" '"+showDSInfo+"' - (Total Users/VMs : "+vdiDesktopsListTotalCount+")";
					}
					else if(userType!=null && userType.equalsIgnoreCase("VDI"))
					{
						String countHeader = (skipDesktopsForUserType!=null && skipDesktopsForUserType.equalsIgnoreCase("true"))?"Unique Users":"Unique Users/Desktops";
						mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.User Experience Overview for "+userType+" ("+countHeader+": "+vdiDesktopsListTotalCount+")");
					}
					else if(userType!=null && (userType.equals("AppXenApp7") || userType.equals("AppDDXenApp7") || userType.equals("AppLaunchDDXenApp7") || userType.equals("OverviewAppXenApp7")))
					{
						String countHeader="Unique Applications";
						String text_UserType = "XenApp7";
						if(userType.equals("OverviewAppXenApp7"))
						{
							mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.Applications Statistics for "+text_UserType+" ("+countHeader+": "+vdiDesktopsListTotalCount+")");
						}
						else if(userType.equals("AppXenApp7") && overviewType!=null && overviewType.equals("OverviewAppXenApp7") && searchString!=null && searchString.trim().length()>0)
						{
							mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.Users using '"+searchString.replace(".","&#46")+"' Application for "+text_UserType);
						}
						else
						{
							mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.Applications Overview for "+text_UserType+" ("+countHeader+": "+vdiDesktopsListTotalCount+")");
						}
					}else if(userType!=null && (userType.equals("AppVDI") || userType.equals("AppDDVDI") || userType.equals("OverviewAppVDI"))){
						String countHeader="Unique Applications";
						String text_UserType = "VDI";

						if(userType.equals("OverviewAppVDI"))
						{
							mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.Applications Statistics for "+text_UserType+" ("+countHeader+": "+vdiDesktopsListTotalCount+")");
						}
						else if(userType.equals("AppVDI") && overviewType!=null && overviewType.equals("OverviewAppVDI") && searchString!=null && searchString.trim().length()>0)
						{
							mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.Users using '"+searchString+"' Application for "+text_UserType);
						}
						else
						{
							mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.Applications Overview for "+text_UserType+" ("+countHeader+": "+vdiDesktopsListTotalCount+")");
						}
					}
					else if(userType!=null && (userType.equalsIgnoreCase("XenApp") || userType.equalsIgnoreCase("XenApp7")))
					{
						String countHeader = (isFromGeo && (selectedMeasure!=null && selectedMeasure.trim().length()>0 && selectedMeasure.equalsIgnoreCase("UniqueSessionCount")))?"Sessions":"Unique Users";
						mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.User Experience Overview for "+userType+" ("+countHeader+": "+vdiDesktopsListTotalCount+")");
					}
					else
					{
						mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.User Experience Overview for "+userType+" (Total users: "+vdiDesktopsListTotalCount+")");
					}
				}
			}
			else
			{
				if(showKeyUser && isKeyUserUED)
				{
					mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.User Experience Overview for High Profile"+userType+" Users");
				}
				else
				{
					if(userType!=null && userType.equalsIgnoreCase("ESX"))
					{
						mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.Performance Metrics for VMs (Total VMs : "+vdiDesktopsListTotalCount+")");
					}
					else if(userType!=null && userType.equalsIgnoreCase("VCDataStore"))
					{
						mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.VC - Datastores View (Total Datastores : "+vdiDesktopsListTotalCount+")");
					}
					else if(userType.equalsIgnoreCase("VDIESX"))
					{
						mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.Users/Desktops Overview for Datastore")+" '"+showDSInfo+"' - (Total Users/VMs : "+vdiDesktopsListTotalCount+")";
					}
					else if(userType!=null && (userType.equals("AppXenApp7") || userType.equals("AppDDXenApp7") || userType.equals("AppLaunchDDXenApp7") || userType.equals("OverviewAppXenApp7")))
					{
						String countHeader="Unique Applications";
						String text_UserType = "XenApp7";
						if(userType.equals("OverviewAppXenApp7"))
						{
							mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.Applications Statistics for "+text_UserType+" ("+countHeader+": "+vdiDesktopsListTotalCount+")");
						}
						else if(userType.equals("AppXenApp7") && overviewType!=null && overviewType.equals("OverviewAppXenApp7") && searchString!=null && searchString.trim().length()>0)
						{
							mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.Users using '"+searchString.replace(".","&#46")+"' Application for "+text_UserType);
						}
						else
						{
							mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.Applications Overview for "+text_UserType+" ("+countHeader+": "+vdiDesktopsListTotalCount+")");
						}
					}
					else if(userType!=null && (userType.equals("AppVDI") || userType.equals("AppDDVDI") || userType.equals("OverviewAppVDI"))){
						String countHeader="Unique Applications";
						String text_UserType = "VDI";

						if(userType.equals("OverviewAppVDI"))
						{
							mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.Applications Statistics for "+text_UserType+" ("+countHeader+": "+vdiDesktopsListTotalCount+")");
						}
						else if(userType.equals("AppVDI") && overviewType!=null && overviewType.equals("OverviewAppVDI") && searchString!=null && searchString.trim().length()>0)
						{
							mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.Users using '"+searchString+"' Application for "+text_UserType);
						}
						else
						{
							mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.Applications Overview for "+text_UserType+" ("+countHeader+": "+vdiDesktopsListTotalCount+")");
						}
					}
					else 
					{
						mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.User Experience Overview for "+userType);
					}
				}
			}
			listData.add(mainTitle);
			
			/*//listData.add(mappingInfo.getTextDescription("monitor.endUserDashboard.User Experience Dashboard for "+userType));
			if(check_Header_DispName && vdiDesktopsListTotalCount>0)
			{
				if(userType!=null && userType.equals("ESX"))
				{
					listData.add(mappingInfo.getTextDescription("monitor.endUserDashboard.Performance Metrics for VMs (Total VMs : "+vdiDesktopsListTotalCount+")"));
				}
				else
				{
					listData.add(mappingInfo.getTextDescription("monitor.endUserDashboard.User Experience Overview for "+userType+" ("+countHeader+" : "+vdiDesktopsListTotalCount+")"));
				}
			}
			else
			{
				if(userType!=null && userType.equals("ESX"))
				{
					listData.add(mappingInfo.getTextDescription("monitor.endUserDashboard.Performance Metrics for VMs"));
				}
				else
				{
					listData.add(mappingInfo.getTextDescription("monitor.endUserDashboard.User Experience Overview for "+userType));
				}
			}*/
			listData.add("");
			//buf.append("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" style=\"table-layout:fixed;\"><tr><td>");
			buf.append("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" style=\"table-layout:fixed;width:100%;\">");
			buf.append("<tr><td width=\"100%\" align=\"center\" height=\"100%\" valign=\"top\">");
			if(logo!=null && logo.trim().length()>0)
			{
				buf.append("<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\" align=\"center\">");
				buf.append("<tr><td style=\"padding:5px 10px 10px 10px\">");
				buf.append("<img src="+logo+" border=\"0\" /></td></tr></table>");
			}
			buf.append("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\"  style=\"border-bottom:1px solid #999;\">");
			buf.append("<tr><td style=\"padding:2px\"><div style=\"float:left\" ><header>"+mainTitle+"</header></div></td></tr></table>");
			buf.append("</td></tr></table>");
			
			buf.append("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"left\" >");
			
			if(searchString!=null && !searchString.equalsIgnoreCase("NULL") && searchString.trim().length()>0)
			{
				String key = mappingInfo.getTextDescription("monitor.endUserDashboard.Search By ");
				buf.append("<tr><td width=\"100%\">");
				buf.append("<span style=\"float:left\" class=\"formLabel\">"+key+" ("+searchByText+") "+"</span> ");
				buf.append("<span style=\"float:left;width:10px\" align=\"center\" >:</span> ");
				buf.append("<span style=\"float:left;\" class=\"formValue\">"+searchString+"</span></td></tr>");

				listData.add(key+" ("+searchByText+") "+"="+searchString);
			}
			if(adtnlSearchStr!=null && !adtnlSearchStr.equalsIgnoreCase("NULL") && adtnlSearchStr.trim().length()>0)
			{
				String key = mappingInfo.getTextDescription("monitor.endUserDashboard.Additional Search By ");
				buf.append("<tr><td width=\"100%\">");
				buf.append("<span style=\"float:left\" class=\"formLabel\">"+key+" ("+adtnlSearchText+")"+"</span> ");
				buf.append("<span style=\"float:left;width:10px\" align=\"center\" >:</span> ");
				buf.append("<span style=\"float:left;\" class=\"formValue\">"+adtnlSearchStr+"</span></td></tr>");

				listData.add(key+" ("+adtnlSearchText+")"+"="+adtnlSearchStr);
			}

			String currOrderByColumnName = request.getParameter("currOrderByColumn");
			String currOrderByName = request.getParameter("currOrderBy");
			if(currOrderByColumnName!=null && !currOrderByColumnName.equalsIgnoreCase("NULL") && currOrderByColumnName.trim().length()>0 && !currOrderByColumnName.equalsIgnoreCase("default"))
			{
				if(columnDispName!=null && columnDispName.trim().length()>0)
				{
					String orderByColText = mappingInfo.getTextDescription("monitor.endUserDashboard.Sort By");
					buf.append("<tr><td><span style=\"float:left\" class=\"formLabel\">"+orderByColText+"</span> ");
					buf.append("<span style=\"float:left;width:10px\" align=\"center\" >:</span> ");
					buf.append("<span style=\"float:left;\" class=\"formValue\">"+columnDispName+"</span></td>");

					listData.add(orderByColText+"="+columnDispName);
					if(currOrderByName!=null && !currOrderByName.equalsIgnoreCase("NULL") && currOrderByName.trim().length()>0)
					{
						String orderByText = mappingInfo.getTextDescription("monitor.endUserDashboard.Order By");
						if(currOrderByName!=null && currOrderByName.trim().length()>0 && currOrderByName.equalsIgnoreCase("desc"))
						{
							currOrderByName = mappingInfo.getTextDescription("monitor.endUserDashboard.Descending");
						}
						else if(currOrderByName!=null && currOrderByName.trim().length()>0 && currOrderByName.equalsIgnoreCase("asc"))
						{
							currOrderByName = mappingInfo.getTextDescription("monitor.endUserDashboard.Ascending");
						}
						buf.append("<td><span style=\"float:left\" class=\"formLabel\">"+orderByText+"</span> ");
						buf.append("<span style=\"float:left;width:10px\" align=\"center\" >:</span> ");
						buf.append("<span style=\"float:left;\" class=\"formValue\">"+currOrderByName+"</span></td>");
						listData.add(orderByText+"="+currOrderByName);
					}
					buf.append("</tr>");
				}
				else
				{
					String sortByDispCol = ini.getValue("USER_DESKTOP_METRICS",userType);
					ArrayList sortByDispColList =  new ArrayList();
					if(sortByDispCol!=null && sortByDispCol.trim().length()>0)
					{
						sortByDispColList = com.egurkha.util.StringUtils.egTokenizer(sortByDispCol,",",false,false,true);//param 3-->includeEmpty,4-->unique,5-->trim
					}
					if(sortByDispColList!=null && sortByDispColList.size()>0)
					{
						String sortByColDispName = "";
						for(int s = 0;s<sortByDispColList.size();s++)
						{
							String colName = (String)sortByDispColList.get(s);
							String tmpTest = colName.substring(0,colName.indexOf(":"));
							String tmpMeasure = "";
							tmpMeasure = colName.substring(colName.indexOf(":")+1);
							if(tmpMeasure!=null && tmpMeasure.trim().length()>0 && tmpMeasure.indexOf(":")>-1)
								tmpMeasure=tmpMeasure.substring(0,tmpMeasure.indexOf(":"));
							String tmpOrderByColName = Dbdata.getColumnForMeasure(tmpTest,tmpMeasure);
							if(tmpOrderByColName!=null && tmpOrderByColName.trim().length()>0 && tmpOrderByColName.equals(currOrderByColumnName))
								sortByColDispName = colName.substring(colName.lastIndexOf(":")+1);
						}
						if(sortByColDispName!=null && !sortByColDispName.equalsIgnoreCase("NULL") && sortByColDispName.trim().length()>0)
						{
							String orderByColText = mappingInfo.getTextDescription("monitor.endUserDashboard.Sort By");
							buf.append("<tr><td><span style=\"float:left\" class=\"formLabel\">"+orderByColText+"</span> ");
							buf.append("<span style=\"float:left;width:10px\" align=\"center\" >:</span> ");
							buf.append("<span style=\"float:left;\" class=\"formValue\">"+sortByColDispName+"</span></td>");

							listData.add(orderByColText+"="+sortByColDispName);

							if(currOrderByName!=null && !currOrderByName.equalsIgnoreCase("NULL") && currOrderByName.trim().length()>0)
							{
								String orderByText = mappingInfo.getTextDescription("monitor.endUserDashboard.Order By");
								if(currOrderByName!=null && currOrderByName.trim().length()>0 && currOrderByName.equalsIgnoreCase("desc"))
								{
									currOrderByName = mappingInfo.getTextDescription("monitor.endUserDashboard.Descending");
								}
								else if(currOrderByName!=null && currOrderByName.trim().length()>0 && currOrderByName.equalsIgnoreCase("asc"))
								{
									currOrderByName = mappingInfo.getTextDescription("monitor.endUserDashboard.Ascending");
								}
								buf.append("<td><span style=\"float:left\" class=\"formLabel\">"+orderByText+"</span> ");
								buf.append("<span style=\"float:left;width:10px\" align=\"center\" >:</span> ");
								buf.append("<span style=\"float:left;\" class=\"formValue\">"+currOrderByName+"</span></td>");

								listData.add(orderByText+"="+currOrderByName);
							}
							buf.append("</tr>");
						}
					}
				}
			}
			
			boolean checkOnlyVmCase1 = false;
			if(user.isOnlyVMAssigned() && compDispName != null && compDispName.trim().length()>0 && compDispName.indexOf("Component") > -1)
				checkOnlyVmCase1 = true;

			if((filterBy != null && filterBy.trim().length() > 0) || (searchFilter != null && searchFilter.trim().length() > 0) || (nextSearch != null && nextSearch.trim().length() > 0 && !nextSearch.trim().equals("-1"))){
				buf.append("<tr>");
				if(!checkOnlyVmCase1 && filterBy != null && filterBy.trim().length() > 0 && !filterBy.equalsIgnoreCase("NULL")){
					String zoneName = mappingInfo.getTextDescription("monitor.endUserDashboard.Zone");
					if(compDispName != null && compDispName.trim().length()>0 && !compDispName.equalsIgnoreCase("NULL"))
						zoneName = compDispName;
					else if(detail!=null && detail.trim().length()>0 && !detail.equalsIgnoreCase("NULL"))
						zoneName = detail;
					buf.append("<td><span style=\"float:left\" class=\"formLabel\">"+zoneName+"</span> ");
					buf.append("<span style=\"float:left;width:10px\" align=\"center\" >:</span> ");
					if(detail!=null && detail.trim().length()>0 && detail.equalsIgnoreCase("componentType"))
						detail = "Component";
					if (detail!=null && detail.trim().length()>0 && detail.equalsIgnoreCase("Component"))
					{
						String compNameDisp = "";
						if(compCombo!=null && compCombo.trim().length()>0)
						{
							ArrayList compComboList = StringUtils.egTokenizer(compCombo,",",true,false,true);//param 3-->includeEmpty,4-->unique,5-->trim
							for(int b=0;b<compComboList.size();b++)
							{
								String multiComp = (String)compComboList.get(b);
								if(multiComp.indexOf(":")!=-1)
									multiComp = multiComp.substring(compCombo.indexOf(":")+1);
								if(multiComp!=null && multiComp.endsWith(":NULL"))
									multiComp = multiComp.substring(0,multiComp.indexOf(":NULL"));
								if(b>0)
									compNameDisp = compNameDisp +","+multiComp;
								else
									compNameDisp = multiComp;
							}
							if(compNameDisp.endsWith(","))
								compNameDisp = compNameDisp.substring(0,compNameDisp.indexOf(","));
						}
						//buf.append("<span style=\"float:left;\" class=\"formValue\">"+mappingInfo.getComponentTypeDescription(filterBy)+" - "+compNameDisp+"</span></td>");
						if(compNameDisp != null && compNameDisp.trim().length()>0)
						{	
							if(showComFilter){
								buf.append("<span style=\"float:left;\" class=\"formValue\">"+compNameDisp+"</span></td>");
								listData.add(zoneName+"="+compNameDisp);
							}else{
								buf.append("<span style=\"float:left;\" class=\"formValue\">"+mappingInfo.getComponentTypeDescription(filterBy)+" - "+compNameDisp+"</span></td>");
								listData.add(zoneName+"="+mappingInfo.getComponentTypeDescription(filterBy)+" - "+compNameDisp);
							}
						}
						else
						{
							if(showComFilter && compCombo!=null && compCombo.equals("All"))
								filterBy="All";
							buf.append("<span style=\"float:left;\" class=\"formValue\">"+mappingInfo.getComponentTypeDescription(filterBy)+"</span></td>");
							listData.add(zoneName+"="+mappingInfo.getComponentTypeDescription(filterBy));
						}
					}
					else
					{
						buf.append("<span style=\"float:left;\" class=\"formValue\">"+filterBy+"</span></td>");
						listData.add(zoneName+"="+filterBy);
					}
				}

				if(searchFilter != null && searchFilter.trim().length() > 0){
					String filterByStr = mappingInfo.getTextDescription("monitor.endUserDashboard.Filter By");
					if(!isDetailsFromADOnly)
						filterByStr = filterlabel1;
				
						

					if((isShowUserLocation) && searchFilter != null && searchFilter.trim().length() > 0 && !searchFilter.equalsIgnoreCase("NULL")){
						buf.append(getLabel(filterByStr,searchFilter));
						//buf.append("<td><span style=\"float:left\" class=\"formLabel\">"+filterByStr+"</span> ");
						//buf.append("<span style=\"float:left;width:10px\" align=\"center\" >:</span> ");
						//buf.append("<span style=\"float:left;\" class=\"formValue\">"+searchFilter+"</span></td>");
						listData.add(filterByStr+"="+searchFilter);
					}
				}

				if(nextSearch != null && nextSearch.trim().length() > 0 && !nextSearch.trim().equals("-1") && !nextSearch.equalsIgnoreCase("null")){
					/*String filterByLoc = "";
					if(isDetailsFromADOnly)
						filterByLoc = mappingInfo.getTextDescription("monitor.endUserDashboard."+searchFilter);
					else
						filterByLoc = filterlabel2;*/
					
					String searchFilterStr = mappingInfo.getTextDescription("monitor.endUserDashboard."+searchFilter);
					
					if(!isDetailsFromADOnly)
						searchFilterStr = filterlabel2;
						
					if((isShowUserLocation) && nextSearch != null && nextSearch.trim().length() > 0 && !nextSearch.trim().equals("-1") && !nextSearch.equalsIgnoreCase("NULL")){
						buf.append(getLabel(searchFilterStr,nextSearch));
						//buf.append("<td><span style=\"float:left\" class=\"formLabel\">"+searchFilterStr+"</span> ");
						//buf.append("<span style=\"float:left;width:10px\" align=\"left\" >:</span> ");
						//buf.append("<span style=\"float:left;\" class=\"formValue\">"+nextSearch+"</span></td>");

						listData.add(searchFilterStr+"="+nextSearch);
					}
				}

				if(nextSubSearch != null && nextSubSearch.trim().length() > 0 && !nextSubSearch.trim().equals("-1") && !nextSubSearch.equalsIgnoreCase("null") && filterlabel3 != null && filterlabel3.trim().length() > 0){
					String filterByLoc = "";
					if(isDetailsFromADOnly)
						filterByLoc = mappingInfo.getTextDescription("monitor.endUserDashboard."+nextSearch);
					else
						filterByLoc = filterlabel3;
					buf.append(getLabel(filterByLoc,nextSubSearch));
					//buf.append("<td><span style=\"float:left\" class=\"formLabel\">"+filterByLoc+"</span> ");
					//buf.append("<span style=\"float:left;width:10px\" align=\"left\" >:</span> ");
					//buf.append("<span style=\"float:left;\" class=\"formValue\">"+nextSubSearch+"</span></td>");

					listData.add(filterByLoc+"="+nextSubSearch);
				}
				buf.append("</tr>");
			}

			if(aduserFilter != null ){
				String adName = mappingInfo.getTextDescription("monitor.endUserDashboard.AD Group");
				buf.append("<tr>"+getLabel(adName,aduserFilter)+"</tr>");
				//buf.append("<tr><td><span style=\"float:left\" class=\"formLabel\">"+adName+"</span> ");
				//buf.append("<span style=\"float:left;width:10px\" align=\"center\" >:</span> ");
				//buf.append("<span style=\"float:left;\" class=\"formValue\">"+aduserFilter+"</span></td></tr>");

				listData.add(adName+"="+aduserFilter);
			}
			if(priorityFilter != null && priorityFilter.trim().length()>0 && !priorityFilter.equalsIgnoreCase("NULL")){
				String filterByLoc = mappingInfo.getTextDescription("monitor.endUserDashboard.Priority");
				buf.append("<tr>"+getLabel(filterByLoc,mappingInfo.getLabelDescription(priorityFilter))+"</tr>");
				//buf.append("<tr><td><span style=\"float:left\" class=\"formLabel\">"+filterByLoc+"</span> ");
				//buf.append("<span style=\"float:left;width:10px\" align=\"center\" >:</span> ");
				//buf.append("<span style=\"float:left;\" class=\"formValue\">"+mappingInfo.getLabelDescription(priorityFilter)+"</span></td></tr>");

				listData.add(filterByLoc+"="+mappingInfo.getLabelDescription(priorityFilter));
			}
			if(gatewayFilter != null && gatewayFilter.trim().length()>0 && !gatewayFilter.equalsIgnoreCase("NULL") && !userType.equals("OverviewAppVDI") && !userType.equals("AppVDI") && !userType.equals("AppDDVDI") && !userType.equals("AppXenApp7") && !userType.equals("OverviewAppXenApp7") && !userType.equals("AppDDXenApp7") && !userType.equals("AppLaunchDDXenApp7"))
			{
				String filterByLoc = mappingInfo.getTextDescription("monitor.endUserDashboard.Gateway");
				buf.append("<tr>"+getLabel(filterByLoc,mappingInfo.getLabelDescription(gatewayFilter))+"</tr>");
				//buf.append("<tr><td><span style=\"float:left\" class=\"formLabel\">"+filterByLoc+"</span> ");
				//buf.append("<span style=\"float:left;width:10px\" align=\"center\" >:</span> ");
				//buf.append("<span style=\"float:left;\" class=\"formValue\">"+mappingInfo.getLabelDescription(gatewayFilter)+"</span></td></tr>");

				listData.add(filterByLoc+"="+mappingInfo.getLabelDescription(gatewayFilter));
			}
			buf.append("</table>");
			//buf.append("</td></tr>");
			//buf.append("<tr><td>");
			listData.add("");
			listData.add("");
			Vector headerVect = new Vector();
			buf.append("<table  border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\"  height=\"auto\"><tr>");
					buf.append("<td width=\"100%\" valign=\"top\" height=\"100%\"><div>");
							buf.append("<table class=\"printTable\" width=\"100%\" border=\"0\"  style=\"width:100%;table-layout:auto !important\"  cellspacing=\"0\" cellpadding=\"0\"  valign=\"top\" >");
								buf.append("<thead><tr>");
									/*if(!orderByCol_flag)
									{
										if(userType!=null && userType.equalsIgnoreCase("VDI"))
											buf.append("<th class=\"printTableHeader\" align=\"center\" wrap >"+mappingInfo.getTextDescription("monitor.VirtualDashboard.Users/Desktops")+"</th>");
										else if(userType!=null && userType.equalsIgnoreCase("ESX"))
											buf.append("<th class=\"printTableHeader\" align=\"center\" wrap >"+mappingInfo.getTextDescription("monitor.VirtualDashboard.VMs")+"</th>");
										else if(userType!=null && (userType.equalsIgnoreCase("AppXenApp7") || userType.equalsIgnoreCase("AppDDXenApp7") || userType.equals("AppLaunchDDXenApp7") || userType.equals("OverviewAppXenApp7")))
											buf.append("<th class=\"printTableHeader\" align=\"center\" wrap >"+mappingInfo.getTextDescription("monitor.VirtualDashboard.Applications")+"</th>");
										else if(userType!=null && (userType.equalsIgnoreCase("AppVDI") || userType.equalsIgnoreCase("AppDDVDI") || userType.equals("OverviewAppVDI")))
											buf.append("<th class=\"printTableHeader\" align=\"center\" wrap >"+mappingInfo.getTextDescription("monitor.VirtualDashboard.Applications")+"</th>");
										else
											buf.append("<th class=\"printTableHeader\" align=\"center\" wrap >"+mappingInfo.getTextDescription("monitor.VirtualDashboard.Users")+"</th>");

										//buf.append("<td class=\"printTableHeader\" align=\"center\" wrap >"+mappingInfo.getTextDescription("monitor.VirtualDashboard.Users/Desktops")+"</td>");
									}
									else
									{*/
										//buf.append("<td class=\"printTableHeader\" align=\"center\"  wrap >"+mappingInfo.getTextDescription("monitor.VirtualDashboard.Users/Desktops")+ "</td>");
										if(userType!=null && userType.equalsIgnoreCase("VDI"))
											buf.append("<th class=\"printTableHeader\" align=\"center\"  wrap >"+mappingInfo.getTextDescription("monitor.VirtualDashboard.Users/Desktops")+ "</th>");
										else if(userType!=null && userType.equalsIgnoreCase("ESX"))
											buf.append("<th class=\"printTableHeader\" align=\"center\"  wrap >"+mappingInfo.getTextDescription("monitor.VirtualDashboard.VMs")+ "</th>");
										else if(userType!=null && (userType.equalsIgnoreCase("AppXenApp7") || userType.equalsIgnoreCase("AppDDXenApp7") || userType.equals("AppLaunchDDXenApp7") || userType.equals("OverviewAppXenApp7")))
											buf.append("<th class=\"printTableHeader\" align=\"center\"  wrap >"+mappingInfo.getTextDescription("monitor.VirtualDashboard.Applications")+ "</th>");
										else if(userType!=null && (userType.equalsIgnoreCase("AppVDI") || userType.equalsIgnoreCase("AppDDVDI") || userType.equals("OverviewAppVDI")))
											buf.append("<th class=\"printTableHeader\" align=\"center\"  wrap >"+mappingInfo.getTextDescription("monitor.VirtualDashboard.Applications")+ "</th>");
										else
											buf.append("<th class=\"printTableHeader\" align=\"center\"  wrap >"+mappingInfo.getTextDescription("monitor.VirtualDashboard.Users")+ "</th>");
									//}
									headerVect.add("");
									headerVect.add("Priority");
									if(userType!=null && userType.equalsIgnoreCase("VDI"))
										headerVect.add(mappingInfo.getTextDescription("monitor.VirtualDashboard.Users/Desktops"));
									else if(userType!=null && userType.equalsIgnoreCase("ESX"))
										headerVect.add(mappingInfo.getTextDescription("monitor.VirtualDashboard.VMs"));
									else if(userType!=null && (userType.equalsIgnoreCase("AppXenApp7") || userType.equalsIgnoreCase("AppDDXenApp7") || userType.equals("AppLaunchDDXenApp7") || userType.equals("OverviewAppXenApp7")))
										headerVect.add(mappingInfo.getTextDescription("monitor.VirtualDashboard.Applications"));
									else if(userType!=null && (userType.equalsIgnoreCase("AppVDI") || userType.equalsIgnoreCase("AppDDVDI") || userType.equals("OverviewAppVDI")))
										headerVect.add(mappingInfo.getTextDescription("monitor.VirtualDashboard.Applications"));
									else
										headerVect.add(mappingInfo.getTextDescription("monitor.VirtualDashboard.Users"));
									

									if(!isOnlyVMAssigned && !userType.equals("OverviewAppXenApp7") && !userType.equals("OverviewAppVDI"))
									{
										if(orderByColumnName!=null && orderByColumnName.equalsIgnoreCase("Host"))
										{
											buf.append("<th class=\"printTableHeader\" align=\"center\"  wrap >"+mappingInfo.getTextDescription("monitor.VirtualDashboard.Host")+"</th>");
										}
										else
										{
											buf.append("<th class=\"printTableHeader\" align=\"center\"  wrap >"+mappingInfo.getTextDescription("monitor.VirtualDashboard.Host")+ "</th>");
										}

										headerVect.add(mappingInfo.getTextDescription("monitor.VirtualDashboard.Host"));
									}

			//String widthOfTheHead="";
			String strVdiHostCombo=ini.getValue("END_USER_DASHBOARD_SETTINGS","showVdiHostCombo");
			strVdiHostCombo=(strVdiHostCombo==null || strVdiHostCombo.trim().length()==0)?"false":strVdiHostCombo;
			String strVdiDefaultHost=ini.getValue("END_USER_DASHBOARD_SETTINGS","Default_VdiType");
			strVdiDefaultHost=(strVdiDefaultHost==null || strVdiDefaultHost.trim().length()==0)?"":strVdiDefaultHost;
			boolean showVdiHostCombo = "true".equalsIgnoreCase(strVdiHostCombo)?true:false;
			//boolean isSkipVal = false;
			//ArrayList skippedColumns = new ArrayList();
			if(showVdiHostCombo && vdiType!=null && vdiType.trim().length()>0)
			{
				strVdiDefaultHost = vdiType;
			}
		
			String measures=null;
			String measuresD=null;
			String measuresToSkip=null;
			String measuresT=null;
			if(userName!=null && userName.trim().length()>0)
			{
				measures = ini.getValue("USER_DESKTOP_METRICS",userName+":"+userType);
			}
		
			if(measures==null || measures.trim().length()==0)
			{
				measuresD = ini.getValue("USER_DESKTOP_METRICS","DEFAULT_"+userType);
				measuresT = ini.getValue("USER_DESKTOP_METRICS",userType);
				if(measuresD != null && measuresD.trim().length() > 0)
				{
					//measures = measuresD;
					measures = (String)getMeasureForUI(measuresD,measuresT);
				}
				else
				{
					measures = measuresT;
				}
			}

			if(detail!=null && filterBy!=null && (detail.equalsIgnoreCase("componentType") || detail.equalsIgnoreCase("Component")) && (!filterBy.equalsIgnoreCase("All")))
			{
				measuresToSkip = ini.getValue("USER_DESKTOP_METRICS","SKIP_METRICS:"+userType+":"+filterBy);
				if(measuresToSkip!=null && measuresToSkip.trim().length()>0)
					measures =  (String)removeSkipMetrics(measures,measuresToSkip);
			}
			else if(resTypeList!=null && resTypeList.size()==1)
			{
				measuresToSkip = ini.getValue("USER_DESKTOP_METRICS","SKIP_METRICS:"+userType+":"+(String)resTypeList.get(0));
				if(measuresToSkip!=null && measuresToSkip.trim().length()>0)
					measures =  (String)removeSkipMetrics(measures,measuresToSkip);
			}

			String extra_measures="";
			if(isFromGeo)
				extra_measures = ini.getValue("EXTERNAL_USER_DESKTOP_METRICS",userType+"_Extra");

			String measures_with_extra="";
			if(measures!=null && measures.trim().length()>0 && measures.endsWith(",") && extra_measures!=null && extra_measures.trim().length()>0)
			{
				measures_with_extra = measures+extra_measures;
			}
			else if(measures!=null && measures.trim().length()>0 && (!measures.endsWith(",")) && extra_measures!=null && extra_measures.trim().length()>0)
			{
				measures_with_extra = measures+","+extra_measures;
			}

			if(measures_with_extra!=null && measures_with_extra.trim().length()>0 && extra_measures!=null && extra_measures.trim().length()>0)
			{
				String swapTestMea = ini.getValue("SWAP_USER_DESKTOP_METRICS",selectedTestMea);
				swapTestMea = (swapTestMea==null || swapTestMea.trim().length()==0)?"":swapTestMea;

				StringBuffer iniValue=new StringBuffer(128);
				ArrayList tmpTestMeasureList = StringUtils.egTokenizer(measures_with_extra,",",true,false,true);//param 3-->includeEmpty,4-->unique,5-->trim
				if(tmpTestMeasureList!=null && tmpTestMeasureList.size()>0 && selectedTestMea!=null && selectedTestMea.trim().length()>0)
				{
					String secondPosMeaVal=null;
					for(int v=0;v<tmpTestMeasureList.size();v++)
					{
						String test_with_measure = (String)tmpTestMeasureList.get(v);
						StringTokenizer testTok=new StringTokenizer(test_with_measure.trim(),":");
						int tokenCount=testTok.countTokens();
						if(tokenCount>=3)
						{
							String tmpTest=testTok.nextToken();
							String tmpMea=testTok.nextToken();
							String tmpColumn=null;
							if(tokenCount>=3)
								tmpColumn=testTok.nextToken();


							String tmpTestMea=tmpTest+":"+tmpMea;
							if(selectedTestMea!=null && selectedTestMea.trim().length()>0 && selectedTestMea.equals(tmpTestMea))
							{
								secondPosMeaVal = test_with_measure;
								break;
							}
							else if(swapTestMea!=null && swapTestMea.trim().length()>0 && swapTestMea.equals(tmpTestMea))
							{
								secondPosMeaVal = test_with_measure;
								break;
							}
						}
					}
					if(secondPosMeaVal!=null && secondPosMeaVal.trim().length()>0)
					{
						ArrayList tmpTestMeasureListOrg = StringUtils.egTokenizer(measures,",",true,false,true);//param 3-->includeEmpty,4-->unique,5-->trim
						try
						{
							tmpTestMeasureListOrg.remove(secondPosMeaVal);
							for(int v=0;v<tmpTestMeasureListOrg.size();v++)
							{
								String test_with_measure = (String)tmpTestMeasureListOrg.get(v);
								if(v==1)
								{
									iniValue.append(","+secondPosMeaVal);
									iniValue.append(","+test_with_measure);
								}
								else
								{
									if(test_with_measure!=null && test_with_measure.trim().length()>0)
									{
										iniValue.append(","+test_with_measure);
									}
								}
							}
						}
						catch (Exception ee)
						{
							ee.printStackTrace();
						}
					}

					String iniValueStr=iniValue.toString();

					if(iniValueStr!=null && iniValueStr.trim().length()>0)
					{
						if(iniValueStr.startsWith(","))
							iniValueStr=iniValueStr.substring(1);

						measures = iniValueStr;
					}
				}
			}

			measures = (String) HideDisabledTest(measures, userType, user, specsInfo,ini,isDetailsFromADOnly,isShowUserLocation);

			String[] measureArray = measures.split(",");
			ArrayList displayColsList = new ArrayList();
			ArrayList validColsList = new ArrayList();
			Hashtable sameLabelHash = new Hashtable();
			measuresCount = measureArray.length;
			for(int x=0;x<measureArray.length;x++)
			{
				String tempValue = measureArray[x];
				String tempTest = "";
				String tempMeasure = "";
				String tempDispName = "";
				String locKeyName = "";
				String colName = "";
				ArrayList locColumnsList = null;
				StringTokenizer valTokens = new StringTokenizer(tempValue,":");
				int count = valTokens.countTokens();
				boolean isDDDColumn = false;
				boolean isLocColumn = false;
				boolean isTestColumn = false;
				String meas ="";
				if (valTokens.hasMoreTokens())
				{
					if(count==3)
					{
						tempTest = valTokens.nextToken();
						tempMeasure = valTokens.nextToken();
						tempDispName = valTokens.nextToken();
						isTestColumn=true;
					}
					else if(count==2)
					{
						if(isShowUserLocation)
						{
							tempTest = valTokens.nextToken();
							tempMeasure = valTokens.nextToken();
							//tempDispName = mappingInfo.getMeasureDescription(tempTest,tempMeasure);
							isLocColumn = true;
							meas = "NONE";

							ArrayList tmpMeasureList = new ArrayList();
							tmpMeasureList = StringUtils.egTokenizer(tempMeasure,"~$~",true,false,true);//param 3-->includeEmpty,4-->unique,5-->trim
							if(tmpMeasureList!=null && tmpMeasureList.size()>0)
							{
								int meaListSize=tmpMeasureList.size();
								if(meaListSize==1)
								{
									tempDispName = tempMeasure;
								}
								else if(meaListSize>1)
								{
									tempDispName = (String)tmpMeasureList.get(1);
									//if(x == 0 && searchFilter != null && searchFilter.trim().length() > 0 && !searchFilter.equalsIgnoreCase("All") && !searchFilter.equalsIgnoreCase("null")){
									/*if(searchFilter != null && searchFilter.trim().length() > 0 && !searchFilter.equalsIgnoreCase("All") && !searchFilter.equalsIgnoreCase("null")){
										continue;
									}
									//else if(x == 1 && nextSearch != null && nextSearch.trim().length() > 0 && !nextSearch.equalsIgnoreCase("All") && !nextSearch.equalsIgnoreCase("null")){
									else if(nextSearch != null && nextSearch.trim().length() > 0 && !nextSearch.equalsIgnoreCase("All") && !nextSearch.equalsIgnoreCase("null")){
										continue;
									}
									//else if(x == 2 && nextSubSearch != null && nextSubSearch.trim().length() > 0 && !nextSubSearch.equalsIgnoreCase("All") && !nextSubSearch.equalsIgnoreCase("null")){
									else if(nextSubSearch != null && nextSubSearch.trim().length() > 0 && !nextSubSearch.equalsIgnoreCase("All") && !nextSubSearch.equalsIgnoreCase("null")){
										continue;
									}*/
								}
							}
						}
					}
					else if(count==5)
					{
						tempTest = valTokens.nextToken();
						tempMeasure = valTokens.nextToken();
						colName = valTokens.nextToken();
						meas = valTokens.nextToken();
						tempDispName = valTokens.nextToken();
						isDDDColumn = true;
						//mappingInfo.getMeasureDescription(tempTest+"_DDD",tempMeasure);
					}
				}

				if(isTestColumn || isDDDColumn || isLocColumn)
				{
					boolean isTestRelevantForServer = true;
					if(showVdiHostCombo && strVdiDefaultHost!=null && strVdiDefaultHost.trim().length()>0)
					{
						isTestRelevantForServer = specsInfo.isTestRelevantForServer(strVdiDefaultHost,tempTest);
					}
					if(!isTestRelevantForServer)
					{
						continue;
					}
					if(displayColsList!=null && displayColsList.contains(tempDispName))
					{
						if(sameLabelHash!=null && sameLabelHash.containsKey(tempDispName))
						{
							ArrayList tmp_list=(ArrayList)sameLabelHash.get(tempDispName);
							tmp_list.add(tempValue);
							sameLabelHash.put(tempDispName,(ArrayList)tmp_list);
						}
						else
						{
							ArrayList tmp_list=new ArrayList();
							tmp_list.add(tempValue);
							sameLabelHash.put(tempDispName,(ArrayList)tmp_list);
						}

						continue;
					}

					String unitForMeasure="";
					if(isDDDColumn && meas!=null && meas.trim().length()>0 &&(!meas.equalsIgnoreCase("NONE")&&!meas.equalsIgnoreCase("DATE")))
					{
						unitForMeasure = "("+meas+")";
					}
					else if(!isDDDColumn && !isLocColumn)
					{
						//unitForMeasure="&nbsp;("+tablesInfo.getUnitForMeasure(tempTest,tempMeasure.trim())+")";
						String unitVal=tablesInfo.getUnitForMeasure(tempTest,tempMeasure.trim());

						if(unitVal!=null && unitVal.trim().length()>0)
						{
							unitForMeasure="&nbsp;("+unitVal+")";
						}
					}
					if(unitForMeasure!=null && unitForMeasure.indexOf("MB")>-1)
						unitForMeasure ="&nbsp;(GB)";

					if(tempDispName!=null && tempDispName.equalsIgnoreCase("Status")){
						unitForMeasure="";
					}
					else if(tempDispName!=null && (tempDispName.equalsIgnoreCase("Disk Used") || tempDispName.equalsIgnoreCase("Used Space"))){
						unitForMeasure="("+mappingInfo.getTextDescription("monitor.VirtualDashboard.GB")+")";
					}
					String orderByColumn = "";
					if(isLocColumn)
					{
						orderByColumn = tempDispName;
						//orderByColumnName = tempDispName;
					}
					else if (isDDDColumn)
					{
						orderByColumn = Dbdata.getColumnForMeasure(tempTest+"_DDD",colName);
						//col_name = dbInfo.getColumnForMeasure(test+"_DDD",tmp_col_name);
						//orderByColumnName = Dbdata.getColumnForMeasure(tempTest,tempMeasure);
					}
					else
					{
						orderByColumn = Dbdata.getColumnForMeasure(tempTest,tempMeasure); 
					}

					if((convertToDaysTestMeasureList!=null && convertToDaysTestMeasureList.size()>0 && convertToDaysTestMeasureList.contains(tempTest+":"+tempMeasure)) || (udm_hide_unit_list!=null && udm_hide_unit_list.size()>0 && udm_hide_unit_list.contains(tempTest+":"+tempMeasure)))
					{
						unitForMeasure="";
					}

					/*if(orderByColumn!=null && orderByColumn.trim().length()>0 && orderByColumnName!=null && orderByColumnName.trim().length()>0 && orderByColumnName.equalsIgnoreCase(orderByColumn))
					{
						String nextOrderBy="desc";
						//String sortImgurl="/final/monitor/eg_images/arrow_down_black_small.gif";
						String sortImgurl="/final/images/Dark/grid_sort_top.png";
					
						if(orderBy!=null && orderBy.equals("desc"))
						{
							nextOrderBy="asc";
							//sortImgurl="/final/monitor/eg_images/arrow_down_black_small.gif";
							sortImgurl="/final/images/Dark/grid_sort_down.png";
						}
						else if(orderBy!=null && orderBy.equals("asc"))
						{
							nextOrderBy="desc";
							sortImgurl="/final/images/Dark/grid_sort_top.png";
						}

						if(isDDDColumn || (isShowUserLocation && isLocColumn))
						{
							if((unitForMeasure==null || unitForMeasure.equals(""))&& (meas!=null && !meas.equalsIgnoreCase("DATE")))
							{
								//buf.append("<td class=\"printTableHeader\" align=\"center\" wrap >"+tempDispName+"</br>"+unitForMeasure+" <div style=\"float:right;padding:3px\"><img id=\"sortImg\" src=\""+sortImgurl+"\"/> </td>");
								buf.append("<td class=\"printTableHeader\" align=\"center\" wrap >"+tempDispName+"</br>"+unitForMeasure+" <div style=\"float:right;padding:3px\"></td>");
							}
							else
							{
								buf.append("<td class=\"printTableHeader\" align=\"center\" wrap >"+tempDispName+"</br>"+unitForMeasure+" <div style=\"float:right;padding:3px\"></td>");
							}

							headerVect.add(tempDispName+unitForMeasure);
						}
						else
						{
							if(unitForMeasure==null || unitForMeasure.equals(""))
							{
								buf.append("<td class=\"printTableHeader\" align=\"center\" wrap  >"+tempDispName+"<div style=\"float:right;padding:3px\"></td>");
								headerVect.add(tempDispName);
							}
							else
							{
								buf.append("<td class=\"printTableHeader\" align=\"center\" wrap  >"+tempDispName+"</br>"+unitForMeasure+" <div style=\"float:right;padding:3px\"></td>");
								headerVect.add(tempDispName+unitForMeasure);
							}
						}
					}
					else*/
					{
						if(isDDDColumn || (isShowUserLocation && isLocColumn))
						{
							if((unitForMeasure==null || unitForMeasure.equals("")) && (meas!=null && !meas.equalsIgnoreCase("DATE")))
							{
								buf.append("<th class=\"printTableHeader\" align=\"center\" wrap >"+tempDispName+" </th>");
								headerVect.add(tempDispName);
							}
							else
							{
								buf.append("<th class=\"printTableHeader\" align=\"center\" wrap > "+tempDispName+"</br>"+unitForMeasure+" </th>");
								headerVect.add(tempDispName+unitForMeasure);
							}
						}
						else
						{
							if(unitForMeasure==null || unitForMeasure.equals(""))
							{
								buf.append("<th class=\"printTableHeader\" align=\"center\" wrap > "+tempDispName+" </th>");
								headerVect.add(tempDispName);
							}
							else
							{
								buf.append("<th class=\"printTableHeader\" align=\"center\" wrap > "+tempDispName+"</br>"+unitForMeasure+" </th>");
								headerVect.add(tempDispName+unitForMeasure);
							}
						}
					}
					if(displayColsList!=null && tempDispName!=null && !displayColsList.contains(tempDispName))
					{
						displayColsList.add(tempDispName);
						if(sameLabelHash!=null && sameLabelHash.containsKey(tempDispName))
						{
							ArrayList tmp_list=(ArrayList)sameLabelHash.get(tempDispName);
							tmp_list.add(tempValue);
							sameLabelHash.put(tempDispName,(ArrayList)tmp_list);
						}
						else
						{
							ArrayList tmp_list=new ArrayList();
							tmp_list.add(tempValue);
							sameLabelHash.put(tempDispName,(ArrayList)tmp_list);
						}
					}

					if(validColsList!=null && tempValue!=null && !validColsList.contains(tempValue)) 
						validColsList.add(tempValue);
				}
			}
			if(validColsList!=null && validColsList.size()>0)
			{
				measureArray = new String[validColsList.size()];
				int yy=0;
				for(int y=0;y<validColsList.size();y++)
				{
					String tempValue1 = (String)validColsList.get(y);
					if(tempValue1!=null && tempValue1.trim().length()>0)
					{
						measureArray[yy++]=tempValue1;
					}
				}
			}

				buf.append("</tr>");
				buf.append("</thead>");
				buf.append("<tbody>");
				listData.add(headerVect);
			EgService serv = null;
			int desktopsSize = (vdiDesktopsList!=null && vdiDesktopsList.size()>0)?vdiDesktopsList.size():0;
			Hashtable desktopHtml = new Hashtable();
			Hashtable desktopCSV = new Hashtable();
			ArrayList deskTopList = new ArrayList();
			
			for(int i=0;i<desktopsSize;i++)
			{
				StringBuffer bufRow = new StringBuffer();
				Vector dataVect = new Vector();
				serv = (EgService)vdiDesktopsList.get(i);

				String desktopComponent = serv.getName();
				String desktopState = serv.getState().getName();
				String desktopName = "";
				String comp = "";
				String compValue = "";
				String compName = "";
				String compNameWithOutPort = "";

				if(desktopComponent!=null && desktopComponent.indexOf("^")>-1)
				{
					desktopName = desktopComponent.substring(0,desktopComponent.indexOf("^"));
					comp = desktopComponent.substring(desktopComponent.indexOf("^")+1);
				}
				
				deskTopList.add(desktopName+"~!~"+comp);

				if(comp!=null && comp.indexOf(":")>-1)
				{
					compValue = comp.substring(0,comp.indexOf(":"));
					compName = comp.substring(comp.indexOf(":")+1);
				}
				if(compName!=null && compName.indexOf(":")>-1)
				{
					compNameWithOutPort = compName.substring(0,compName.indexOf(":"));
				}
				measureValues = (Hashtable)TotalMeasureInfo.get(comp);
				String msmtHost = "";
				String ctype_layer=ini.getValue("USER_DESKTOP_LAYERS",compValue);
				ctype_layer=(ctype_layer==null || ctype_layer.trim().length()==0)?"VIRTUAL_DESKTOP":ctype_layer;
				//ArrayList arr = tablesInfo.getTestsForLayer(ctype_layer);
				ArrayList arr = tablesInfo.getTestsForLayer(ctype_layer,compValue);
				if(arr!=null && arr.size()>0)
				{
					boolean flag=true;
					for (int t=0;t<arr.size();t++)
					{
						String insideviewTest=(String) arr.get(t);
						if(insideviewTest!=null && insideviewTest.trim().length()>0)
						{
							List agents=egExternalInfo.getAgentsFor(insideviewTest.trim(),compValue,compNameWithOutPort);

							if(agents!=null && agents.size()>0)
							{
								msmtHost=(String)agents.get(0);
								flag=false;
								break;
							}
						}
					}

					if(flag)
						msmtHost=compNameWithOutPort;
				}
				else
					msmtHost=compNameWithOutPort;

				String disp_desktopName=desktopName;
				//if(disp_desktopName!=null && disp_desktopName.length()>30)
					//disp_desktopName=disp_desktopName.substring(0,30)+"..";

				String strName = compName;
				if (strName.endsWith(EgConstants.NULL_PORT) && (strName.indexOf(EgConstants.NULL_PORT) > -1))
				{
					strName = Server.getServerNameWithoutPort(strName, false);
				}

				String disp_StrName = strName;
				//if(disp_StrName!=null && disp_StrName.length()>22)
					//disp_StrName=disp_StrName.substring(0,22)+"..";

									//bufRow.append("<tr class=\"x-grid-row  x-grid-row-alt\" style=\"background:none\">");
										bufRow.append("<td >");
											bufRow.append("<table cellspacing=\"0\" cellpadding=\"2\" border=\"0\">");
												//bufRow.append("<tr style=\"background:none !important\">");
													bufRow.append("<td style=\"border:none;\">");

				/*if(desktopName.endsWith("[Template]") || desktopName.endsWith("[template]"))
				{
						bufRow.append("<div style=\"text-align:center;padding:2px 6px 5px 5px\"><img src=\"/final/monitor/eg_images/template_vm_"+desktopState+".gif\"></div>");
				}
				else if(desktopName.endsWith("[Orphaned]") || desktopName.endsWith("[orphaned]"))
				{
						bufRow.append("<div style=\"text-align:center;padding:2px 6px 5px 5px\"><img src=\"/final/monitor/eg_images/orphan_vm_"+desktopState+".gif\"></div>");
				}
				else
				{
					if(desktopName!=null && desktopName.toLowerCase().indexOf("vio")>-1)
					{
								bufRow.append("<div style=\"text-align:center;padding:2px 6px 5px 5px\"><img src=\"/final/monitor/eg_images/vio_"+desktopState+".gif\"></div>");
					}
					else
					{*/
								bufRow.append("<div style=\"text-align:center;padding:2px 6px 5px 5px\"><img src=\"/final/images/Dark/eud_"+desktopState+".png\"/></div>");
					//}
				//}
								if(userType!=null && (userType.equalsIgnoreCase("AppXenApp7") || userType.equalsIgnoreCase("AppDDXenApp7") || userType.equals("AppLaunchDDXenApp7") || userType.equals("OverviewAppXenApp7") || userType.equals("OverviewAppVDI")))
								{
									if(disp_desktopName.indexOf("~SEQ~")>-1)
									{
										disp_desktopName=disp_desktopName.substring(0,disp_desktopName.indexOf("~SEQ~"));
									}
								}
													bufRow.append("</td>");
													bufRow.append("<td style=\"border:none;word-break: break-all;\" >");
														bufRow.append(disp_desktopName);
													bufRow.append("</td>");
												bufRow.append("</tr>");
											bufRow.append("</table>");
										bufRow.append("</td>");

										if(!isOnlyVMAssigned && !userType.equals("OverviewAppXenApp7") && !userType.equals("OverviewAppVDI"))
										{
											bufRow.append("<td>");
												bufRow.append("<div style=\"font-size:12px;float:left;position:relative;visibility:visible;text-align:left;\"><div style=\"padding-top:4px;\">"+disp_StrName+"</div></div>");
											bufRow.append("</td>");
										}
												dataVect.add("");
												String labeldeskState = mappingInfo.getLabelDescription(desktopState);
												dataVect.add(labeldeskState);
												dataVect.add(disp_desktopName);
											if(!isOnlyVMAssigned && !userType.equals("OverviewAppXenApp7") && !userType.equals("OverviewAppVDI"))
											{
												dataVect.add(disp_StrName);
											}

				measureList = Arrays.asList(measureArray);
				if(measureValues!=null && measureValues.size()>0)
				{
					String ctype_out_layer=ui.getValue("Layer_for_ComponentType",compValue);
					ctype_out_layer=(ctype_out_layer==null || ctype_out_layer.trim().length()==0)?"VIRTUAL_GUESTS":ctype_out_layer;
					ArrayList listOfTest=(ArrayList)tablesInfo.getTestsForLayer(ctype_out_layer,compValue);

					if(userType!=null && (userType.equals("CitrixXenVDI") || userType.equals("VDI") || userType.equals("ESX")))
					{
						String ctype_in_layer=ini.getValue("USER_DESKTOP_LAYERS",compValue);
						ctype_in_layer=(ctype_in_layer==null || ctype_in_layer.trim().length()==0)?"VIRTUAL_DESKTOP":ctype_in_layer;
						listOfTest.addAll((ArrayList)tablesInfo.getTestsForLayer(ctype_in_layer,compValue));
					}

					int p=0;
					String info_to_lower=desktopName;
					while(p<measureList.size())
					{
						String keyForList = (String)measureList.get(p);
						String keyMeasure = "";
						String keyOrgMeasure = "";
						String keyTest = "";
						String keydisplayMeasure = "";
						StringTokenizer valTokens = new StringTokenizer(keyForList,":");
						int tokCount = valTokens.countTokens();
						boolean isDDDTestColumn = false;
						boolean isLocationColumn = false;
						if(tokCount==5)
							isDDDTestColumn = true;
						else if(tokCount==2)
							isLocationColumn = true;
						String orgColName = "";
						String funcName = "";
						String dispName = "";
						
						String tempDispName = "";
						String locKeyName = "";
						String Value="";
						String units="";
						
						ArrayList keyMeasureList = null; 
						ArrayList locMeasuresList = new ArrayList(); 
						if(isDDDTestColumn)
						{
							if(keyForList!=null && keyForList.indexOf(":")>-1)
							{
								keyTest=keyForList.substring(0,keyForList.indexOf(":"));
								keyMeasure=keyForList.substring(keyForList.indexOf(":")+1);
								if(keyMeasure!=null && keyMeasure.indexOf(":")>-1)
								{
									orgColName=keyMeasure.substring(keyMeasure.indexOf(":")+1);
									keyMeasure = keyMeasure.substring(0,keyMeasure.indexOf(":"));
									if(orgColName!=null && orgColName.indexOf(":")>-1)
									{
										funcName=orgColName.substring(orgColName.indexOf(":")+1);
										orgColName = orgColName.substring(0,orgColName.indexOf(":"));
									}
									if(funcName!=null && funcName.indexOf(":")>-1)
									{
										dispName = funcName.substring(funcName.indexOf(":")+1);
										funcName = funcName.substring(0,funcName.indexOf(":"));
									}
								}
							}

							if(keyTest!=null && keyTest.trim().length()>0 && listOfTest!=null && listOfTest.size()>0 && !listOfTest.contains(keyTest) && dispName!=null)
							{
								ArrayList tmpArry=(ArrayList)sameLabelHash.get(dispName);
								if(tmpArry!=null && tmpArry.size()>0)
								{
									for(int kk=0;kk<tmpArry.size();kk++)
									{
										String newKeyForList =(String)tmpArry.get(kk);
										String newKeyTest=null;
										if(newKeyForList!=null && newKeyForList.indexOf(":")>-1)
										{
											newKeyTest=newKeyForList.substring(0,newKeyForList.indexOf(":"));
										}

										if(newKeyTest!=null && newKeyTest.trim().length()>0 && listOfTest!=null && listOfTest.contains(newKeyTest))
										{
											keyForList = newKeyForList;
											if(keyForList!=null && keyForList.indexOf(":")>-1)
											{
												keyTest=keyForList.substring(0,keyForList.indexOf(":"));
												keyMeasure=keyForList.substring(keyForList.indexOf(":")+1);
												if(keyMeasure!=null && keyMeasure.indexOf(":")>-1)
												{
													orgColName=keyMeasure.substring(keyMeasure.indexOf(":")+1);
													keyMeasure = keyMeasure.substring(0,keyMeasure.indexOf(":"));
													if(orgColName!=null && orgColName.indexOf(":")>-1)
													{
														funcName=orgColName.substring(orgColName.indexOf(":")+1);
														orgColName = orgColName.substring(0,orgColName.indexOf(":"));

														if(funcName!=null && funcName.indexOf(":")>-1)
														{
															dispName=funcName.substring(funcName.indexOf(":")+1);
															funcName = funcName.substring(0,funcName.indexOf(":"));
														}
													}
												}
											}
											break;
										}
									}
								}
							}

							String colKeyName = Dbdata.getColumnForMeasure(keyTest+"_DDD",orgColName);
							String tmpK = colKeyName+"^"+info_to_lower.toLowerCase()+"^"+compNameWithOutPort;
							Value=getMeasureValue(measureValues,keyTest,colKeyName,info_to_lower,compNameWithOutPort);
						}
						else if(isShowUserLocation && isLocationColumn)
						{
							if(keyForList!=null && keyForList.indexOf(":")>-1)
							{
								keyTest=keyForList.substring(0,keyForList.indexOf(":"));
								keyMeasure=keyForList.substring(keyForList.indexOf(":")+1);
							}

							funcName ="NONE";

							if(keyMeasure!=null && keyMeasure.trim().length()>0)
							{
								keyMeasureList = StringUtils.egTokenizer(keyMeasure,"~$~",true,false,true);//param 3-->includeEmpty,4-->unique,5-->trim
								if(keyMeasureList!=null && keyMeasureList.size()>0)
								{
									int meaListSize=keyMeasureList.size();
									if(meaListSize==1)
									{
										locKeyName = (String)keyMeasureList.get(0);
									}
									else if(meaListSize>1)
									{
										locKeyName = (String)keyMeasureList.get(0);
									}

									Value=getMeasureValue(measureValues,keyTest,locKeyName,info_to_lower,compNameWithOutPort);

									if(meaListSize==1 && strSeparator!=null && strSeparator.trim().length()>0 && strReplaceSep!=null && strReplaceSep.trim().length()>0 && Value!=null && !Value.equals("-"))
									{
										Value = com.egurkha.util.StringUtils.replace(Value,strSeparator,strReplaceSep);
									}
								}
							}
						}
						else
						{
							if(keyForList!=null && keyForList.indexOf(":")>-1)
							{
								keyTest=keyForList.substring(0,keyForList.indexOf(":"));
								keyMeasure=keyForList.substring(keyForList.indexOf(":")+1);
								if(keyMeasure!=null && keyMeasure.indexOf(":")>-1)
								{
									keydisplayMeasure=keyMeasure.substring(keyMeasure.indexOf(":")+1);
									keyMeasure=keyMeasure.substring(0,keyMeasure.indexOf(":"));
								}
							}
							units=tablesInfo.getUnitForMeasure(keyTest,keyMeasure);
							keyOrgMeasure = keyMeasure;
							keyMeasure = Dbdata.getColumnForMeasure(keyTest,keyMeasure);
							Value=getMeasureValue(measureValues,keyTest,keyMeasure,info_to_lower,compNameWithOutPort);
						}
						
						//if((Value==null || Value.trim().length()==0) && compValue!=null && compValue.equals("Xen_desktop_server"))
						if(Value==null || Value.trim().length()==0)
						{
							if(info_to_lower!=null && (info_to_lower.indexOf(" ")>-1 && info_to_lower.indexOf("on")>-1))
							{
								ArrayList tokenList =  com.egurkha.util.StringUtils.egTokenizer(info_to_lower, " on ",false,false,true);//param 3-->includeEmpty,4-->unique,5-->trim
								if(tokenList!=null && tokenList.size()==2)
								{
									info_to_lower=(String)tokenList.get(0)+"_on_"+(String)tokenList.get(1);
								}
							}
							Value=getMeasureValue(measureValues,keyTest,keyMeasure,info_to_lower,compNameWithOutPort);
						}
						String mes_state="";
						String mes_name="";
						String total_spc="0";

						if(Value!=null && Value.indexOf("^")>-1)
						{
							mes_state=Value.substring(Value.indexOf("^")+1);
							if(mes_state!=null && mes_state.indexOf("^")>-1)
							{
								mes_name=mes_state.substring(mes_state.indexOf("^")+1);
								mes_state=mes_state.substring(0,mes_state.indexOf("^"));
								if(mes_name!=null && mes_name.indexOf("^")>-1)
								{
									total_spc=mes_name.substring(mes_name.indexOf("^")+1);
									mes_name=mes_name.substring(0,mes_name.indexOf("^"));
								}
							}
							Value=Value.substring(0,Value.indexOf("^"));
						}
						else if(Value==null)
						{
							Value="-";
							mes_name=keyMeasure;
							mes_state="GOOD";
						}

						boolean sameLabelFlag=false;
						if(sameLabelHash!=null && sameLabelHash.size()>0 && keydisplayMeasure!=null && sameLabelHash.containsKey(keydisplayMeasure))
						{
							ArrayList tmpArry=(ArrayList)sameLabelHash.get(keydisplayMeasure);
							ArrayList tmpNewArry=new ArrayList();
							tmpNewArry.addAll(tmpArry);

							if(tmpNewArry!=null && tmpNewArry.size()>0 && keyForList!=null && tmpNewArry.contains(keyForList))
								tmpNewArry.remove(keyForList);

							if(tmpNewArry!=null && tmpNewArry.size()>0)
							{
								sameLabelFlag=true;
								if(!dashboardModel.isTestActive(compValue, compName, keyTest, "custom"))
									Value="-";
							}
						}

						if((Value==null || Value.equals("-")) && sameLabelFlag && (sameLabelHash!=null && sameLabelHash.size()>0 && sameLabelHash.containsKey(keydisplayMeasure)))
						{
							ArrayList tmpArry=(ArrayList)sameLabelHash.get(keydisplayMeasure);
							ArrayList tmpOldArry=new ArrayList();
							if(tmpArry!=null && tmpArry.size()>0)
							{
								tmpOldArry.addAll(tmpArry);
								if(tmpOldArry.contains(keyForList))
									tmpOldArry.remove(keyForList);

								for(int kk=0;kk<tmpOldArry.size();kk++)
								{
									keyForList =(String)tmpOldArry.get(kk);
									String tmp_keyTest=null;
									String tmp_keyMeasure=null;
									String tmp_keydisplayMeasure=null;
									if(keyForList!=null && keyForList.indexOf(":")>-1)
									{
										tmp_keyTest=keyForList.substring(0,keyForList.indexOf(":"));
										tmp_keyMeasure=keyForList.substring(keyForList.indexOf(":")+1);
										if(tmp_keyMeasure!=null && tmp_keyMeasure.indexOf(":")>-1)
										{
											tmp_keydisplayMeasure=tmp_keyMeasure.substring(tmp_keyMeasure.indexOf(":")+1);
											tmp_keyMeasure=tmp_keyMeasure.substring(0,tmp_keyMeasure.indexOf(":"));
										}
									}
									
									//String tmp_units=tablesInfo.getUnitForMeasure(tmp_keyTest,tmp_keyMeasure);
									String tmp_keyOrgMeasure = tmp_keyMeasure;
									tmp_keyMeasure = Dbdata.getColumnForMeasure(tmp_keyTest,tmp_keyMeasure);
									String tmp_Value=null;
									boolean isTimeout = isTimeoutCheck(compName,tmp_keyTest,msmtHost,compValue,info_to_lower);
									if(!isTimeout)
									{
										if(specsInfo.isTestRelevantForServer(compValue,tmp_keyTest))
										{
											tmp_Value=getMeasureValue(measureValues,tmp_keyTest,tmp_keyMeasure,info_to_lower,compNameWithOutPort);
											if(tmp_Value==null || tmp_Value.trim().length()==0)
											{
												if(info_to_lower!=null && (info_to_lower.indexOf(" ")>-1 && info_to_lower.indexOf("on")>-1))
												{
													ArrayList tokenList =  com.egurkha.util.StringUtils.egTokenizer(info_to_lower, " on ",false,false,true);//param 3-->includeEmpty,4-->unique,5-->trim
													if(tokenList!=null && tokenList.size()==2)
													{
														info_to_lower=(String)tokenList.get(0)+"_on_"+(String)tokenList.get(1);
													}
												}
												tmp_Value=getMeasureValue(measureValues,tmp_keyTest,tmp_keyMeasure,info_to_lower,compNameWithOutPort);
											}
										}

										if(tmp_Value!=null && tmp_Value.indexOf("^")>-1)
										{
											String tmp_mes_state=tmp_Value.substring(tmp_Value.indexOf("^")+1);
											String tmp_total_spc=null;
											String tmp_mes_name=null;
											if(tmp_mes_state!=null && tmp_mes_state.indexOf("^")>-1)
											{
												tmp_mes_name=tmp_mes_state.substring(tmp_mes_state.indexOf("^")+1);
												tmp_mes_state=tmp_mes_state.substring(0,tmp_mes_state.indexOf("^"));
												if(tmp_mes_name!=null && tmp_mes_name.indexOf("^")>-1)
												{
													total_spc=tmp_mes_name.substring(tmp_mes_name.indexOf("^")+1);
													tmp_mes_name=tmp_mes_name.substring(0,tmp_mes_name.indexOf("^"));
												}
											}
											tmp_Value=tmp_Value.substring(0,tmp_Value.indexOf("^"));

											if(tmp_Value!=null && !tmp_Value.trim().equals("-"))
											{
												keyTest=tmp_keyTest;
												keyMeasure=tmp_keyMeasure;
												keyOrgMeasure = tmp_keyOrgMeasure;
												Value=tmp_Value;
												total_spc= tmp_total_spc;
												mes_name=tmp_mes_name;
												mes_state=tmp_mes_state;
												break;
											}
										}
									}
								}
							}
						}

						//widthOfTheHead="60";
						//if(units!=null && units.equals("%")) 
							//widthOfTheHead="150";
						
						String orgValue="0.0";
						
						try
						{
							if(Value!=null && Value.trim().length()>0 && Value.indexOf(".")>-1 && Double.parseDouble(Value)>0)
							{
								orgValue=Value;
								//Value=String.valueOf(com.egurkha.util.MathUtils.round(Double.parseDouble(Value),2));
								if(decimalFormatTestMeasureList!=null && decimalFormatTestMeasureList.size()>0 && decimalFormatTestMeasureList.contains(keyTest+":"+keyOrgMeasure))
								{
									Value=String.valueOf(com.egurkha.util.MathUtils.round(Double.parseDouble(Value),4));
								}
								else if(convertToDaysTestMeasureList!=null && convertToDaysTestMeasureList.size()>0 && convertToDaysTestMeasureList.contains(keyTest+":"+keyOrgMeasure))
								{
									Value = getConvertDays(Value,egDashboard);
								}
								else
								{
									Value=String.valueOf(com.egurkha.util.MathUtils.round(Double.parseDouble(Value),2));
								}
								Value=String.valueOf(Value);
							}
							else if(Value!=null && Value.trim().length()>0  && Double.parseDouble(Value)>0)
							{
								orgValue=Value;
								//Value=String.valueOf(com.egurkha.util.MathUtils.round(Double.parseDouble(Value),2));
								if(decimalFormatTestMeasureList!=null && decimalFormatTestMeasureList.size()>0 && decimalFormatTestMeasureList.contains(keyTest+":"+keyOrgMeasure))
								{
									Value=String.valueOf(com.egurkha.util.MathUtils.round(Double.parseDouble(Value),4));
								}
								else if(convertToDaysTestMeasureList!=null && convertToDaysTestMeasureList.size()>0 && convertToDaysTestMeasureList.contains(keyTest+":"+keyOrgMeasure))
								{
									Value = getConvertDays(Value,egDashboard);
								}
								else
								{
									//Value=String.valueOf(com.egurkha.util.MathUtils.round(Double.parseDouble(Value),2));
								}
								Value=String.valueOf(Value);
							}
						}
						catch(Exception ee)
						{
							if(Value==null || Value.equalsIgnoreCase("unknown"))
								Value = "-";

							Value=Value;
							orgValue=Value;
						}
						if(mes_state!=null && mes_state.length()>0 && mes_state.equalsIgnoreCase("NONE"))
						{
							mes_state="GOOD";
						}
						else if(mes_state!=null && mes_state.trim().length()==0)
						{
							mes_state="GOOD";
						}
						if(Value.equalsIgnoreCase("on"))
						{
							bufRow.append("<td align=\"center\" ><img  src=\"/final/monitor/eg_images/yes2.gif\"></td>"); 
						}
						else if(Value.equalsIgnoreCase("off"))
						{
							bufRow.append("<td align=\"center\" ><img  src=\"/final/monitor/eg_images/no2.gif\"></td>");
						}
						else
						{
							String measuresLink = "";
							if(fromMenuStr!=null && !fromMenuStr.equalsIgnoreCase("null") && fromMenuStr.trim().length()>0 && fromMenuStr.equalsIgnoreCase("true"))
							{
								String layerName = tablesInfo.getRelevantLayer(compValue,keyTest,keyOrgMeasure);
								layerName=(layerName==null || layerName.trim().length()==0)?ctype_layer:layerName;
								
								String infoKey = compValue+":"+compName+":"+keyTest+":"+info_to_lower;
								HashSet infosSet = null;
								if(fullInfoHash!=null && fullInfoHash.size()>0)
									infosSet = (HashSet)fullInfoHash.get(infoKey);
								ArrayList infosList = null;
								if(infosSet!=null && infosSet.size()>0)
									infosList = new ArrayList(infosSet);
								String info_name = "";
								if(infosList!=null && infosList.size()>1)
								{
									for(int is=0;is<infosList.size();is++)
									{
										String tmpInfo = (String)infosList.get(is);
										if(tmpInfo!=null && (tmpInfo.endsWith(":Summary") || tmpInfo.endsWith(":Total")))
										{
											info_name = tmpInfo;
											break;
										}
									}
									if(info_name==null || info_name.equalsIgnoreCase("null") || info_name.trim().length()==0)
									{
										info_name = (String)infosList.get(0);
									}
								}
								else if(infosList!=null && infosList.size()==1)
								{
									info_name = (String)infosList.get(0);
								}
								if(info_name==null || info_name.equalsIgnoreCase("null") || info_name.trim().length()==0)
								{
									info_name = "+" + info_to_lower;
								}
								measuresLink = "/final/monitor/EgSiteInfraView.jsp?qctr=2"+"&site=NULL"+"&fromalarm=0"+"&newWindow=false"+"&host="+EgURLEncoder.encode(compName,"UTF-8")+"&msmt_host="+EgURLEncoder.encode(msmtHost,"UTF-8")+"&comptype="+compValue+"&layer="+layerName+"&test="+keyTest+"-"+EgURLEncoder.encode(info_name,"UTF-8")+"&tstate="+mes_state+"&toDashBoardLayer=true";
							}

							if(mes_name!=null)
							{
								if(Value!=null && !Value.equals("-"))
								{
									try
									{
										double fillColorValue=Double.parseDouble(orgValue);
										if(units!=null && units.equals("MB"))
										{
											//units = "GB";
											fillColorValue=fillColorValue/1024.0;
										}
										Value=String.valueOf(fillColorValue);
										//Value=String.valueOf(com.egurkha.util.MathUtils.round(Double.parseDouble(Value),2));
										if(Value!=null && Value.trim().length()>0 && Value.indexOf(".")>-1 && Double.parseDouble(Value)>0)
										{
											if(decimalFormatTestMeasureList!=null && decimalFormatTestMeasureList.size()>0 && decimalFormatTestMeasureList.contains(keyTest+":"+keyOrgMeasure))
											{
												Value=String.valueOf(com.egurkha.util.MathUtils.round(Double.parseDouble(Value),4));
											}
											else if(convertToDaysTestMeasureList!=null && convertToDaysTestMeasureList.size()>0 && convertToDaysTestMeasureList.contains(keyTest+":"+keyOrgMeasure))
											{
												Value = getConvertDays(Value,egDashboard);
											}
											else
											{
												Value=String.valueOf(com.egurkha.util.MathUtils.round(Double.parseDouble(Value),2));
											}

										}
										else
										{
											//Value=String.valueOf(com.egurkha.util.MathUtils.round(Double.parseDouble(Value),2));
										}
										
										Value=String.valueOf(Value);

									}
									catch(Exception ee)
									{
										Value=String.valueOf(orgValue);
									}

									if(isDDDTestColumn || isLocationColumn)
									{
										bufRow.append("<td  align=\"left\"  >");
										bufRow.append("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"left\">");
									}
									else
									{
										bufRow.append("<td  align=\"center\" >");
										//bufRow.append("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"right\">");
										bufRow.append("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">");
									}
									bufRow.append("<tr style=\"background:none !important\">");
									if(fromMenuStr!=null && !fromMenuStr.equalsIgnoreCase("null") && fromMenuStr.trim().length()>0 && fromMenuStr.equalsIgnoreCase("true"))
									{
										if(isDDDTestColumn || isLocationColumn)
										{
											bufRow.append("<td class=\"mouse\" align=\"left\" style=\"text-align:left;\" \"data-qtip=\""+Value+"\" data-qclass=\"yellowTip\" >");
											
										}
										else
										{
											bufRow.append("<td class=\"mouse\" align=\"right\" >");
										}
									}
									else
									{
										if(isDDDTestColumn || isLocationColumn)
										{
											bufRow.append("<td style=\"white-space:pre-wrap;border:none;\" align=\"left\">");
										}
										else
										{
											bufRow.append("<td style=\"white-space:pre-wrap;border:none;\" align=\"left\">");
										}
									}
								}
								else
								{
									if(isDDDTestColumn || isLocationColumn)
									{
										bufRow.append("<td  style=\"text-align:left;\" align=\"left\" >");
											bufRow.append("<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" borderColor=\"red\"  style=\"table-layout:auto;\" align=\"left\">");
									}
									else
									{
										bufRow.append("<td align=\"center\" >");
											//bufRow.append("<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" borderColor=\"green\"  style=\"table-layout:auto;\" align=\"right\">");
											bufRow.append("<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" borderColor=\"green\"  style=\"table-layout:auto;\" align=\"center\">");
									}
									bufRow.append("<tr style=\"background:none !important\">");
									if(fromMenuStr!=null && !fromMenuStr.equalsIgnoreCase("null") && fromMenuStr.trim().length()>0 && fromMenuStr.equalsIgnoreCase("true"))
									{
										if(isDDDTestColumn||isLocationColumn)
										{
											bufRow.append("<td align=\"left\" style=\"border:none;padding-right:10px;text-align:left;\" >");
										}
										else
										{
											bufRow.append("<td class=\"mouse\" align=\"left\" style=\"border:none;padding-right:10px\" >");
										}
									}
									else
									{
										bufRow.append("<td align=\"left\" style=\"border:none;padding-right:10px\">");
									}
								}
							}
							else
							{
								bufRow.append("<td  style=\"padding-top:4px;\" align=\"center\"  >");
									bufRow.append("<table cellspacing=\"0\" cellpadding=\"0\" style=\"table-layout:auto;border:0px solid red;border:none;\" align=\"right\">");
										bufRow.append("<tr style=\"background:none !important\">");
											if(fromMenuStr!=null && !fromMenuStr.equalsIgnoreCase("null") && fromMenuStr.trim().length()>0 && fromMenuStr.equalsIgnoreCase("true"))
											{
												if(isDDDTestColumn||isLocationColumn)
												{
													bufRow.append("<td align=\"right\" style=\"font-size:11px;text-align:right;width:20px;padding-right:10px\" >");
												}
												else
												{
													bufRow.append("<td class=\"mouse\" align=\"right\" style=\"font-size:11px;text-align:right;width:20px;padding-right:10px\" onClick=\"javascript:goToDetails('"+measuresLink+"');\" >");
												}
											}
											else
											{
												bufRow.append("<td align=\"right\" style=\"font-size:11px;text-align:right;width:20px;padding-right:10px\">");
											}
							}

							Value = formatDbValue(Value);
							String labelTmpState = mappingInfo.getLabelDescription(mes_state);
							
							if(Value!=null && !Value.equals("-"))
							{
								boolean usage =true;
								if(mes_name!=null && mes_name.equalsIgnoreCase("Cpu_used"))
								{
									dataVect.add("("+labelTmpState+")"+Value);
									usage = false;
									int columnWidth = 100;
									Long temp_measure_value=new Long(Math.round(Double.parseDouble(Value)));
									long fillColorValue=temp_measure_value.longValue();
									long value1 = (fillColorValue*100)/columnWidth;
									String mes_state_GOOD="";
									if(mes_state.equalsIgnoreCase("high"))
									{
										mes_state_GOOD="#cd0f0f";
									}
									else if(mes_state.equalsIgnoreCase("intermediate"))
									{
										mes_state_GOOD="#fa9d1c";
									}
									else if(mes_state.equalsIgnoreCase("low"))
									{
										mes_state_GOOD="#ccc100";
									}
									else if(mes_state.equalsIgnoreCase("unknown"))
									{
										mes_state_GOOD="#30a1d9";
									}
									else if(mes_state.equalsIgnoreCase("good")) 
									{
										mes_state_GOOD="#0c9a12";
									}
														bufRow.append("<div style=\"width:80px;padding:0px;margin:0px;background:#e1e1e1;\">");
														//bufRow.append("<tr`>");
															//bufRow.append("<td align=\"left\" width=\"100%\" height=\"6\" //class=\"prog_line\">");
																bufRow.append("<div style=\"width:"+value1+"% !important;display:inline-block;z-index:25000;height:6px;background:"+mes_state_GOOD+"\" height=\"6\">");
																		//bufRow.append("<div width=\"100%\" style=\"border:0px solid yellow;display:block;z-index:25000;height:6px\"></div>");
																bufRow.append("</div>");
															//bufRow.append("</td>");
														//bufRow.append("</tr>");
													bufRow.append("</div>");
								}
								else if(units!=null && units.equals("%") && !mes_name.equalsIgnoreCase("Ready") && usage)
								{
									dataVect.add("("+labelTmpState+")"+Value);
									int columnWidth = 100;
									Long temp_measure_value=new Long(Math.round(Double.parseDouble(Value)));
									long fillColorValue=temp_measure_value.longValue();
									long value2 = (fillColorValue*100)/columnWidth;
									String mes_state_GOOD="";
									if(mes_state.equalsIgnoreCase("high"))
									{
										mes_state_GOOD="#cd0f0f";
									}
									else if(mes_state.equalsIgnoreCase("intermediate"))
									{
										mes_state_GOOD="#fa9d1c";
									}
									else if(mes_state.equalsIgnoreCase("low"))
									{
										mes_state_GOOD="#ccc100";
									}
									else if(mes_state.equalsIgnoreCase("unknown"))
									{
										mes_state_GOOD="#30a1d9";
									}
									else if(mes_state.equalsIgnoreCase("good")) 
									{
										mes_state_GOOD="#0c9a12";
									}
													bufRow.append("<div style=\"width:80px;padding:0px;margin:0px;background:#e1e1e1;\">");
														//bufRow.append("<tr`>");
															//bufRow.append("<td align=\"left\" width=\"100%\" height=\"6\" //class=\"prog_line\">");
																bufRow.append("<div style=\"width:"+value2+"% !important;display:inline-block;z-index:25000;height:6px;background:"+mes_state_GOOD+"\" height=\"6\">");
																		//bufRow.append("<div width=\"100%\" style=\"border:0px solid yellow;display:block;z-index:25000;height:6px\"></div>");
																bufRow.append("</div>");
															//bufRow.append("</td>");
														//bufRow.append("</tr>");
													bufRow.append("</div>");
								}
							}
							bufRow.append("</td>");
							//dataVect.add(Value);
							if(Value!=null && !Value.equals("-"))
							{
								boolean usage =true;
								if(isDDDTestColumn || isLocationColumn)
								{
									dataVect.add(Value);
									if(mes_name!=null && mes_name.equalsIgnoreCase("Cpu_used"))
									{
										usage =false;
										bufRow.append("<td style=\"border:none;text-align:left;padding-left:3px;width:42px;white-space:nowrap\">"+Value+"</td>");
									}
									else if(units!=null && units.equals("%") && !mes_name.equalsIgnoreCase("Ready") && usage)
									{
										bufRow.append("<td style=\"border:none;text-align:left;padding-left:3px;width:42px;white-space:nowrap\">"+Value+"</td>");
									}
									else
									{
										if(funcName!=null && (funcName.equalsIgnoreCase("NONE") || funcName.equalsIgnoreCase("DATE")))
										{
											bufRow.append("<td style=\"border:none;text-align:left;padding-left:3px;width:42px;white-space:nowrap\">"+Value+"</td>");
										}
										else
										{
											bufRow.append("<td style=\"border:none;text-align:right;padding-left:3px;width:42px;white-space:nowrap\">"+Value+"</td>");
										}
									}
								}
								else
								{
									if(mes_name!=null && mes_name.equalsIgnoreCase("Cpu_used"))
									{
										usage =false;
										bufRow.append("<td style=\"border:none;text-align:left;padding-left:3px;width:42px;white-space:nowrap\">"+Value+"</td>");
									}
									else if(units!=null && units.equals("%") && !mes_name.equalsIgnoreCase("Ready") && usage)
									{
										bufRow.append("<td style=\"border:none;text-align:left;padding-left:3px;width:42px;white-space:nowrap\">"+Value+"</td>");
									}
									else
									{
										if(funcName!=null && (funcName.equalsIgnoreCase("NONE") || funcName.equalsIgnoreCase("DATE")))
										{
											dataVect.add(Value);
											
											bufRow.append("<td style=\"border:none;text-align:left;padding-left:3px;width:42px;white-space:nowrap\">"+Value+"</td>");
										}
										else
										{
											dataVect.add("("+labelTmpState+")"+Value);
											//bufRow.append("<td style=\"border:none;text-align:right;padding-left:3px;width:42px;white-space:nowrap\"><div class='stateSymbol_"+mes_state+"' style='margin:auto;float:left;display:table-cell'></div>"+Value+"</td>");
											bufRow.append("<td style=\"display:flex;white-space:nowrap;width:100%;border:none\"><div style='display:flex;flex-direction:row;margin:auto auto'><div class='stateSymbol_"+mes_state+"' style='margin:auto 0px auto 0px;'></div><div style='margin:auto auto auto 0px'>"+Value+"</div></div></td>");
										}
									}
								}
							}
							else
							{
								dataVect.add(Value);
								if(isDDDTestColumn || isLocationColumn)
								{
									bufRow.append("<td style=\"border:none;text-align:right;padding-left:3px;padding-right:30px;width:42px;white-space:nowrap\">"+Value+"</td>");
								}
								else
								{
									boolean usage =true;
									if(mes_name!=null && mes_name.equalsIgnoreCase("Cpu_used"))
									{
										bufRow.append("<td style=\"border:none;text-align:center;padding-left:3px;padding-right:30px;width:42px;white-space:nowrap\">"+Value+"</td>");
									}
									else if(units!=null && units.equals("%") && !mes_name.equalsIgnoreCase("Ready") && usage)
									{
										bufRow.append("<td style=\"border:none;text-align:center;padding-left:3px;padding-right:30px;width:42px;white-space:nowrap\">"+Value+"</td>");
									}
									else
									{
										//bufRow.append("<td style=\"border:none;text-align:right;padding-left:3px;width:42px;white-space:nowrap\">"+Value+"</td>");
										bufRow.append("<td style=\"border:none;width:100%;display:flex;white-space:nowrap\"><div style='margin:auto auto'>"+Value+"</div></td>");
									}
								}
							}
										bufRow.append("</tr>");
									bufRow.append("</table>");
								bufRow.append("</td>");
						}
						p++;
					}
				}
				else
				{
					int p=0;
					while(p<measureList.size())
					{
									//bufRow.append("<td style=\"font-size:11px;text-align:right;width:20px;padding-right:10px;!important\" align=\"right\" class=\"x-grid-cell x-grid-cell-gridcolumn x-grid-cell-first\">-</td>"); 
									bufRow.append("<td  style=\"padding-top:4px;\" align=\"center\" >");
										bufRow.append("<table cellspacing=\"0\" cellpadding=\"0\" style=\"table-layout:auto;border:0px solid red\" align=\"left\">");
											bufRow.append("<tr style=\"background:none !important\">");
												//bufRow.append("<td align=\"right\" style=\"font-size:11px;text-align:right;width:20px;padding-right:10px\">");
												//bufRow.append("</td>");
												bufRow.append("<td style=\"text-align:left;border:none;\">");
												bufRow.append("-</td>");
											bufRow.append("</tr>");
										bufRow.append("</table>");
									bufRow.append("</td>");
									dataVect.add("-");
						p++;
					}
				}

				bufRow.append("</tr>");
				
				desktopHtml.put(desktopName+"~!~"+comp,bufRow.toString());
				desktopCSV.put(desktopName+"~!~"+comp,dataVect);
				
			}

			Hashtable formation = new Hashtable();
			ArrayList defaultList = new ArrayList();
			for(int p=0;p<deskTopList.size();p++)
			{
				String deskName = (String)deskTopList.get(p);
				String tmpDesName=deskName;
				String tmpDName="";
				String tmpCName="";
				if(tmpDesName!=null && tmpDesName.length()>0 && tmpDesName.indexOf("~!~")>-1)
				{
					tmpDName=tmpDesName.substring(0,tmpDesName.indexOf("~!~"));
					tmpCName=tmpDesName.substring(tmpDesName.indexOf("~!~")+3);
				}
				else
				{
					tmpDName=tmpDesName;
				}
				if(userRelatedAd != null && userRelatedAd.containsKey("+"+tmpDName)){
					ArrayList adList = (ArrayList)userRelatedAd.get("+"+tmpDName);
					for(int m=0;m<adList.size();m++){
						String adName = (String)adList.get(m);

						if(formation.containsKey(adName)){
							ArrayList userList = (ArrayList)formation.get(adName);
							userList.add(deskName);
							formation.put(adName,userList);
						}else{
							ArrayList userL = new ArrayList();
							userL.add(deskName);
							formation.put(adName,userL);
						}
					}
				}
				else if(userRelatedAd != null && userRelatedAd.containsKey(tmpDName)){
					ArrayList adList = (ArrayList)userRelatedAd.get(tmpDName);
					for(int m=0;m<adList.size();m++){
						String adName = (String)adList.get(m);

						if(formation.containsKey(adName)){
							ArrayList userList = (ArrayList)formation.get(adName);
							userList.add(deskName);
							formation.put(adName,userList);
						}else{
							ArrayList userL = new ArrayList();
							userL.add(deskName);
							formation.put(adName,userL);
						}
					}
				}
				else{
					defaultList.add(deskName);
					if(!aduserFilter.equalsIgnoreCase("All"))
						continue;
				}
			}
			
			boolean checkCase=false;

			if(formation != null && formation.size() > 0 && !defaultAdCase ){
				Iterator it = formation.entrySet().iterator();
				if(aduserFilter == null || aduserFilter.trim().length() == 0)
					aduserFilter="All";
				while(it.hasNext()){
					Entry entry = (Entry)it.next();
					String key = (String)entry.getKey();
					ArrayList value = (ArrayList)entry.getValue();

					if(!aduserFilter.equalsIgnoreCase("All") ){
						if(!aduserFilter.equals(key))
							continue;
					}
					if(value != null && value.size() > 0){
						checkCase = true;
						//buf.append("<tr class='x-grid-row  x-grid-row-alt'><td colspan='"+measuresCount+"' ><span style=\"float:left;\"><img style=\"margin-top:2px;margin-right:3px\" src=\"/final/images/Light/ux_adgroup_user.png\"/></span>"+key+"("+value.size()+")"+"</td></tr>");
						//key="\""+key+"("+value.size()+")"+"\""; 
						//listData.add(key);
						for(int q=0;q<value.size();q++){
							String usName = (String)value.get(q);
							if(desktopHtml != null && desktopHtml.containsKey(usName)){
								String html = (String)desktopHtml.get(usName);
								Vector dataVect = (Vector)desktopCSV.get(usName);
								if(!listData.contains(dataVect))
								{
									buf.append("<tr class='x-grid-row  x-grid-row-alt'><td colspan='"+measuresCount+"' ><span style=\"float:left;\"><img style=\"margin-top:2px;margin-right:3px\" src=\"/final/images/Light/ux_adgroup_user.png\"/></span>"+key+"("+value.size()+")"+"</td></tr>");
									key="\""+key+"("+value.size()+")"+"\""; 
									listData.add(key);
									listData.add(dataVect);
									buf.append(html);
								}
							}
						}
					}

				}
			}

			if(aduserFilter.equalsIgnoreCase("All") ){
				if(defaultList != null && defaultList.size() > 0){
					checkCase = true;
					//buf.append("<tr class='x-grid-row  x-grid-row-alt' style='background:none;' ><td colspan='"+measuresCount+"'> <span style=\"float:left;margin-right:3px\"><img src=\"/final/images/Light/ux_default_user.png\"></span> Default  ("+defaultList.size()+")"+"</td></tr>");
					buf.append("<tr class='x-grid-row  x-grid-row-alt' ><td colspan='"+measuresCount+"' style=\"padding-left:19px\">Default  ("+defaultList.size()+")"+"</td></tr>");

					
					listData.add("Default ("+defaultList.size()+")");
					for(int i=0;i<defaultList.size();i++){
						String defaultdesName = (String)defaultList.get(i);
						if(desktopHtml != null && desktopHtml.containsKey(defaultdesName)){
							String html = (String)desktopHtml.get(defaultdesName);
							Vector dataVect = (Vector)desktopCSV.get(defaultdesName);
							listData.add(dataVect);
							buf.append(html);
						}
					}
				}
			}

								buf.append("</tbody>");	
							buf.append("</table>");
						buf.append("</div>");
					buf.append("</td>");
				buf.append("</tr>");
			buf.append("</table>");
			isDataAvailable = true;
			if(!checkCase){
				buf.delete(0, buf.length());

				buf.append("<table border=\"0\" width=\"100%\" height=\"100%\" bordercolor=\"green\">");
					buf.append("<tr style=\"background:none\">");
						buf.append("<td align=\"center\" width=\"100%\"  height=\"100%\" class=\"commonErrorMsgText\" >");
							buf.append("<img src = \"/final/images/spacer.gif\" class=\"iconInformation\" lign = \"center\" border = \"0\"  vspace = \"10\"/>");
							buf.append("<br>"+mappingInfo.getTextDescription("monitor.endUserDashboard.No Records Found"));
						buf.append("</td>");
					buf.append("</tr>");
				buf.append("</table>");
				isDataAvailable = false;
			}
			//buf.append("</td></tr></table>");
		}
		else if(isEndUserOverview || isFromUEDSort)
		{
			boolean isPriority = false;
			boolean isAllRow = false;
			int locCount = 0;

			String statenames[] = {"HIGH","INTERMEDIATE","LOW","UNKNOWN","GOOD"};
			ArrayList searchUserKeys = new ArrayList();
			if(priority!=null && !priority.equalsIgnoreCase("ALL"))
			{
				groupByUserKeys = (ArrayList)vmDashHelper.getUEDSubList(groupByUserKeys,priority,pageNo);
				isPriority = true;
			}
			if((!isFromUEDSort) && vmDashHelper!=null && TotalMeasureInfo!=null)
				groupByUserKeys = (ArrayList)vmDashHelper.getSortedListForUEDOverview(groupByUserKeys,TotalMeasureInfo,"enduseroverview","Health",orderBy,"Health");
			if(searchString!=null && searchString.trim().length()>0 && !searchString.equalsIgnoreCase("null") && !searchString.equalsIgnoreCase("all"))
			{
				if(groupByUserKeys!=null && groupByUserKeys.size()>0)
				{
					int groupByUserKeysSize = groupByUserKeys.size();
					for(int s=0;s<groupByUserKeysSize;s++)
					{
						String search_key = (String)groupByUserKeys.get(s);
						String search_str = "";
						if(search_key!=null && search_key.trim().length()>0 && !search_key.equalsIgnoreCase("null") && search_key.indexOf("~$~")>-1)
						{
							search_str = search_key.substring(0,search_key.indexOf("~$~"));
						}
						else
						{
							search_str = search_key;
						}
						if(search_str!=null && search_str.trim().length()>0 && !search_str.equalsIgnoreCase("null") && (search_str.trim().toLowerCase().indexOf(searchString.trim().toLowerCase())>-1) && !searchUserKeys.contains(search_key))
							searchUserKeys.add(search_key); 
					}
					groupByUserKeys = searchUserKeys;
				}
			}
			else if(searchString!=null && searchString.trim().length()>0 && searchString.equalsIgnoreCase("all"))
			{
				if(isAllCompAccess)
					searchUserKeys.add("All"); 
				//groupByUserKeys = searchUserKeys;
			}
			else
			{
				//groupByUserKeys.add(0,"All");
				if(isAllCompAccess)
					isAllRow = true;
			}
			if(groupByUserKeys!=null && groupByUserKeys.size()>0)
			{
				locCount = groupByUserKeys.size();
				if(isAllRow)
					locCount = locCount - 1;
			}
			
			String pluralWord = "s";
			String grpByStr = ini.getValue("LOC_USER_DESKTOP_METRICS","Header:"+userType);
			String totGrpByStr = "";
			if(grpByStr!=null && grpByStr.trim().length()>0 && !grpByStr.equalsIgnoreCase("null"))
			{
				if(grpByStr.indexOf(":")>-1 && grpByStr.indexOf(",")>-1)
					grpByStr = grpByStr.substring(grpByStr.indexOf(":")+1,grpByStr.indexOf(","));
				
				totGrpByStr = grpByStr;

				if(grpByStr.endsWith("y"))
				{
					totGrpByStr = totGrpByStr.substring(0,totGrpByStr.lastIndexOf("y"));
					pluralWord = "ies";
				}
			}
			String mainTitle = ""; //mappingInfo.getTextDescription("monitor.endUserDashboard.Users By Location for")+" "+userType;
			if(locCount>0 && (searchString!=null && !searchString.equalsIgnoreCase("all")))
			{
				if(userType!=null && userType.trim().length()>0 && (userType.equalsIgnoreCase("XenApp") || userType.equalsIgnoreCase("XenApp7")))
				{
					mainTitle = mappingInfo.getTextDescription("monitor.endUserDashboard.Citrix User Experience By "+grpByStr+" for"+" "+userType+" (Total "+totGrpByStr+""+pluralWord+": "+locCount+")");
					listData.add(mappingInfo.getTextDescription("monitor.endUserDashboard.Citrix User Experience By "+grpByStr+" for"+" "+userType+" (Total "+totGrpByStr+""+pluralWord+": "+locCount+")"));
				}
				else
				{
					mainTitle = mappingInfo.getTextDescription("monitor.endUserDashboard.User Experience By "+grpByStr+" for"+" "+userType+" (Total "+totGrpByStr+""+pluralWord+": "+locCount+")");
					listData.add(mappingInfo.getTextDescription("monitor.endUserDashboard.User Experience By "+grpByStr+" for"+" "+userType+" (Total "+totGrpByStr+""+pluralWord+": "+locCount+")"));
				}
			}
			else
			{
				if(userType!=null && userType.trim().length()>0 && (userType.equalsIgnoreCase("XenApp") || userType.equalsIgnoreCase("XenApp7")))
				{
					mainTitle = mappingInfo.getTextDescription("monitor.endUserDashboard.Citrix User Experience By "+grpByStr+" for"+" "+userType);
					listData.add(mappingInfo.getTextDescription("monitor.endUserDashboard.Citrix User Experience By "+grpByStr+" for"+" "+userType));
				}
				else
				{
					mainTitle = mappingInfo.getTextDescription("monitor.endUserDashboard.User Experience By "+grpByStr+" for"+" "+userType);
					listData.add(mappingInfo.getTextDescription("monitor.endUserDashboard.User Experience By "+grpByStr+" for"+" "+userType));
				}
			}
			listData.add("");
			buf.append("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" style=\"table-layout:fixed;width:100%;\">");
			buf.append("<tr><td width=\"100%\" align=\"center\" height=\"100%\" valign=\"top\">");
			if(logo!=null && logo.trim().length()>0)
			{
				buf.append("<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\" align=\"center\">");
				buf.append("<tr><td style=\"padding:5px 10px 10px 10px\">");
				buf.append("<img src="+logo+" border=\"0\" /></td></tr></table>");
			}
			buf.append("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\"  style=\"border-bottom:1px solid #999;\">");
			mainTitle=com.egurkha.util.StringUtils.replace(mainTitle,"&#46", ".");
			buf.append("<tr><td style=\"padding:2px\"><div style=\"float:left\" ><header>"+mainTitle+"</header></div></td></tr></table>");
			buf.append("</td></tr></table>");
			
			buf.append("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"left\" style=\"table-layout:fixed;width:100%;\">");
			if(groupByUserKeys!=null && groupByUserKeys.size()>0 &&  finalGroupByUserTab!=null && finalGroupByUserTab.size()>0)
			{
				if(searchString!=null && !searchString.equalsIgnoreCase("NULL") && searchString.trim().length()>0)
				{
					String key = mappingInfo.getTextDescription("monitor.endUserDashboard.Search By ");
					buf.append("<tr><td width=\"100%\">");
					buf.append("<span style=\"float:left\" class=\"formLabel\">"+key+" ("+searchByText+") "+"</span> ");
					buf.append("<span style=\"float:left;width:10px\" align=\"center\" >:</span> ");
					buf.append("<span style=\"float:left;\" class=\"formValue\">"+searchString+"</span></td>");
					listData.add(key+" ("+searchByText+") "+"="+searchString);
				}
				if(adtnlSearchStr!=null && !adtnlSearchStr.equalsIgnoreCase("NULL") && adtnlSearchStr.trim().length()>0)
				{
					String key = mappingInfo.getTextDescription("monitor.endUserDashboard.Additional Search By ");
					buf.append("<tr><td width=\"100%\">");
					buf.append("<span style=\"float:left\" class=\"formLabel\">"+key+" ("+adtnlSearchText+")"+"</span> ");
					buf.append("<span style=\"float:left;width:10px\" align=\"center\" >:</span> ");
					buf.append("<span style=\"float:left;\" class=\"formValue\">"+adtnlSearchStr+"</span></td>");
					listData.add(key+" ("+adtnlSearchText+")"+"="+adtnlSearchStr);
				}

				String currOrderByColumnName = request.getParameter("currOrderByColumn");
				String currOrderByName = request.getParameter("currOrderBy");
				
				if(isFromUEDSort && currOrderByColumnName!=null && !currOrderByColumnName.equalsIgnoreCase("NULL") && currOrderByColumnName.trim().length()>0 && !currOrderByColumnName.equalsIgnoreCase("default"))
				{
					if(columnDispName!=null && columnDispName.trim().length()>0)
					{
						String orderByColText = mappingInfo.getTextDescription("monitor.endUserDashboard.Sort By");
						buf.append("<tr><td><table><tr><td><span style=\"float:left\" class=\"formLabel\">"+orderByColText+"</span> ");
						buf.append("<span style=\"float:left;width:10px\" align=\"center\" >:</span> ");
						buf.append("<span style=\"float:left;\" class=\"formValue\">"+columnDispName+"</span></td>");
						listData.add(orderByColText+"="+columnDispName);

						if(currOrderByName!=null && !currOrderByName.equalsIgnoreCase("NULL") && currOrderByName.trim().length()>0)
						{
							String orderByText = mappingInfo.getTextDescription("monitor.endUserDashboard.Order By");
							if(currOrderByName!=null && currOrderByName.trim().length()>0 && currOrderByName.equalsIgnoreCase("desc"))
							{
								currOrderByName = mappingInfo.getTextDescription("monitor.endUserDashboard.Descending");
							}
							else if(currOrderByName!=null && currOrderByName.trim().length()>0 && currOrderByName.equalsIgnoreCase("asc"))
							{
								currOrderByName = mappingInfo.getTextDescription("monitor.endUserDashboard.Ascending");
							}
							buf.append("<td style=\"padding-left:20px\"><span style=\"float:left\" class=\"formLabel\">"+orderByText+"</span> ");
							buf.append("<span style=\"float:left;width:10px\" align=\"center\" >:</span> ");
							buf.append("<span style=\"float:left;\" class=\"formValue\">"+currOrderByName+"</span></td></tr></table></td>");
							listData.add(orderByText+"="+currOrderByName);
						}
						buf.append("</tr>");
					}
					else
					{
						String sortByDispCol = ini.getValue("USER_DESKTOP_METRICS",userType);
						ArrayList sortByDispColList =  new ArrayList();
						if(sortByDispCol!=null && sortByDispCol.trim().length()>0)
						{
							sortByDispColList = com.egurkha.util.StringUtils.egTokenizer(sortByDispCol,",",false,false,true);//param 3-->includeEmpty,4-->unique,5-->trim
						}
						if(sortByDispColList!=null && sortByDispColList.size()>0)
						{
							String sortByColDispName = "";
							for(int s = 0;s<sortByDispColList.size();s++)
							{
								String colName = (String)sortByDispColList.get(s);
								String tmpTest = colName.substring(0,colName.indexOf(":"));
								String tmpMeasure = "";
								tmpMeasure = colName.substring(colName.indexOf(":")+1);
								if(tmpMeasure!=null && tmpMeasure.trim().length()>0 && tmpMeasure.indexOf(":")>-1)
									tmpMeasure=tmpMeasure.substring(0,tmpMeasure.indexOf(":"));
								String tmpOrderByColName = Dbdata.getColumnForMeasure(tmpTest,tmpMeasure);
								if(tmpOrderByColName!=null && tmpOrderByColName.trim().length()>0 && tmpOrderByColName.equals(currOrderByColumnName))
									sortByColDispName = colName.substring(colName.lastIndexOf(":")+1);
							}
							if(sortByColDispName!=null && !sortByColDispName.equalsIgnoreCase("NULL") && sortByColDispName.trim().length()>0)
							{
								String orderByColText = mappingInfo.getTextDescription("monitor.endUserDashboard.Sort By");
								buf.append("<tr><td><span style=\"float:left\" class=\"formLabel\">"+orderByColText+"</span> ");
								buf.append("<span style=\"float:left;width:10px\" align=\"center\" >:</span> ");
								buf.append("<span style=\"float:left;\" class=\"formValue\">"+sortByColDispName+"</span></td>");

								listData.add(orderByColText+"="+sortByColDispName);

								if(currOrderByName!=null && !currOrderByName.equalsIgnoreCase("NULL") && currOrderByName.trim().length()>0)
								{
									String orderByText = mappingInfo.getTextDescription("monitor.endUserDashboard.Order By");
									if(currOrderByName!=null && currOrderByName.trim().length()>0 && currOrderByName.equalsIgnoreCase("desc"))
									{
										currOrderByName = mappingInfo.getTextDescription("monitor.endUserDashboard.Descending");
									}
									else if(currOrderByName!=null && currOrderByName.trim().length()>0 && currOrderByName.equalsIgnoreCase("asc"))
									{
										currOrderByName = mappingInfo.getTextDescription("monitor.endUserDashboard.Ascending");
									}
									buf.append("<td><span style=\"float:left\" class=\"formLabel\">"+orderByText+"</span> ");
									buf.append("<span style=\"float:left;width:10px\" align=\"center\" >:</span> ");
									buf.append("<span style=\"float:left;\" class=\"formValue\">"+currOrderByName+"</span></td>");
									listData.add(orderByText+"="+currOrderByName);
								}
								buf.append("</tr>");
							}
						}
					}
				}
				listData.add("");
				listData.add("");
				Vector headerVect = new Vector();
				//buf.append("</table>");
				//buf.append("<table  border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\"  height=\"auto\">");
					buf.append("<tr>");
						buf.append("<td colspan=\"3\" width=\"100%\" valign=\"top\" height=\"100%\">");
							buf.append("<div>");
								buf.append("<table style=\"table-layout:fixed\" width=\"100%\" class=\"printTable\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"  valign=\"top\" >");
									buf.append("<thead>");
										buf.append("<tr >");

				String measures=null;
				if(userName!=null && userName.trim().length()>0)
				{
					measures = ini.getValue("LOC_USER_DESKTOP_METRICS","Header:"+userType);
				}
				/*String groupByStr = ini.getValue("LOC_USER_DESKTOP_METRICS",userType+":GroupBy");
				ArrayList groupByList = new ArrayList();
				if(groupByStr!=null && groupByStr.trim().length()>0)
				{
					groupByList = StringUtils.egTokenizer(groupByStr,",",false,true,true);		//param 3-->includeEmpty,4-->unique,5-->trim
				}*/

				String[] measureArray = measures.split(",");
				measuresCount = measureArray.length;
				int colCount = measuresCount+1;

				for(int x=0;x<measureArray.length;x++)
				{
					String tempValue = measureArray[x];
					String tempTest = "";
					String tempMeasure = "";
					String tempLocColName = "";
					String tempDispName = "";
					String locKeyName = "";
					String colName = "";
					ArrayList locColumnsList = null;
					StringTokenizer valTokens = new StringTokenizer(tempValue,":");
					int count = valTokens.countTokens();
					boolean isDDDColumn = false;
					boolean isLocColumn = false;
					boolean isTestColumn = false;
					String meas ="";
					if(valTokens.hasMoreTokens())
					{
						if(count==2)
						{
							tempLocColName = valTokens.nextToken();
							tempDispName = valTokens.nextToken();
							isLocColumn = true;
							meas = "NONE";

							if(x == 0 && searchFilter != null && searchFilter.trim().length() > 0 && !searchFilter.equalsIgnoreCase("All") && !searchFilter.equalsIgnoreCase("null")){
								continue;
							}
							else if(x == 1 && nextSearch != null && nextSearch.trim().length() > 0 && !nextSearch.equalsIgnoreCase("All") && !nextSearch.equalsIgnoreCase("null")){
								continue;
							}
							else if(x == 2 && nextSubSearch != null && nextSubSearch.trim().length() > 0 && !nextSubSearch.equalsIgnoreCase("All") && !nextSubSearch.equalsIgnoreCase("null")){
								continue;
							}
						}
						else if(count==4)
						{
							tempTest = valTokens.nextToken();
							tempMeasure = valTokens.nextToken();
							tempDispName = valTokens.nextToken();
							meas = valTokens.nextToken();
							isDDDColumn = true;
						}
					}

					if(isDDDColumn || isLocColumn)
					{
						String unitForMeasure="";
						String meaUnit="";
						if(isDDDColumn && meas!=null && meas.trim().length()>0)
						{
							unitForMeasure = "("+meas+")";
						}
						
						String orderByColumn = "";
						if(isLocColumn)
						{
							orderByColumn = tempDispName;
						}
						else if (isDDDColumn)
						{
							orderByColumn = Dbdata.getColumnForMeasure(tempTest,tempMeasure);
						}
						else
						{
							orderByColumn = Dbdata.getColumnForMeasure(tempTest,tempMeasure); 
						}
						if(isFromUEDSort && (orderByColumn!=null && orderByColumn.trim().length()>0 && orderByColumnName!=null && orderByColumnName.trim().length()>0 && orderByColumnName.equalsIgnoreCase(orderByColumn)))
						{
							String nextOrderBy="desc";
							String sortImgurl="/final/images/Dark/grid_sort_top.png";
						
							if(orderBy!=null && orderBy.equals("desc"))
							{
								nextOrderBy="asc";
								sortImgurl="/final/images/Dark/grid_sort_down.png";
							}
							else if(orderBy!=null && orderBy.equals("asc"))
							{
								nextOrderBy="desc";
								sortImgurl="/final/images/Dark/grid_sort_top.png";
							}

							if(isLocColumn)
							{
								if(tempDispName!=null && tempDispName.trim().length()>0 && tempDispName.equals("Health"))
								{
									buf.append("<th class=\"printTableHeader\" align=\"center\" wrap >"+tempDispName+"</th>");
									headerVect.add(tempDispName);
								}
								/*else if(tempLocColName!=null && tempLocColName.trim().length()>0 && tempLocColName.equalsIgnoreCase("Total_Users"))
								{
									buf.append("<th class=\"printTableHeader\" align=\"center\" wrap style=\"float:right;padding:3px;\">"+tempDispName+"</th>");
									headerVect.add(tempDispName);
								}*/
								else
								{
									buf.append("<th class=\"printTableHeader\" align=\"center\" wrap style=\"float:right;padding:3px;\">"+tempDispName+"</th>");
									headerVect.add(tempDispName);
								}
							}
							else
							{
								if(unitForMeasure==null || unitForMeasure.equals(""))
								{
									buf.append("<th class=\"printTableHeader\" align=\"center\" wrap style=\"float:right;padding:3px;\">"+tempDispName+"</th>");
									headerVect.add(tempDispName);
								}
								else
								{
									buf.append("<th class=\"printTableHeader\" align=\"center\" wrap style=\"float:right;padding:3px;\">"+tempDispName+"</br> "+unitForMeasure+" </th>");
									headerVect.add(tempDispName+unitForMeasure);
								}
							}
						}
						else
						{
							if(isLocColumn)
							{
								/*if(tempDispName!=null && tempDispName.trim().length()>0 && tempDispName.equals("Health"))
								{
									buf.append("<th class=\"printTableHeader\" align=\"center\" wrap >"+tempDispName+" </th>");
									headerVect.add(tempDispName);
								}
								else if(tempLocColName!=null && tempLocColName.trim().length()>0 && tempLocColName.equalsIgnoreCase("Total_Users"))
								{
									buf.append("<th class=\"printTableHeader\" align=\"center\" wrap >"+tempDispName+" </th>");
									headerVect.add(tempDispName);
								}
								else
								{*/
									buf.append("<th class=\"printTableHeader\" align=\"center\" wrap > "+tempDispName+"</th>");
									headerVect.add(tempDispName);
								//}
							}
							else
							{
								if(unitForMeasure==null || unitForMeasure.equals(""))
								{
									buf.append("<th class=\"printTableHeader\" align=\"center\" wrap > "+tempDispName+" </th>");
									headerVect.add(tempDispName);
								}
								else
								{
									buf.append("<th class=\"printTableHeader\" align=\"center\" wrap > "+tempDispName+"</br> "+unitForMeasure+"</th>");
									headerVect.add(tempDispName+unitForMeasure);
								}
							}
						}
					}
				}
					listData.add(headerVect);
					buf.append("</tr>");
					buf.append("</thead>");
					buf.append("<tbody>");
					
					measureList = Arrays.asList(measureArray);
					int groupByUserKeysSize = groupByUserKeys.size();
					int measureListSize = 0;
					for(int k=0;k<groupByUserKeysSize;k++)
					{
						String usrMeasKey = (String)groupByUserKeys.get(k);
						Vector dataVector = new Vector();
						if(measureList!=null && measureList.size()>0)
						{
							buf.append("<tr style=\"background:none !important\">");
							measureListSize = measureList.size();
							for(int m=0;m<measureListSize;m++)
							{
								String header_str = (String)measureList.get(m);
								String searchFilterVal = (String)measureList.get(0);
								if(searchFilterVal!=null && searchFilterVal.trim().length()>0 && searchFilterVal.indexOf(":")>-1)
									searchFilterVal = searchFilterVal.substring(0,searchFilterVal.indexOf(":"));
								String header_key = "";
								String header_disp = "";
								String tmpKetTest="";
								String tmpKetMeasure="";
								if(header_str!=null && header_str.trim().length()>0 && header_str.indexOf(":")>-1)
								{
									StringTokenizer hTok = new StringTokenizer(header_str.trim(),":");
									if(hTok.countTokens()==4)
									{
										String h_test = hTok.nextToken();
										String h_meas = hTok.nextToken();
										String h_disp = hTok.nextToken();
										String h_fun = hTok.nextToken();
										tmpKetTest=h_test;
										tmpKetMeasure=h_meas;
										header_key = Dbdata.getColumnForMeasure(h_test,h_meas);
									}
									else
									{
										header_key = header_str.substring(0,header_str.indexOf(":"));
									}
								}
								String Value = "";
								String nextSearchVal = "";
								String nextSubSearchVal = nextSubSearch;
								if(finalGroupByUserTab!=null && finalGroupByUserTab.size()>0 && finalGroupByUserTab.containsKey(usrMeasKey+"_"+header_key))
								{
									String measure_val = ""; 
									HashMap state_map = new HashMap();
									if(header_key!=null && header_key.trim().length()>0 && header_key.equals("Health"))
									{
										state_map = (HashMap)finalGroupByUserTab.get(usrMeasKey+"_"+header_key);
										if(usrMeasKey!=null && usrMeasKey.trim().length()>0 && searchFilterVal!=null && finalGroupByUserTab.containsKey(usrMeasKey+"_"+searchFilterVal))
										{
											nextSearchVal = (String)finalGroupByUserTab.get(usrMeasKey+"_"+searchFilterVal);
										}
											if(!isDetailsFromADOnly)
											{
												if(default_Filter!=null && default_Filter.length()>0 && groupByList.contains(default_Filter))
												{
													searchFilterVal =
													(String)finalGroupByUserTab.get(usrMeasKey+"_"+default_Filter);
												}
												else
												{
													searchFilterVal =
													(String)finalGroupByUserTab.get(usrMeasKey+"_"+(String)groupByList.get(0));
												}
												if(tmpSubFilList!=null && tmpSubFilList.size()>0)
												{
													String tmp_Sub_Val=(String)tmpSubFilList.get(0);
													if(tmp_Sub_Val!=null && tmp_Sub_Val.length()>0 && groupByList.contains(tmp_Sub_Val)){
														nextSearchVal = (String)finalGroupByUserTab.get(usrMeasKey+"_"+tmp_Sub_Val);
													}
													else if(groupByList!=null && groupByList.size()>1)
													{
														nextSearchVal = (String)finalGroupByUserTab.get(usrMeasKey+"_"+(String)groupByList.get(1));
													}
															
													String tmp_Sub_Val_2=(String)tmpSubFilList.get(1);
													if(tmp_Sub_Val_2!=null && tmp_Sub_Val_2.length()>0 && groupByList.contains(tmp_Sub_Val_2)){
																
														nextSubSearchVal = (groupByList != null && groupByList.size() > 2)?((String)finalGroupByUserTab.get(usrMeasKey+"_"+tmp_Sub_Val_2)):"";
													}
													else
													{
														nextSubSearchVal = (groupByList != null && groupByList.size() > 2)?((String)finalGroupByUserTab.get(usrMeasKey+"_"+(String)groupByList.get(2))):"";
													}
												}
											}
										StringBuffer htmlStr = new StringBuffer();
										StringBuffer stateStr = new StringBuffer();
										htmlStr.append("<div class=\"healthviewgridbar\" style=\"margin-top:0px;\"><div style=\"display:flex;margin-top:0px;width:100%;margin-bottom:3px;\" class=\"outer12\">");
										//htmlStr.append("<div class=\"healthviewgridbar\" style=\"margin-top:-2px\"><div style=\"margin-top:-2px;width:100%;\" class=\"outer12\">");
										if(state_map!=null && state_map.size()>0 && statenames!=null && statenames.length>0)
										{
											for(int n=0;n<statenames.length;n++)
											{
												String state_key = statenames[n];
												if(state_key!=null && state_key.trim().length()>0 && !state_key.equalsIgnoreCase("null"))
												{
													if(state_map.containsKey(state_key))
													{
														String state_val = (String)state_map.get(state_key);
														String state_color = (String)uiIni.getValue("STATE_COLORS",state_key);
														state_color = (state_color==null||state_color.trim().length()==0||state_color.equalsIgnoreCase("null"))?"0c9a12":state_color;
														
														if(state_val!=null && state_val.trim().length()>0 && state_val.indexOf("^|^")>-1)
														{
															String user_per = state_val.substring(0,state_val.indexOf("^|^"));
															String cnt = state_val.substring(state_val.indexOf("^|^")+3);
															user_per = (user_per==null||user_per.trim().length()==0||user_per.equalsIgnoreCase("null"))?"0":user_per;
															cnt = (cnt==null||cnt.trim().length()==0||cnt.equalsIgnoreCase("null"))?"0":cnt;
															
															htmlStr.append("<div style=\"color:#fff;background:#"+state_color+";text-align:center;width:"+user_per+"%;height:14px;padding-top:2px;float:left;\" class=\"innerLeftRight12\">"+cnt+"</div>");
															stateStr.append(mappingInfo.getLabelDescription(state_key)+"="+cnt+",");
														}
													}
												}
											}
										}
										htmlStr.append("</div><div style=\"clear:both\"></div></div>"); 
										if(htmlStr!=null)
											buf.append("<td style=\"text-align:right;padding:4px 4px 1px 4px;white-space:nowrap;width:400px\">"+htmlStr.toString()+"</td>");
										
										String tmpValStr = "";
										if(stateStr!=null)
										{
											tmpValStr = stateStr.toString();
											if(tmpValStr!=null && tmpValStr.lastIndexOf(",")>-1)
												tmpValStr = tmpValStr.substring(0,tmpValStr.lastIndexOf(","));
											Value = tmpValStr;
										}
										dataVector.add(Value);
									}
									else
									{
										if(groupByList!=null && groupByList.size()>0 && groupByList.contains(header_key))
										{
											Value = (String)finalGroupByUserTab.get(usrMeasKey+"_"+header_key);
											if(Value!=null && Value.trim().length()>0 && Value.indexOf(".")>-1 && Double.parseDouble(Value)>0)
											{
												if(decimalFormatTestMeasureList!=null && decimalFormatTestMeasureList.size()>0 && decimalFormatTestMeasureList.contains(tmpKetTest+":"+tmpKetMeasure))
												{
													Value=String.valueOf(com.egurkha.util.MathUtils.round(Double.parseDouble(Value),4));
												}
												else if(convertToDaysTestMeasureList!=null && convertToDaysTestMeasureList.size()>0 && convertToDaysTestMeasureList.contains(tmpKetTest+":"+tmpKetMeasure))
												{
													Value = getConvertDays(Value,egDashboard);
												}
												else
												{
													Value=String.valueOf(com.egurkha.util.MathUtils.round(Double.parseDouble(Value),2));
												}
											}
											
											if(Value!=null && (Value.equalsIgnoreCase("0.0") || Value.equalsIgnoreCase("0.00")))
											{
												Value="0";
											}
							
											if(Value==null||Value.trim().length()==0||Value.equals("-5.0000")||Value.equalsIgnoreCase("null"))
												Value = "-";
											String drillDownLink = "/final/monitor/endUserDashboard.jsp?access=allusers&user="+userName+"&userType="+userType+"&priority="+priority+"&filterFlag=true&filterBy=All&searchFilter="+header_key+"&nextSearch="+Value+"&fromMenu=true"+"&vdiType="+vdiType+"&enableBackButton=true"+"&overviewsearchstr="+EgURLEncoder.encode(searchString,"UTF-8");

											buf.append("<td class=\"mouse\" align=\"left\" style=\"font-size:11px;text-align:left;padding:4px 0 1px 6px;\" onClick=\"javascript:goToDrillDown('"+drillDownLink+"');\" ><div style=\"cursor:pointer;width:120px;text-align:left;padding-left:5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap\">"+Value+"</div></td>");
										}
										else
										{
											Value = (String)finalGroupByUserTab.get(usrMeasKey+"_"+header_key);
											if(Value!=null && Value.trim().length()>0 && Value.indexOf(".")>-1 && Double.parseDouble(Value)>0)
											{
												if(decimalFormatTestMeasureList!=null && decimalFormatTestMeasureList.size()>0 && decimalFormatTestMeasureList.contains(tmpKetTest+":"+tmpKetMeasure))
												{
													Value=String.valueOf(com.egurkha.util.MathUtils.round(Double.parseDouble(Value),4));
												}
												else if(convertToDaysTestMeasureList!=null && convertToDaysTestMeasureList.size()>0 && convertToDaysTestMeasureList.contains(tmpKetTest+":"+tmpKetMeasure))
												{
													Value = getConvertDays(Value,egDashboard);
												}
												else
												{
													Value=String.valueOf(com.egurkha.util.MathUtils.round(Double.parseDouble(Value),2));
												}
											}
											
											if(Value!=null && (Value.equalsIgnoreCase("0.0") || Value.equalsIgnoreCase("0.00")))
											{
												Value="0";
											}
											
											if(Value==null||Value.trim().length()==0||Value.equals("-5.0000")||Value.equalsIgnoreCase("null"))
												Value = "-";
											buf.append("<td style=\"text-align:center;padding-left:3px;padding-right:10px;padding:4px 0 1px 6px;white-space:nowrap\">"+Value+"</td>");
										}
										dataVector.add(Value);
									}
								}
								else 
								{
									if(Value==null||Value.trim().length()==0||Value.equals("-5.0000")||Value.equalsIgnoreCase("null"))
										Value = "-";
									buf.append("<td style=\"text-align:center;padding-left:3px;padding-right:10px;padding:4px 0 1px 6px;white-space:nowrap\">"+Value+"</td>");
									dataVector.add(Value);
								}
							}
						}
						/*else
						{
							int p=0;
							int measureListSize1 = 0;
							if(measureList!=null)
								measureListSize1 = measureList.size();
							while(p<measureListSize1)
							{
								buf.append("<td  style=\"padding-top:4px;\" align=\"center\" >");
									buf.append("<table cellspacing=\"0\" cellpadding=\"0\" style=\"table-layout:auto;border:0px solid red\" align=\"left\">");
										buf.append("<tr style=\"background:none !important\">");
											buf.append("<td style=\"text-align:left;border:none;\">");
											buf.append("-</td>");
										buf.append("</tr>");
									buf.append("</table>");
								buf.append("</td>");
								p++;
								dataVector.add("-");
							}
						}*/
						buf.append("</tr>");
						listData.add(dataVector);
					}
									buf.append("</tbody>");
								buf.append("</table>");
							buf.append("</div>");
						buf.append("</td>");
					buf.append("</tr>");
				buf.append("</table>");
			}
			else
			{
				int col_span=measureList.size();
				buf.append("<table border=\"0\" width=\"100%\" height=\"100%\" bordercolor=\"green\">");
					buf.append("<tr style=\"background:none\">");
						buf.append("<td align=\"center\" width=\"100%\" colspan=\""+col_span+"\" height=\"100%\" class=\"commonErrorMsgText\" >");
							buf.append("<img src = \"/final/images/spacer.gif\" class=\"iconInformation\" lign = \"center\" border = \"0\"  vspace = \"10\"/>");
							buf.append("<br>"+mappingInfo.getTextDescription("monitor.endUserDashboard.No Records Found"));
						buf.append("</td>");
					buf.append("</tr>");
				buf.append("</table>");
			}
		}
		else if((!isEndUserOverview) && (!isFromUEDSort))
		{
			//String mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.User Experience Dashboard for "+userType);
			String mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.User Experience Overview for "+userType);
			if(showKeyUser && isKeyUserUED)
			{
				mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.User Experience Overview for High Profile "+userType+" Users");
			}
			/*if(userType!=null && userType.equals("ESX"))
			{
				mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.Performance Metrics for VMs");
			}*/
			//String countHeader = (userType.equals("XenApp7") || userType.equals("XenApp"))?"Unique Users":"Unique Users/Desktops";
			if(check_Header_DispName && userTotalCount>0)
			{
				if(showKeyUser && isKeyUserUED)
				{
					if(userType!=null && userType.equalsIgnoreCase("VDI"))
					{
						String countHeader = (skipDesktopsForUserType!=null && skipDesktopsForUserType.equalsIgnoreCase("true"))?"Unique Users":"Unique Users/Desktops";
						mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.User Experience Overview for High Profile "+userType+" Users ("+countHeader+": "+userTotalCount+")");
					}
					else if(userType!=null && (userType.equalsIgnoreCase("XenApp") || userType.equalsIgnoreCase("XenApp7")))
					{
						String countHeader = (isFromGeo && (selectedMeasure!=null && selectedMeasure.trim().length()>0 && selectedMeasure.equalsIgnoreCase("UniqueSessionCount")))?"Sessions":"Unique Users";
						mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.User Experience Overview for High Profile "+userType+" Users ("+countHeader+": "+userTotalCount+")");
					}
					else
					{
						mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.User Experience Overview for High Profile "+userType+" Users (Total users: "+userTotalCount+")");
					}
				}
				else
				{
					if(userType!=null && userType.equalsIgnoreCase("ESX"))
					{
						mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.Performance Metrics for VMs (Total VMs : "+userTotalCount+")");
					}
					else if(userType!=null && userType.equalsIgnoreCase("VCDataStore"))
					{
						mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.VC - Datastores View (Total Datastores : "+userTotalCount+")");
					}
					else if(userType!=null && userType.equalsIgnoreCase("VDIESX"))
					{
						String countHeader = "Total Users/VMs";
						mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.Users/Desktops Overview for Datastore")+" '"+showDSInfo+"' - ("+countHeader+": "+userTotalCount+")";
					}
					else if(userType!=null && userType.equalsIgnoreCase("VDI"))
					{
						String countHeader = (skipDesktopsForUserType!=null && skipDesktopsForUserType.equalsIgnoreCase("true"))?"Unique Users":"Unique Users/Desktops";
						mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.User Experience Overview for "+userType+" ("+countHeader+": "+userTotalCount+")");
					}
					else if(userType!=null && (userType.equals("AppXenApp7") || userType.equals("AppDDXenApp7") || userType.equals("AppLaunchDDXenApp7") || userType.equals("OverviewAppXenApp7")))
					{
						String countHeader="Unique Applications";
						String text_UserType = "XenApp7";

						if(userType.equals("OverviewAppXenApp7"))
						{
							mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.Applications Statistics for "+text_UserType+" ("+countHeader+": "+userTotalCount+")");
						}
						else if(userType.equals("AppXenApp7") && overviewType!=null && overviewType.equals("OverviewAppXenApp7") && searchString!=null && searchString.trim().length()>0)
						{
							mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.Users using '"+searchString.replace(".","&#46")+"' Application for "+text_UserType);
						}
						else
						{
							mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.Applications Overview for "+text_UserType+" ("+countHeader+": "+userTotalCount+")");
						}
					}
					else if(userType!=null && (userType.equals("AppVDI") || userType.equals("AppDDVDI") || userType.equals("OverviewAppVDI"))){
						String countHeader="Unique Applications";
						String text_UserType = "VDI";

						if(userType.equals("OverviewAppVDI"))
						{
							mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.Applications Statistics for "+text_UserType+" ("+countHeader+": "+userTotalCount+")");
						}
						else if(userType.equals("AppVDI") && overviewType!=null && overviewType.equals("OverviewAppVDI") && searchString!=null && searchString.trim().length()>0)
						{
							mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.Users using '"+searchString.replace(".","&#46")+"' Application for "+text_UserType);
						}
						else
						{
							mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.Applications Overview for "+text_UserType+" ("+countHeader+": "+userTotalCount+")");
						}
					}
					else if(userType!=null && (userType.equalsIgnoreCase("XenApp") || userType.equalsIgnoreCase("XenApp7")))
					{
						String countHeader = (isFromGeo && (selectedMeasure!=null && selectedMeasure.trim().length()>0 && selectedMeasure.equalsIgnoreCase("UniqueSessionCount")))?"Sessions":"Unique Users";
						mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.User Experience Overview for "+userType+" ("+countHeader+": "+userTotalCount+")");
					}
					else
					{
						mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.User Experience Overview for "+userType+" (Total users: "+userTotalCount+")");
					}
				}
			}
			else if(check_Header_DispName && vdiDesktopsListTotalCount>0)
			{
				/*if(userType!=null && userType.equals("ESX"))
				{
					mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.Performance Metrics for VMs (Total VMs : "+vdiDesktopsListTotalCount+")");
				}
				else
				{
					mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.User Experience Overview for "+userType+" ("+countHeader+" : "+vdiDesktopsListTotalCount+")");
				}*/

				if(showKeyUser && isKeyUserUED)
				{
					if(userType!=null && userType.equalsIgnoreCase("VDIESX"))
					{
						String countHeader = "Total Users/VMs";
						mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.Users/Desktops Overview for Datastore")+" '"+showDSInfo+"' - ("+countHeader+": "+vdiDesktopsListTotalCount+")";
					}
					else if(userType!=null && userType.equalsIgnoreCase("VDI"))
					{
						String countHeader = (skipDesktopsForUserType!=null && skipDesktopsForUserType.equalsIgnoreCase("true"))?"Unique Users":"Unique Users/Desktops";
						mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.User Experience Overview for High Profile "+userType+" Users ("+countHeader+": "+vdiDesktopsListTotalCount+")");
					}
					else if(userType!=null && (userType.equalsIgnoreCase("XenApp") || userType.equalsIgnoreCase("XenApp7")))
					{
						String countHeader = (isFromGeo && (selectedMeasure!=null && selectedMeasure.trim().length()>0 && selectedMeasure.equalsIgnoreCase("UniqueSessionCount")))?"Sessions":"Unique Users";
						mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.User Experience Overview for High Profile "+userType+" Users ("+countHeader+": "+vdiDesktopsListTotalCount+")");
					}
					else
					{
						mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.User Experience Overview for High Profile "+userType+" Users (Total users: "+vdiDesktopsListTotalCount+")");
					}
				}
				else
				{
					if(userType!=null && userType.equalsIgnoreCase("ESX"))
					{
						mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.Performance Metrics for VMs (Total VMs : "+vdiDesktopsListTotalCount+")");
					}
					else if(userType!=null && userType.equalsIgnoreCase("VCDataStore"))
					{
						mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.VC - Datastores View (Total Datastores : "+vdiDesktopsListTotalCount+")");
					}
					else if(userType!=null && userType.equalsIgnoreCase("VDIESX"))
					{
						String countHeader = "Total Users/VMs";
						mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.Users/Desktops Overview for Datastore")+" '"+showDSInfo+"' - ("+countHeader+": "+vdiDesktopsListTotalCount+")";
					}
					else if(userType!=null && userType.equalsIgnoreCase("VDI"))
					{
						String countHeader = (skipDesktopsForUserType!=null && skipDesktopsForUserType.equalsIgnoreCase("true"))?"Unique Users":"Unique Users/Desktops";
						mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.User Experience Overview for "+userType+" ("+countHeader+": "+vdiDesktopsListTotalCount+")");
					}
					else if(userType!=null && (userType.equals("AppVDI") || userType.equals("AppDDVDI") || userType.equals("OverviewAppVDI"))){
						String countHeader="Unique Applications";
						String text_UserType = "VDI";

						if(userType.equals("OverviewAppVDI"))
						{
							mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.Applications Statistics for "+text_UserType+" ("+countHeader+": "+vdiDesktopsListTotalCount+")");
						}
						else if(userType.equals("AppVDI") && overviewType!=null && overviewType.equals("OverviewAppVDI") && searchString!=null && searchString.trim().length()>0)
						{
							mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.Users using '"+searchString.replace(".","&#46")+"' Application for "+text_UserType);
						}
						else
						{
							mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.Applications Overview for "+text_UserType+" ("+countHeader+": "+vdiDesktopsListTotalCount+")");
						}
					}
					else if(userType!=null && (userType.equals("AppXenApp7") || userType.equals("AppDDXenApp7") || userType.equals("AppLaunchDDXenApp7") || userType.equals("OverviewAppXenApp7")))
					{
						String countHeader="Unique Applications";
						String text_UserType = "XenApp7";
						if(userType.equals("OverviewAppXenApp7"))
						{
							mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.Applications Statistics for "+text_UserType+" ("+countHeader+": "+vdiDesktopsListTotalCount+")");
						}
						else if(userType.equals("AppXenApp7") && overviewType!=null && overviewType.equals("OverviewAppXenApp7") && searchString!=null && searchString.trim().length()>0)
						{
							mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.Users using '"+searchString.replace(".","&#46")+"' Application for "+text_UserType);
						}
						else
						{
							mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.Applications Overview for "+text_UserType+" ("+countHeader+": "+vdiDesktopsListTotalCount+")");
						}
					}
					else if(userType!=null && (userType.equalsIgnoreCase("XenApp") || userType.equalsIgnoreCase("XenApp7")))
					{
						String countHeader = (isFromGeo && (selectedMeasure!=null && selectedMeasure.trim().length()>0 && selectedMeasure.equalsIgnoreCase("UniqueSessionCount")))?"Sessions":"Unique Users";
						mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.User Experience Overview for "+userType+" ("+countHeader+": "+vdiDesktopsListTotalCount+")");
					}
					else
					{
						mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.User Experience Overview for "+userType+" (Total users: "+vdiDesktopsListTotalCount+")");
					}
				}
			}
			else
			{
				if(showKeyUser && isKeyUserUED)
				{
					mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.User Experience Overview for High Profile "+userType+" Users");
				}
				else
				{
					if(userType!=null && userType.equalsIgnoreCase("ESX"))
					{
						mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.Performance Metrics for VMs (Total VMs : "+vdiDesktopsListTotalCount+")");
					}
					else if(userType!=null && userType.equalsIgnoreCase("VCDataStore"))
					{
						mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.VC - Datastores View (Total Datastores : "+vdiDesktopsListTotalCount+")");
					}
					else if(userType!=null && userType.equalsIgnoreCase("VDIESX"))
					{
						String countHeader = "Total Users/VMs";
						mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.Users/Desktops Overview for Datastore")+" '"+showDSInfo+"' - ("+countHeader+": "+vdiDesktopsListTotalCount+")";
					}
					else if(userType!=null && (userType.equals("AppXenApp7") || userType.equals("AppDDXenApp7") || userType.equals("AppLaunchDDXenApp7") || userType.equals("OverviewAppXenApp7")))
					{
						String countHeader="Unique Applications";
						String text_UserType = "XenApp7";
						if(userType.equals("OverviewAppXenApp7"))
						{
							mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.Applications Statistics for "+text_UserType+" ("+countHeader+": "+vdiDesktopsListTotalCount+")");
						}
						else if(userType.equals("AppXenApp7") && overviewType!=null && overviewType.equals("OverviewAppXenApp7") && searchString!=null && searchString.trim().length()>0)
						{
							mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.Users using '"+searchString.replace(".","&#46")+"' Application for "+text_UserType);
						}
						else
						{
							mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.Applications Overview for "+text_UserType+" ("+countHeader+": "+vdiDesktopsListTotalCount+")");
						}
					}
					else if(userType!=null && (userType.equals("AppVDI") || userType.equals("AppDDVDI") || userType.equals("OverviewAppVDI"))){
						String countHeader="Unique Applications";
						String text_UserType = "VDI";

						if(userType.equals("OverviewAppVDI"))
						{
							mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.Applications Statistics for "+text_UserType+" ("+countHeader+": "+vdiDesktopsListTotalCount+")");
						}
						else if(userType.equals("AppVDI") && overviewType!=null && overviewType.equals("OverviewAppVDI") && searchString!=null && searchString.trim().length()>0)
						{
							mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.Users using '"+searchString.replace(".","&#46")+"' Application for "+text_UserType);
						}
						else
						{
							mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.Applications Overview for "+text_UserType+" ("+countHeader+": "+vdiDesktopsListTotalCount+")");
						}
					}
					else 
					{
						mainTitle=mappingInfo.getTextDescription("monitor.endUserDashboard.User Experience Overview for "+userType);
					}
				}
			}
			mainTitle=com.egurkha.util.StringUtils.replace(mainTitle,"&#46", ".");
			listData.add(mainTitle);

			/*//listData.add(mappingInfo.getTextDescription("monitor.endUserDashboard.User Experience Dashboard for "+userType));
			if(check_Header_DispName && vdiDesktopsListTotalCount>0)
			{
				if(userType!=null && userType.equals("ESX"))
				{
					listData.add(mappingInfo.getTextDescription("monitor.endUserDashboard.Performance Metrics for VMs (Total VMs : "+vdiDesktopsListTotalCount+")"));
				}
				else
				{
					listData.add(mappingInfo.getTextDescription("monitor.endUserDashboard.User Experience Overview for "+userType+" ("+countHeader+": "+vdiDesktopsListTotalCount+")"));
				}
			}
			else
			{
				if(userType!=null && userType.equals("ESX"))
				{
					listData.add(mappingInfo.getTextDescription("monitor.endUserDashboard.Performance Metrics for VMs"));
				}
				else
				{
					listData.add(mappingInfo.getTextDescription("monitor.endUserDashboard.User Experience Overview for "+userType));
				}
			}*/
			listData.add("");

			buf.append("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" style=\"table-layout:fixed;width:100%;\">");
			buf.append("<tr><td width=\"100%\" align=\"center\" height=\"100%\" valign=\"top\">");
			if(logo!=null && logo.trim().length()>0)
			{
				buf.append("<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\" align=\"center\">");
				buf.append("<tr><td style=\"padding:5px 10px 10px 10px\">");
				buf.append("<img src="+logo+" border=\"0\" /></td></tr></table>");
			}
			buf.append("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\"  style=\"border-bottom:1px solid #999;\">");
			buf.append("<tr><td style=\"padding:2px\"><div style=\"float:left\" ><header>"+mainTitle+"</header></div></td></tr></table>");
			buf.append("</td></tr></table>");
			
			buf.append("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"left\" style=\"table-layout:fixed;width:100%;\">");
			
			if(searchString!=null && !searchString.equalsIgnoreCase("NULL") && searchString.trim().length()>0)
			{
				String key = mappingInfo.getTextDescription("monitor.endUserDashboard.Search By ");
				buf.append("<tr><td width=\"100%\">");
				buf.append("<span style=\"float:left\" class=\"formLabel\">"+key+" ("+searchByText+") "+"</span> ");
				buf.append("<span style=\"float:left;width:10px\" align=\"center\" >:</span> ");
				buf.append("<span style=\"float:left;\" class=\"formValue\">"+searchString+"</span></td></tr>");
				listData.add(key+" ("+searchByText+") "+"="+searchString);
			}
			if(adtnlSearchStr!=null && !adtnlSearchStr.equalsIgnoreCase("NULL") && adtnlSearchStr.trim().length()>0)
			{
				String key = mappingInfo.getTextDescription("monitor.endUserDashboard.Additional Search By ");
				buf.append("<tr><td width=\"100%\">");
				buf.append("<span style=\"float:left\" class=\"formLabel\">"+key+" ("+adtnlSearchText+")"+"</span> ");
				buf.append("<span style=\"float:left;width:10px\" align=\"center\" >:</span> ");
				buf.append("<span style=\"float:left;\" class=\"formValue\">"+adtnlSearchStr+"</span></td></tr>");
				listData.add(key+" ("+adtnlSearchText+")"+"="+adtnlSearchStr);
			}

			String currOrderByColumnName = request.getParameter("currOrderByColumn");
			String currOrderByName = request.getParameter("currOrderBy");
			if(currOrderByColumnName!=null && !currOrderByColumnName.equalsIgnoreCase("NULL") && currOrderByColumnName.trim().length()>0 && !currOrderByColumnName.equalsIgnoreCase("default"))
			{
				if(columnDispName!=null && columnDispName.trim().length()>0)
				{
					String orderByColText = mappingInfo.getTextDescription("monitor.endUserDashboard.Sort By");
					buf.append("<tr><td><span style=\"float:left\" class=\"formLabel\">"+orderByColText+"</span> ");
					buf.append("<span style=\"float:left;width:10px\" align=\"center\" >:</span> ");
					buf.append("<span style=\"float:left;\" class=\"formValue\">"+columnDispName+"</span></td>");
					listData.add(orderByColText+"="+columnDispName);

					if(currOrderByName!=null && !currOrderByName.equalsIgnoreCase("NULL") && currOrderByName.trim().length()>0)
					{
						String orderByText = mappingInfo.getTextDescription("monitor.endUserDashboard.Order By");
						if(currOrderByName!=null && currOrderByName.trim().length()>0 && currOrderByName.equalsIgnoreCase("desc"))
						{
							currOrderByName = mappingInfo.getTextDescription("monitor.endUserDashboard.Descending");
						}
						else if(currOrderByName!=null && currOrderByName.trim().length()>0 && currOrderByName.equalsIgnoreCase("asc"))
						{
							currOrderByName = mappingInfo.getTextDescription("monitor.endUserDashboard.Ascending");
						}
						buf.append("<td><span style=\"float:left\" class=\"formLabel\">"+orderByText+"</span> ");
						buf.append("<span style=\"float:left;width:10px\" align=\"center\" >:</span> ");
						buf.append("<span style=\"float:left;\" class=\"formValue\">"+currOrderByName+"</span></td>");
						listData.add(orderByText+"="+currOrderByName);
					}
					buf.append("</tr>");
				}
				else
				{
					String sortByDispCol = ini.getValue("USER_DESKTOP_METRICS",userType);
					ArrayList sortByDispColList =  new ArrayList();
					if(sortByDispCol!=null && sortByDispCol.trim().length()>0)
					{
						sortByDispColList = com.egurkha.util.StringUtils.egTokenizer(sortByDispCol,",",false,false,true);//param 3-->includeEmpty,4-->unique,5-->trim
					}
					if(sortByDispColList!=null && sortByDispColList.size()>0)
					{
						String sortByColDispName = "";
						for(int s = 0;s<sortByDispColList.size();s++)
						{
							String colName = (String)sortByDispColList.get(s);
							String tmpTest = colName.substring(0,colName.indexOf(":"));
							String tmpMeasure = "";
							tmpMeasure = colName.substring(colName.indexOf(":")+1);
							if(tmpMeasure!=null && tmpMeasure.trim().length()>0 && tmpMeasure.indexOf(":")>-1)
								tmpMeasure=tmpMeasure.substring(0,tmpMeasure.indexOf(":"));
							String tmpOrderByColName = Dbdata.getColumnForMeasure(tmpTest,tmpMeasure);
							if(tmpOrderByColName!=null && tmpOrderByColName.trim().length()>0 && tmpOrderByColName.equals(currOrderByColumnName))
								sortByColDispName = colName.substring(colName.lastIndexOf(":")+1);
						}
						if(sortByColDispName!=null && !sortByColDispName.equalsIgnoreCase("NULL") && sortByColDispName.trim().length()>0)
						{
							String orderByColText = mappingInfo.getTextDescription("monitor.endUserDashboard.Sort By");
							buf.append("<tr><td><span style=\"float:left\" class=\"formLabel\">"+orderByColText+"</span> ");
							buf.append("<span style=\"float:left;width:10px\" align=\"center\" >:</span> ");
							buf.append("<span style=\"float:left;\" class=\"formValue\">"+sortByColDispName+"</span></td>");

							listData.add(orderByColText+"="+sortByColDispName);

							if(currOrderByName!=null && !currOrderByName.equalsIgnoreCase("NULL") && currOrderByName.trim().length()>0)
							{
								String orderByText = mappingInfo.getTextDescription("monitor.endUserDashboard.Order By");
								if(currOrderByName!=null && currOrderByName.trim().length()>0 && currOrderByName.equalsIgnoreCase("desc"))
								{
									currOrderByName = mappingInfo.getTextDescription("monitor.endUserDashboard.Descending");
								}
								else if(currOrderByName!=null && currOrderByName.trim().length()>0 && currOrderByName.equalsIgnoreCase("asc"))
								{
									currOrderByName = mappingInfo.getTextDescription("monitor.endUserDashboard.Ascending");
								}
								buf.append("<td><span style=\"float:left\" class=\"formLabel\">"+orderByText+"</span> ");
								buf.append("<span style=\"float:left;width:10px\" align=\"center\" >:</span> ");
								buf.append("<span style=\"float:left;\" class=\"formValue\">"+currOrderByName+"</span></td>");
								listData.add(orderByText+"="+currOrderByName);
							}
							buf.append("</tr>");
						}
					}
				}
			}
			
			boolean checkOnlyVmCase = false;
			if((userType!=null && !userType.equalsIgnoreCase("VDIESX")) && ((filterBy != null && filterBy.trim().length() > 0) || (searchFilter != null && searchFilter.trim().length() > 0) || (nextSearch != null && nextSearch.trim().length() > 0 && !nextSearch.trim().equals("-1"))))
			{
				buf.append("<tr>");
				if(user.isOnlyVMAssigned() && compDispName != null && compDispName.trim().length()>0 && compDispName.indexOf("Component") > -1)
					checkOnlyVmCase = true;
				
				if(!checkOnlyVmCase && filterBy != null && filterBy.trim().length() > 0)
				{
					String zoneName = mappingInfo.getTextDescription("monitor.endUserDashboard.Zone");
					if(compDispName != null && compDispName.trim().length()>0 && !compDispName.equalsIgnoreCase("NULL"))
						zoneName = compDispName;
					else if(detail!=null && detail.trim().length()>0 && !detail.equalsIgnoreCase("NULL"))
						zoneName = detail;
					buf.append("<td><span style=\"float:left\" class=\"formLabel\">"+zoneName+"</span> ");
					buf.append("<span style=\"float:left;width:10px\" align=\"center\" >:</span> ");
					//buf.append("<span style=\"float:left;\" class=\"formValue\">"+filterBy+"</span></td>");
					//listData.add(zoneName+"="+filterBy);
					if(detail!=null && detail.trim().length()>0 && detail.equalsIgnoreCase("componentType"))
						detail = "Component";
					if(detail!=null && detail.trim().length()>0 && detail.equalsIgnoreCase("Component"))
					{
						String compNameDisp = "";
						if(compCombo!=null && compCombo.trim().length()>0)
						{
							ArrayList compComboList = StringUtils.egTokenizer(compCombo,",",true,false,true);//param 3-->includeEmpty,4-->unique,5-->trim
							for(int b=0;b<compComboList.size();b++)
							{
								String multiComp = (String)compComboList.get(b);
								if(multiComp.indexOf(":")!=-1)
									multiComp = multiComp.substring(compCombo.indexOf(":")+1);
								if(multiComp!=null && multiComp.endsWith(":NULL"))
									multiComp = multiComp.substring(0,multiComp.indexOf(":NULL"));
								if(b>0)
									compNameDisp = compNameDisp +","+multiComp;
								else
									compNameDisp = multiComp;
							}
							if(compNameDisp.endsWith(","))
								compNameDisp = compNameDisp.substring(0,compNameDisp.lastIndexOf(","));
						}
						//buf.append("<span style=\"float:left;\" class=\"formValue\">"+mappingInfo.getComponentTypeDescription(filterBy)+" - "+compNameDisp+"</span></td>");
						//jp
						if(compNameDisp != null && compNameDisp.trim().length()>0){
							if(showComFilter){
								buf.append("<span style=\"float:left;\" class=\"formValue\">"+compNameDisp+"</span></td>");
								listData.add(zoneName+"="+compNameDisp);
							}
							else{
								buf.append("<span style=\"float:left;\" class=\"formValue\">"+mappingInfo.getComponentTypeDescription(filterBy)+" - "+compNameDisp+"</span></td>");
								listData.add(zoneName+"="+mappingInfo.getComponentTypeDescription(filterBy)+" - "+compNameDisp);
							}
						}else{
							if(showComFilter && compCombo!=null && compCombo.equals("All"))
								filterBy="All";
							buf.append("<span style=\"float:left;\" class=\"formValue\">"+mappingInfo.getComponentTypeDescription(filterBy)+"</span></td>");
							listData.add(zoneName+"="+mappingInfo.getComponentTypeDescription(filterBy));
						}
					}
					else
					{
						buf.append("<span style=\"float:left;\" class=\"formValue\">"+filterBy+"</span></td>");
						listData.add(zoneName+"="+filterBy);
					}
				}
				String filterByStr = mappingInfo.getTextDescription("monitor.endUserDashboard.Filter By");
				if(isdefaultFilter && searchFilter != null && searchFilter.trim().length() > 0 && !searchFilter.equalsIgnoreCase("NULL")){
					/*String filterByLoc = "";
					if(isDetailsFromADOnly)
						filterByLoc = mappingInfo.getTextDescription("monitor.endUserDashboard.Filter By");
					else
						filterByLoc = filterlabel1;*/

					if(!isDetailsFromADOnly)
						filterByStr = filterlabel1;
					buf.append(getLabel(filterByStr,searchFilter));
					//buf.append("<td><span style=\"float:left\" class=\"formLabel\">"+filterByStr+"</span> ");
					//buf.append("<span style=\"float:left;width:10px\" align=\"center\" >:</span> ");
					//buf.append("<span style=\"float:left;\" class=\"formValue\">"+searchFilter+"</span></td>");

					//buf.append("<td><span style=\"float:left\" class=\"formLabel\">"+filterByStr+"</span> ");
						//buf.append("<span style=\"float:left;width:10px\" align=\"center\" >:</span> ");
						//buf.append("<span style=\"float:left;\" class=\"formValue\">"+searchFilter+"</span></td>");

					listData.add(filterByStr+"="+searchFilter);
				}

				if(istmpSubFilter && nextSearch != null && nextSearch.trim().length() > 0 && !nextSearch.trim().equals("-1") && !nextSearch.equalsIgnoreCase("null")){
					/*String filterByLoc = "";
					if(isDetailsFromADOnly)
						filterByLoc = mappingInfo.getTextDescription("monitor.endUserDashboard."+searchFilter);
					else
						filterByLoc = filterlabel2;*/
						
					String searchFilterStr = mappingInfo.getTextDescription("monitor.endUserDashboard."+searchFilter);
					//if(isShowSeparateFilters && nextSearchFilDispTxt!=null && nextSearchFilDispTxt.trim().length()>0 && !nextSearchFilDispTxt.equalsIgnoreCase("NULL"))
					//	searchFilterStr = mappingInfo.getTextDescription("monitor.endUserDashboard."+nextSearchFilDispTxt);
					if(!isDetailsFromADOnly)
						searchFilterStr = filterlabel2;
					buf.append(getLabel(searchFilterStr,nextSearch));
					//buf.append("<td><span style=\"float:left\" class=\"formLabel\">"+searchFilterStr+"</span> ");
					//buf.append("<span style=\"float:left;width:10px\" align=\"left\" >:</span> ");
					//buf.append("<span style=\"float:left;\" class=\"formValue\">"+nextSearch+"</span></td>");

					listData.add(searchFilterStr+"="+nextSearch);
				}

				if(istmpnextSubFilter && nextSubSearch != null && nextSubSearch.trim().length() > 0 && !nextSubSearch.trim().equals("-1") && !nextSubSearch.equalsIgnoreCase("null") && filterlabel3 != null && filterlabel3.trim().length() > 0){
					String filterByLoc = "";
					if(isDetailsFromADOnly)
						filterByLoc = mappingInfo.getTextDescription("monitor.endUserDashboard."+nextSearch);
					else
						filterByLoc = filterlabel3;
					buf.append(getLabel(filterByLoc,nextSubSearch));
					//buf.append("<td><span style=\"float:left\" class=\"formLabel\">"+filterByLoc+"</span> ");
					//buf.append("<span style=\"float:left;width:10px\" align=\"left\" >:</span> ");
					//buf.append("<span style=\"float:left;\" class=\"formValue\">"+nextSubSearch+"</span></td>");

					listData.add(filterByLoc+"="+nextSubSearch);
				}
				if(priorityFilter != null && priorityFilter.trim().length() > 0 && !priorityFilter.trim().equals("-1") && !priorityFilter.trim().equals("NULL")){
					String filterByLoc = mappingInfo.getTextDescription("monitor.endUserDashboard.Priority");
					buf.append(getLabel(filterByLoc,mappingInfo.getLabelDescription(priorityFilter)));
					//buf.append("<td><span style=\"float:left\" class=\"formLabel\">"+filterByLoc+"</span> ");
					//buf.append("<span style=\"float:left;width:10px\" align=\"left\" >:</span> ");
					//buf.append("<span style=\"float:left;\" class=\"formValue\">"+mappingInfo.getLabelDescription(priorityFilter)+"</span></td>");
					
					listData.add(filterByLoc+"="+mappingInfo.getLabelDescription(priorityFilter));
				}
				if(gatewayFilter != null && gatewayFilter.trim().length() > 0 && !gatewayFilter.trim().equals("-1") && !gatewayFilter.trim().equals("NULL") && !userType.equals("OverviewAppVDI") && !userType.equals("AppVDI") && !userType.equals("AppDDVDI") && !userType.equals("AppXenApp7") && !userType.equals("OverviewAppXenApp7") && !userType.equals("AppDDXenApp7") && !userType.equals("AppLaunchDDXenApp7"))
				{
					String filterByLoc = mappingInfo.getTextDescription("monitor.endUserDashboard.Gateway");
					buf.append(getLabel(filterByLoc,mappingInfo.getLabelDescription(gatewayFilter)));
					//buf.append("<td><span style=\"float:left\" class=\"formLabel\">"+filterByLoc+"</span> ");
					//buf.append("<span style=\"float:left;width:10px\" align=\"left\" >:</span> ");
					//buf.append("<span style=\"float:left;\" class=\"formValue\">"+mappingInfo.getLabelDescription(gatewayFilter)+"</span></td>");
					
					listData.add(filterByLoc+"="+mappingInfo.getLabelDescription(gatewayFilter));
				}
				
				buf.append("</tr>");
			}

			listData.add("");
			listData.add("");
			Vector headerVect = new Vector();
			buf.append("</table>");
			buf.append("<table  border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\"  height=\"auto\"><tr>");
					buf.append("<td width=\"100%\" valign=\"top\" height=\"100%\">");
						buf.append("<div>");
							buf.append("<table class=\"printTable\" width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"  valign=\"top\" ><thead><tr >");
									/*if(!orderByCol_flag)
									{
										//buf.append("<td class=\"printTableHeader\" align=\"center\" wrap >"+mappingInfo.getTextDescription("monitor.VirtualDashboard.Users/Desktops")+"</td>");

										if(userType!=null && userType.equalsIgnoreCase("VDI"))
											buf.append("<th class=\"printTableHeader\" align=\"center\" wrap >"+mappingInfo.getTextDescription("monitor.VirtualDashboard.Users/Desktops")+"</th>");
										else if(userType!=null && userType.equalsIgnoreCase("ESX"))
											buf.append("<th class=\"printTableHeader\" align=\"center\" wrap >"+mappingInfo.getTextDescription("monitor.VirtualDashboard.VMs")+"</th>");
										else if(userType!=null && userType.equalsIgnoreCase("VCDataStore"))
											buf.append("<th class=\"printTableHeader\" align=\"center\"  wrap >"+mappingInfo.getTextDescription("monitor.VirtualDashboard.Datastores")+ "</th>");
										else if(userType!=null && (userType.equalsIgnoreCase("AppXenApp7") || userType.equalsIgnoreCase("AppDDXenApp7") || userType.equals("AppLaunchDDXenApp7") || userType.equals("OverviewAppXenApp7") || userType.equalsIgnoreCase("AppVDI") || userType.equalsIgnoreCase("AppDDVDI") || userType.equals("OverviewAppVDI")))
											buf.append("<th class=\"printTableHeader\" align=\"center\" wrap >"+mappingInfo.getTextDescription("monitor.VirtualDashboard.Applications")+"</th>");
										else
											buf.append("<th class=\"printTableHeader\" align=\"center\" wrap >"+mappingInfo.getTextDescription("monitor.VirtualDashboard.Users")+"</th>");
									}
									else
									{*/
										//buf.append("<td class=\"printTableHeader\" align=\"center\"  wrap >"+mappingInfo.getTextDescription("monitor.VirtualDashboard.Users/Desktops")+ "</td>");

										if(userType!=null && userType.equalsIgnoreCase("VDI"))
											buf.append("<th class=\"printTableHeader\" align=\"center\"  wrap >"+mappingInfo.getTextDescription("monitor.VirtualDashboard.Users/Desktops")+ "</th>");
										else if(userType!=null && userType.equalsIgnoreCase("ESX"))
											buf.append("<th class=\"printTableHeader\" align=\"center\"  wrap >"+mappingInfo.getTextDescription("monitor.VirtualDashboard.VMs")+ "</th>");
										else if(userType!=null && userType.equalsIgnoreCase("VCDataStore"))
											buf.append("<th class=\"printTableHeader\" align=\"center\"  wrap >"+mappingInfo.getTextDescription("monitor.VirtualDashboard.Datastores")+ "</th>");
										else if(userType!=null && (userType.equalsIgnoreCase("AppXenApp7") || userType.equalsIgnoreCase("AppDDXenApp7") || userType.equals("AppLaunchDDXenApp7") || userType.equals("OverviewAppXenApp7") || userType.equalsIgnoreCase("AppVDI") || userType.equalsIgnoreCase("AppDDVDI") || userType.equals("OverviewAppVDI")))
											buf.append("<th class=\"printTableHeader\" align=\"center\"  wrap >"+mappingInfo.getTextDescription("monitor.VirtualDashboard.Applications")+ "</th>");
										else
											buf.append("<th class=\"printTableHeader\" align=\"center\"  wrap >"+mappingInfo.getTextDescription("monitor.VirtualDashboard.Users")+ "</th>");
									//} 
									headerVect.add("");
									headerVect.add("Priority");
									//headerVect.add(mappingInfo.getTextDescription("monitor.VirtualDashboard.Users/Desktops"));

									if(userType!=null && userType.equalsIgnoreCase("VDI"))
										headerVect.add(mappingInfo.getTextDescription("monitor.VirtualDashboard.Users/Desktops"));
									else if(userType!=null && userType.equalsIgnoreCase("VCDataStore"))
										headerVect.add(mappingInfo.getTextDescription("monitor.VirtualDashboard.Datastores"));
									else if(userType!=null && userType.equalsIgnoreCase("ESX"))
										headerVect.add(mappingInfo.getTextDescription("monitor.VirtualDashboard.VMs"));
									else if(userType!=null && (userType.equalsIgnoreCase("AppXenApp7") || userType.equalsIgnoreCase("AppDDXenApp7") || userType.equals("AppLaunchDDXenApp7") || userType.equals("OverviewAppXenApp7") || userType.equalsIgnoreCase("AppVDI") || userType.equalsIgnoreCase("AppDDVDI") || userType.equals("OverviewAppVDI")))
										headerVect.add(mappingInfo.getTextDescription("monitor.VirtualDashboard.Applications"));
									else
										headerVect.add(mappingInfo.getTextDescription("monitor.VirtualDashboard.Users"));

									if(!isOnlyVMAssigned && !userType.equals("OverviewAppXenApp7") && !userType.equals("OverviewAppVDI"))
									{
										if(orderByColumnName!=null && orderByColumnName.equalsIgnoreCase("Host"))
										{
											buf.append("<th class=\"printTableHeader\" align=\"center\"  wrap >"+mappingInfo.getTextDescription("monitor.VirtualDashboard.Host")+"</th>");
										}
										else
										{
											buf.append("<th class=\"printTableHeader\" align=\"center\"  wrap >"+mappingInfo.getTextDescription("monitor.VirtualDashboard.Host")+ "</th>");
										}

										headerVect.add(mappingInfo.getTextDescription("monitor.VirtualDashboard.Host"));
									}
			//String widthOfTheHead="";
			String strVdiHostCombo=ini.getValue("END_USER_DASHBOARD_SETTINGS","showVdiHostCombo");
			strVdiHostCombo=(strVdiHostCombo==null || strVdiHostCombo.trim().length()==0)?"false":strVdiHostCombo;
			String strVdiDefaultHost=ini.getValue("END_USER_DASHBOARD_SETTINGS","Default_VdiType");
			strVdiDefaultHost=(strVdiDefaultHost==null || strVdiDefaultHost.trim().length()==0)?"":strVdiDefaultHost;
			boolean showVdiHostCombo = "true".equalsIgnoreCase(strVdiHostCombo)?true:false;
			//boolean isSkipVal = false;
			//ArrayList skippedColumns = new ArrayList();
			if(showVdiHostCombo && vdiType!=null && vdiType.trim().length()>0)
			{
				strVdiDefaultHost = vdiType;
			}

			//String measures = ini.getValue("USER_DESKTOP_METRICS",userType);
			String measures=null;
			String measuresD=null;
			String measuresToSkip=null;
			String measuresT=null;
			if(userName!=null && userName.trim().length()>0)
				measures = ini.getValue("USER_DESKTOP_METRICS",userName+":"+userType);
		
			if(measures==null || measures.trim().length()==0){
				measuresD = ini.getValue("USER_DESKTOP_METRICS","DEFAULT_"+userType);
				measuresT = ini.getValue("USER_DESKTOP_METRICS",userType);
				if(measuresD != null && measuresD.trim().length() > 0)
					measures = (String)getMeasureForUI(measuresD,measuresT);
				else
					measures = measuresT;
			}

			if(detail!=null && filterBy!=null && (detail.equalsIgnoreCase("componentType") || detail.equalsIgnoreCase("Component")) && (!filterBy.equalsIgnoreCase("All")))
			{
				measuresToSkip = ini.getValue("USER_DESKTOP_METRICS","SKIP_METRICS:"+userType+":"+filterBy);
				if(measuresToSkip!=null && measuresToSkip.trim().length()>0)
					measures =  (String)removeSkipMetrics(measures,measuresToSkip);
			}
			else if(resTypeList!=null && resTypeList.size()==1)
			{
				measuresToSkip = ini.getValue("USER_DESKTOP_METRICS","SKIP_METRICS:"+userType+":"+(String)resTypeList.get(0));
				if(measuresToSkip!=null && measuresToSkip.trim().length()>0)
					measures =  (String)removeSkipMetrics(measures,measuresToSkip);
			}

			String extra_measures="";
			if(isFromGeo)
				extra_measures = ini.getValue("EXTERNAL_USER_DESKTOP_METRICS",userType+"_Extra");

			String measures_with_extra="";
			if(measures!=null && measures.trim().length()>0 && measures.endsWith(",") && extra_measures!=null && extra_measures.trim().length()>0)
			{
				measures_with_extra = measures+extra_measures;
			}
			else if(measures!=null && measures.trim().length()>0 && (!measures.endsWith(",")) && extra_measures!=null && extra_measures.trim().length()>0)
			{
				measures_with_extra = measures+","+extra_measures;
			}
			if(measures_with_extra!=null && measures_with_extra.trim().length()>0 && extra_measures!=null && extra_measures.trim().length()>0)
			{
				String swapTestMea = ini.getValue("SWAP_USER_DESKTOP_METRICS",selectedTestMea);
				swapTestMea = (swapTestMea==null || swapTestMea.trim().length()==0)?"":swapTestMea;

				StringBuffer iniValue=new StringBuffer(128);
				ArrayList tmpTestMeasureList = StringUtils.egTokenizer(measures_with_extra,",",true,false,true);//param 3-->includeEmpty,4-->unique,5-->trim
				if(tmpTestMeasureList!=null && tmpTestMeasureList.size()>0 && selectedTestMea!=null && selectedTestMea.trim().length()>0)
				{
					String secondPosMeaVal=null;
					for(int v=0;v<tmpTestMeasureList.size();v++)
					{
						String test_with_measure = (String)tmpTestMeasureList.get(v);
						StringTokenizer testTok=new StringTokenizer(test_with_measure.trim(),":");
						int tokenCount=testTok.countTokens();
						if(tokenCount>=3)
						{
							String tmpTest=testTok.nextToken();
							String tmpMea=testTok.nextToken();
							String tmpColumn=null;
							if(tokenCount>=3)
								tmpColumn=testTok.nextToken();


							String tmpTestMea=tmpTest+":"+tmpMea;
							if(selectedTestMea!=null && selectedTestMea.trim().length()>0 && selectedTestMea.equals(tmpTestMea))
							{
								secondPosMeaVal = test_with_measure;
								break;
							}
							else if(swapTestMea!=null && swapTestMea.trim().length()>0 && swapTestMea.equals(tmpTestMea))
							{
								secondPosMeaVal = test_with_measure;
								break;
							}
						}
					}
					if(secondPosMeaVal!=null && secondPosMeaVal.trim().length()>0)
					{
						ArrayList tmpTestMeasureListOrg = StringUtils.egTokenizer(measures,",",true,false,true);//param 3-->includeEmpty,4-->unique,5-->trim
						try
						{
							tmpTestMeasureListOrg.remove(secondPosMeaVal);
							for(int v=0;v<tmpTestMeasureListOrg.size();v++)
							{
								String test_with_measure = (String)tmpTestMeasureListOrg.get(v);
								if(v==1)
								{
									iniValue.append(","+secondPosMeaVal);
									iniValue.append(","+test_with_measure);
								}
								else
								{
									if(test_with_measure!=null && test_with_measure.trim().length()>0)
									{
										iniValue.append(","+test_with_measure);
									}
								}
							}
						}
						catch (Exception ee)
						{
							ee.printStackTrace();
						}
					}

					String iniValueStr=iniValue.toString();

					if(iniValueStr!=null && iniValueStr.trim().length()>0)
					{
						if(iniValueStr.startsWith(","))
							iniValueStr=iniValueStr.substring(1);

						measures = iniValueStr;
					}
				}
			}

			// hide Measures in UI whose Component Type is Disabled
			measures = (String) HideDisabledTest(measures, userType, user, specsInfo,ini,isDetailsFromADOnly,isShowUserLocation);

			String[] measureArray = measures.split(",");
			ArrayList displayColsList = new ArrayList();
			ArrayList validColsList = new ArrayList();
			Hashtable sameLabelHash = new Hashtable();
			measuresCount = measureArray.length;
			for(int x=0;x<measureArray.length;x++)
			{
				String tempValue = measureArray[x];
				String tempTest = "";
				String tempMeasure = "";
				String tempDispName = "";
				String locKeyName = "";
				String colName = "";
				ArrayList locColumnsList = null;
				StringTokenizer valTokens = new StringTokenizer(tempValue,":");
				int count = valTokens.countTokens();
				boolean isDDDColumn = false;
				boolean isLocColumn = false;
				boolean isTestColumn = false;
				String meas ="";
				if (valTokens.hasMoreTokens())
				{
					if(count==3)
					{
						tempTest = valTokens.nextToken();
						tempMeasure = valTokens.nextToken();
						tempDispName = valTokens.nextToken();
						isTestColumn=true;
					}
					else if(count==2)
					{
						if(isShowUserLocation)
						{
							tempTest = valTokens.nextToken();
							tempMeasure = valTokens.nextToken();
							//tempDispName = mappingInfo.getMeasureDescription(tempTest,tempMeasure);
							isLocColumn = true;
							meas = "NONE";

							ArrayList tmpMeasureList = new ArrayList();
							tmpMeasureList = StringUtils.egTokenizer(tempMeasure,"~$~",true,false,true);//param 3-->includeEmpty,4-->unique,5-->trim
							if(tmpMeasureList!=null && tmpMeasureList.size()>0)
							{
								int meaListSize=tmpMeasureList.size();
								if(meaListSize==1)
								{
									tempDispName = tempMeasure;
								}
								else if(meaListSize>1)
								{
									tempDispName = (String)tmpMeasureList.get(1);
									//if(x == 0 && searchFilter != null && searchFilter.trim().length() > 0 && !searchFilter.equalsIgnoreCase("All") && !searchFilter.equalsIgnoreCase("null")){
									/*if(searchFilter != null && searchFilter.trim().length() > 0 && !searchFilter.equalsIgnoreCase("All") && !searchFilter.equalsIgnoreCase("null")){
										continue;
									}
									//else if(x == 1 && nextSearch != null && nextSearch.trim().length() > 0 && !nextSearch.equalsIgnoreCase("All") && !nextSearch.equalsIgnoreCase("null")){
									else if(nextSearch != null && nextSearch.trim().length() > 0 && !nextSearch.equalsIgnoreCase("All") && !nextSearch.equalsIgnoreCase("null")){
										continue;
									}
									//else if(x == 2 && nextSubSearch != null && nextSubSearch.trim().length() > 0 && !nextSubSearch.equalsIgnoreCase("All") && !nextSubSearch.equalsIgnoreCase("null")){
									else if(nextSubSearch != null && nextSubSearch.trim().length() > 0 && !nextSubSearch.equalsIgnoreCase("All") && !nextSubSearch.equalsIgnoreCase("null")){
										continue;
									}*/
								}
							}
						}
					}
					else if(count==5)
					{
						tempTest = valTokens.nextToken();
						tempMeasure = valTokens.nextToken();
						colName = valTokens.nextToken();
						meas = valTokens.nextToken();
						tempDispName = valTokens.nextToken();
						isDDDColumn = true;
						//mappingInfo.getMeasureDescription(tempTest+"_DDD",tempMeasure);
					}
				}

				if(isTestColumn || isDDDColumn || isLocColumn)
				{
					boolean isTestRelevantForServer = true;
					if(showVdiHostCombo && strVdiDefaultHost!=null && strVdiDefaultHost.trim().length()>0)
					{
						isTestRelevantForServer = specsInfo.isTestRelevantForServer(strVdiDefaultHost,tempTest);
					}
					if(!isTestRelevantForServer)
					{
						continue;
					}
					if(displayColsList!=null && displayColsList.contains(tempDispName))
					{
						if(sameLabelHash!=null && sameLabelHash.containsKey(tempDispName))
						{
							ArrayList tmp_list=(ArrayList)sameLabelHash.get(tempDispName);
							tmp_list.add(tempValue);
							sameLabelHash.put(tempDispName,(ArrayList)tmp_list);
						}
						else
						{
							ArrayList tmp_list=new ArrayList();
							tmp_list.add(tempValue);
							sameLabelHash.put(tempDispName,(ArrayList)tmp_list);
						}
						continue;
					}

					String unitForMeasure="";
					if(isDDDColumn && meas!=null && meas.trim().length()>0 &&(!meas.equalsIgnoreCase("NONE")&&!meas.equalsIgnoreCase("DATE")))
					{
						unitForMeasure = "("+meas+")";
					}
					else if(!isDDDColumn && !isLocColumn)
					{
						//unitForMeasure="&nbsp;("+tablesInfo.getUnitForMeasure(tempTest,tempMeasure.trim())+")";
						String unitVal=tablesInfo.getUnitForMeasure(tempTest,tempMeasure.trim());

						if(unitVal!=null && unitVal.trim().length()>0)
						{
							unitForMeasure="&nbsp;("+unitVal+")";
						}
					}
					if(unitForMeasure!=null && unitForMeasure.indexOf("MB")>-1)
						unitForMeasure ="&nbsp;(GB)";

					if(tempDispName!=null && tempDispName.equalsIgnoreCase("Status")){
						unitForMeasure="";
					}
					else if(tempDispName!=null && (tempDispName.equalsIgnoreCase("Disk Used") || tempDispName.equalsIgnoreCase("Used Space"))){
						unitForMeasure="("+mappingInfo.getTextDescription("monitor.VirtualDashboard.GB")+")";
					}
					String orderByColumn = "";
					if(isLocColumn)
					{
						orderByColumn = tempDispName;
						//orderByColumnName = tempDispName;
					}
					else if (isDDDColumn)
					{
						orderByColumn = Dbdata.getColumnForMeasure(tempTest+"_DDD",colName);
						//col_name = dbInfo.getColumnForMeasure(test+"_DDD",tmp_col_name);
						//orderByColumnName = Dbdata.getColumnForMeasure(tempTest,tempMeasure);
					}
					else
					{
						orderByColumn = Dbdata.getColumnForMeasure(tempTest,tempMeasure); 
					}

					if((convertToDaysTestMeasureList!=null && convertToDaysTestMeasureList.size()>0 && convertToDaysTestMeasureList.contains(tempTest+":"+tempMeasure)) || (udm_hide_unit_list!=null && udm_hide_unit_list.size()>0 && udm_hide_unit_list.contains(tempTest+":"+tempMeasure)))
					{
						unitForMeasure="";
					}

					/*if(orderByColumn!=null && orderByColumn.trim().length()>0 && orderByColumnName!=null && orderByColumnName.trim().length()>0 && orderByColumnName.equalsIgnoreCase(orderByColumn))
					{
						String nextOrderBy="desc";
						//String sortImgurl="/final/monitor/eg_images/arrow_down_black_small.gif";
						String sortImgurl="/final/images/Dark/grid_sort_top.png";
					
						if(orderBy!=null && orderBy.equals("desc"))
						{
							nextOrderBy="asc";
							//sortImgurl="/final/monitor/eg_images/arrow_down_black_small.gif";
							sortImgurl="/final/images/Dark/grid_sort_down.png";
						}
						else if(orderBy!=null && orderBy.equals("asc"))
						{
							nextOrderBy="desc";
							sortImgurl="/final/images/Dark/grid_sort_top.png";
						}

						if(isDDDColumn || (isShowUserLocation && isLocColumn))
						{
							if((unitForMeasure==null || unitForMeasure.equals(""))&& (meas!=null && !meas.equalsIgnoreCase("DATE")))
							{
								//buf.append("<td class=\"printTableHeader\" align=\"center\" wrap >"+tempDispName+"</br>"+unitForMeasure+" <div style=\"float:right;padding:3px\"><img id=\"sortImg\" src=\""+sortImgurl+"\"/> </td>");
								buf.append("<td class=\"printTableHeader\" align=\"center\" wrap >"+tempDispName+"</br>"+unitForMeasure+" <div style=\"float:right;padding:3px\"></td>");
							}
							else
							{
								buf.append("<td class=\"printTableHeader\" align=\"center\" wrap >"+tempDispName+"</br>"+unitForMeasure+" <div style=\"float:right;padding:3px\"></td>");
							}
							headerVect.add(tempDispName+unitForMeasure);
						}
						else
						{
							if(unitForMeasure==null || unitForMeasure.equals(""))
							{
								buf.append("<td class=\"printTableHeader\" align=\"center\" wrap  >"+tempDispName+"<div style=\"float:right;padding:3px\"></td>");
								headerVect.add(tempDispName);
							}
							else
							{
								buf.append("<td class=\"printTableHeader\" align=\"center\" wrap  >"+tempDispName+"</br>"+unitForMeasure+" <div style=\"float:right;padding:3px\"></td>");
								headerVect.add(tempDispName+unitForMeasure);
							}
						}
					}
					else*/
					{
						if(isDDDColumn || (isShowUserLocation && isLocColumn))
						{
							if((unitForMeasure==null || unitForMeasure.equals("")) && (meas!=null && !meas.equalsIgnoreCase("DATE")))
							{
								buf.append("<th class=\"printTableHeader\" align=\"center\" wrap >"+tempDispName+" </th>");
								headerVect.add(tempDispName);
							}
							else
							{
								buf.append("<th class=\"printTableHeader\" align=\"center\" wrap > "+tempDispName+"</br>"+unitForMeasure+" </th>");
								headerVect.add(tempDispName+unitForMeasure);
							}
						}
						else
						{
							if(unitForMeasure==null || unitForMeasure.equals(""))
							{
								buf.append("<th class=\"printTableHeader\" align=\"center\" wrap > "+tempDispName+" </th>");
								headerVect.add(tempDispName);
							}
							else
							{
								buf.append("<th class=\"printTableHeader\" align=\"center\" wrap > "+tempDispName+"</br>"+unitForMeasure+" </th>");
								headerVect.add(tempDispName+unitForMeasure);
							}
						}
					}
					if(displayColsList!=null && tempDispName!=null && !displayColsList.contains(tempDispName))
					{
						displayColsList.add(tempDispName);
						if(sameLabelHash!=null && sameLabelHash.containsKey(tempDispName))
						{
							ArrayList tmp_list=(ArrayList)sameLabelHash.get(tempDispName);
							tmp_list.add(tempValue);
							sameLabelHash.put(tempDispName,(ArrayList)tmp_list);
						}
						else
						{
							ArrayList tmp_list=new ArrayList();
							tmp_list.add(tempValue);
							sameLabelHash.put(tempDispName,(ArrayList)tmp_list);
						}
					}

					if(validColsList!=null && tempValue!=null && !validColsList.contains(tempValue)) 
						validColsList.add(tempValue);
				}
			}
			if(validColsList!=null && validColsList.size()>0)
			{
				measureArray = new String[validColsList.size()];
				int yy=0;
				for(int y=0;y<validColsList.size();y++)
				{
					String tempValue1 = (String)validColsList.get(y);
					if(tempValue1!=null && tempValue1.trim().length()>0)
					{
						measureArray[yy++]=tempValue1;
					}
				}
			}
				
				listData.add(headerVect);
				buf.append("</tr>");
				buf.append("</thead>");
				buf.append("<tbody>");

			EgService serv = null;
			int desktopsSize = (vdiDesktopsList!=null && vdiDesktopsList.size()>0)?vdiDesktopsList.size():0;
			for(int i=0;i<desktopsSize;i++)
			{
				serv = (EgService)vdiDesktopsList.get(i);
				Vector dataVector = new Vector();
				StringBuffer dataBuf = new StringBuffer(128);

				String desktopComponent = serv.getName();
				String desktopState = serv.getState().getName();
				String desktopName = "";
				String comp = "";
				String compValue = "";
				String compName = "";
				String compNameWithOutPort = "";

				if(desktopComponent!=null && desktopComponent.indexOf("^")>-1)
				{
					desktopName = desktopComponent.substring(0,desktopComponent.indexOf("^"));
					comp = desktopComponent.substring(desktopComponent.indexOf("^")+1);
				}
				if(comp!=null && comp.indexOf(":")>-1)
				{
					compValue = comp.substring(0,comp.indexOf(":"));
					compName = comp.substring(comp.indexOf(":")+1);
				}
				if(compName!=null && compName.indexOf(":")>-1)
				{
					compNameWithOutPort = compName.substring(0,compName.indexOf(":"));
				}
				measureValues = (Hashtable)TotalMeasureInfo.get(comp);
				String msmtHost = "";
				String ctype_layer=ini.getValue("USER_DESKTOP_LAYERS",compValue);
				if(userType!=null && userType.equalsIgnoreCase("VDIESX"))
					ctype_layer=ini.getValue("USER_DESKTOP_LAYERS",userType+":"+compValue);
				ctype_layer=(ctype_layer==null || ctype_layer.trim().length()==0)?"VIRTUAL_DESKTOP":ctype_layer;
				//ArrayList arr = tablesInfo.getTestsForLayer(ctype_layer);
				ArrayList arr = tablesInfo.getTestsForLayer(ctype_layer,compValue);
				if(arr!=null && arr.size()>0)
				{
					boolean flag=true;
					for (int t=0;t<arr.size();t++)
					{
						String insideviewTest=(String) arr.get(t);
						if(insideviewTest!=null && insideviewTest.trim().length()>0)
						{
							List agents=egExternalInfo.getAgentsFor(insideviewTest.trim(),compValue,compNameWithOutPort);

							if(agents!=null && agents.size()>0)
							{
								msmtHost=(String)agents.get(0);
								flag=false;
								break;
							}
						}
					}

					if(flag)
						msmtHost=compNameWithOutPort;
				}
				else
					msmtHost=compNameWithOutPort;

				String disp_desktopName=desktopName;
				//if(disp_desktopName!=null && disp_desktopName.length()>30)
					//disp_desktopName=disp_desktopName.substring(0,30)+"..";

				String strName = compName;
				if (strName.endsWith(EgConstants.NULL_PORT) && (strName.indexOf(EgConstants.NULL_PORT) > -1))
				{
					strName = Server.getServerNameWithoutPort(strName, false);
				}

				String disp_StrName = strName;
				//if(disp_StrName!=null && disp_StrName.length()>22)
					//disp_StrName=disp_StrName.substring(0,22)+"..";

									dataBuf.append("<tr class=\"x-grid-row  x-grid-row-alt\">");
									//if((userType!=null && searchString!=null && searchString.trim().length()>0 && (userType.equalsIgnoreCase("AppXenApp7") || userType.equalsIgnoreCase("AppDDXenApp7") || userType.equals("AppLaunchDDXenApp7") || userType.equalsIgnoreCase("AppVDI") || userType.equalsIgnoreCase("AppDDVDI"))))
									{
										dataBuf.append("<td >");
											dataBuf.append("<table cellspacing=\"0\" cellpadding=\"2\" border=\"0\">");
												dataBuf.append("<tr style=\"background:none !important\">");
													dataBuf.append("<td style=\"border:none;\">");
										dataBuf.append("<div style=\"text-align:center;padding:2px 6px 5px 5px\"><img src=\"/final/images/Dark/eud_"+desktopState+".png\"/></div>");

										if(userType!=null && (userType.equalsIgnoreCase("AppXenApp7") || userType.equalsIgnoreCase("AppDDXenApp7") || userType.equals("AppLaunchDDXenApp7") || userType.equals("OverviewAppXenApp7") || userType.equals("OverviewAppVDI")))
										{
											if(disp_desktopName.indexOf("~SEQ~")>-1)
											{
												disp_desktopName=disp_desktopName.substring(0,disp_desktopName.indexOf("~SEQ~"));
											}
										}
													dataBuf.append("</td>");
													dataBuf.append("<td style=\"border:none;word-break: break-all;\" >");
														dataBuf.append(disp_desktopName);
													dataBuf.append("</td>");
												dataBuf.append("</tr>");
											dataBuf.append("</table>");
										dataBuf.append("</td>");
									}
										if(!isOnlyVMAssigned && !userType.equals("OverviewAppXenApp7") && !userType.equals("OverviewAppVDI"))
										{
											dataBuf.append("<td>");
												dataBuf.append("<div style=\"font-size:12px;float:left;position:relative;visibility:visible;text-align:left;\"><div style=\"padding-top:4px;\">"+disp_StrName+"</div></div>");
												dataBuf.append("</td>");
										}
										//if(userType!=null && !userType.equalsIgnoreCase("AppXenApp7") && !userType.equalsIgnoreCase("AppDDXenApp7") && !userType.equals("AppLaunchDDXenApp7"))
										{
											dataVector.add("");
											String labeldeskState = mappingInfo.getLabelDescription(desktopState);
											dataVector.add(labeldeskState);
											dataVector.add(disp_desktopName);
										}
											if(!isOnlyVMAssigned && !userType.equals("OverviewAppXenApp7") && !userType.equals("OverviewAppVDI"))
											{
												dataVector.add(disp_StrName);
											}

				measureList = Arrays.asList(measureArray);
				boolean isAllNeg=true;
				if(measureValues!=null && measureValues.size()>0)
				{
					String ctype_out_layer=ui.getValue("Layer_for_ComponentType",compValue);
					ctype_out_layer=(ctype_out_layer==null || ctype_out_layer.trim().length()==0)?"VIRTUAL_GUESTS":ctype_out_layer;
					ArrayList listOfTest=(ArrayList)tablesInfo.getTestsForLayer(ctype_out_layer,compValue);

					if(userType!=null && (userType.equals("CitrixXenVDI") || userType.equals("VDI") || userType.equals("ESX")))
					{
						String ctype_in_layer=ini.getValue("USER_DESKTOP_LAYERS",compValue);
						ctype_in_layer=(ctype_in_layer==null || ctype_in_layer.trim().length()==0)?"VIRTUAL_DESKTOP":ctype_in_layer;
						listOfTest.addAll((ArrayList)tablesInfo.getTestsForLayer(ctype_in_layer,compValue));
					}

					int p=0;
					String info_to_lower=desktopName;
					while(p<measureList.size())
					{
						String keyForList = (String)measureList.get(p);
						String keyMeasure = "";
						String keyOrgMeasure = "";
						String keyTest = "";
						String keydisplayMeasure = "";
						StringTokenizer valTokens = new StringTokenizer(keyForList,":");
						int tokCount = valTokens.countTokens();
						boolean isDDDTestColumn = false;
						boolean isLocationColumn = false;
						if(tokCount==5)
							isDDDTestColumn = true;
						else if(tokCount==2)
							isLocationColumn = true;
						String orgColName = "";
						String funcName = "";
						String dispName = "";
						
						String tempDispName = "";
						String locKeyName = "";
						String Value="";
						String units="";
						
						ArrayList keyMeasureList = null; 
						ArrayList locMeasuresList = new ArrayList(); 
						if(isDDDTestColumn)
						{
							if(keyForList!=null && keyForList.indexOf(":")>-1)
							{
								keyTest=keyForList.substring(0,keyForList.indexOf(":"));
								keyMeasure=keyForList.substring(keyForList.indexOf(":")+1);
								if(keyMeasure!=null && keyMeasure.indexOf(":")>-1)
								{
									orgColName=keyMeasure.substring(keyMeasure.indexOf(":")+1);
									keyMeasure = keyMeasure.substring(0,keyMeasure.indexOf(":"));
									if(orgColName!=null && orgColName.indexOf(":")>-1)
									{
										funcName=orgColName.substring(orgColName.indexOf(":")+1);
										orgColName = orgColName.substring(0,orgColName.indexOf(":"));
									}
									if(funcName!=null && funcName.indexOf(":")>-1)
									{
										dispName = funcName.substring(funcName.indexOf(":")+1);
										funcName = funcName.substring(0,funcName.indexOf(":"));
									}
								}
							}
							
							if(keyTest!=null && keyTest.trim().length()>0 && listOfTest!=null && listOfTest.size()>0 && !listOfTest.contains(keyTest) && dispName!=null)
							{
								ArrayList tmpArry=(ArrayList)sameLabelHash.get(dispName);
								
								if(tmpArry!=null && tmpArry.size()>0)
								{
									for(int kk=0;kk<tmpArry.size();kk++)
									{
										String newKeyForList =(String)tmpArry.get(kk);
										String newKeyTest=null;
										if(newKeyForList!=null && newKeyForList.indexOf(":")>-1)
										{
											newKeyTest=newKeyForList.substring(0,newKeyForList.indexOf(":"));
										}

										if(newKeyTest!=null && newKeyTest.trim().length()>0 && listOfTest!=null && listOfTest.contains(newKeyTest))
										{
											keyForList = newKeyForList;
											if(keyForList!=null && keyForList.indexOf(":")>-1)
											{
												keyTest=keyForList.substring(0,keyForList.indexOf(":"));
												keyMeasure=keyForList.substring(keyForList.indexOf(":")+1);
												if(keyMeasure!=null && keyMeasure.indexOf(":")>-1)
												{
													orgColName=keyMeasure.substring(keyMeasure.indexOf(":")+1);
													keyMeasure = keyMeasure.substring(0,keyMeasure.indexOf(":"));
													if(orgColName!=null && orgColName.indexOf(":")>-1)
													{
														funcName=orgColName.substring(orgColName.indexOf(":")+1);
														orgColName = orgColName.substring(0,orgColName.indexOf(":"));

														if(funcName!=null && funcName.indexOf(":")>-1)
														{
															dispName=funcName.substring(funcName.indexOf(":")+1);
															funcName = funcName.substring(0,funcName.indexOf(":"));
														}
													}
												}
											}

											break;
										}
									}
								}
							}

							keydisplayMeasure = dispName;
							String colKeyName = Dbdata.getColumnForMeasure(keyTest+"_DDD",orgColName);
							String tmpK = colKeyName+"^"+info_to_lower.toLowerCase()+"^"+compNameWithOutPort;
							Value=getMeasureValue(measureValues,keyTest,colKeyName,info_to_lower,compNameWithOutPort);
							Value = getManagerTimeToUserTimeConvertion(egFormat,convert,user,keyTest,orgColName,Value);
						}
						else if(isShowUserLocation && isLocationColumn)
						{
							if(keyForList!=null && keyForList.indexOf(":")>-1)
							{
								keyTest=keyForList.substring(0,keyForList.indexOf(":"));
								keyMeasure=keyForList.substring(keyForList.indexOf(":")+1);
							}

							funcName ="NONE";

							if(keyMeasure!=null && keyMeasure.trim().length()>0)
							{
								keyMeasureList = StringUtils.egTokenizer(keyMeasure,"~$~",true,false,true);//param 3-->includeEmpty,4-->unique,5-->trim
								if(keyMeasureList!=null && keyMeasureList.size()>0)
								{
									int meaListSize=keyMeasureList.size();
									if(meaListSize==1)
									{
										locKeyName = (String)keyMeasureList.get(0);
									}
									else if(meaListSize>1)
									{
										locKeyName = (String)keyMeasureList.get(0);
									}

									Value=getMeasureValue(measureValues,keyTest,locKeyName,info_to_lower,compNameWithOutPort);

									if(meaListSize==1 && strSeparator!=null && strSeparator.trim().length()>0 && strReplaceSep!=null && strReplaceSep.trim().length()>0 && Value!=null && !Value.equals("-"))
									{
										Value = com.egurkha.util.StringUtils.replace(Value,strSeparator,strReplaceSep);
									}
								}
							}
						}
						else
						{
							if(keyForList!=null && keyForList.indexOf(":")>-1)
							{
								keyTest=keyForList.substring(0,keyForList.indexOf(":"));
								keyMeasure=keyForList.substring(keyForList.indexOf(":")+1);
								if(keyMeasure!=null && keyMeasure.indexOf(":")>-1)
								{
									keydisplayMeasure=keyMeasure.substring(keyMeasure.indexOf(":")+1);
									keyMeasure=keyMeasure.substring(0,keyMeasure.indexOf(":"));
								}
							}
							units=tablesInfo.getUnitForMeasure(keyTest,keyMeasure);
							keyOrgMeasure = keyMeasure;
							keyMeasure = Dbdata.getColumnForMeasure(keyTest,keyMeasure);
							if(specsInfo.isTestRelevantForServer(compValue,keyTest))
							{
								Value=getMeasureValue(measureValues,keyTest,keyMeasure,info_to_lower,compNameWithOutPort);
							}
						}
						
						//if((Value==null || Value.trim().length()==0) && compValue!=null && compValue.equals("Xen_desktop_server"))
						if(Value==null || Value.trim().length()==0)
						{
							if(info_to_lower!=null && (info_to_lower.indexOf(" ")>-1 && info_to_lower.indexOf("on")>-1))
							{
								ArrayList tokenList =  com.egurkha.util.StringUtils.egTokenizer(info_to_lower, " on ",false,false,true);//param 3-->includeEmpty,4-->unique,5-->trim
								if(tokenList!=null && tokenList.size()==2)
								{
									info_to_lower=(String)tokenList.get(0)+"_on_"+(String)tokenList.get(1);
								}
							}
							Value=getMeasureValue(measureValues,keyTest,keyMeasure,info_to_lower,compNameWithOutPort);
						}
						String mes_state="";
						String mes_name="";
						String total_spc="0";

						if(Value!=null && Value.indexOf("^")>-1)
						{
							mes_state=Value.substring(Value.indexOf("^")+1);
							if(mes_state!=null && mes_state.indexOf("^")>-1)
							{
								mes_name=mes_state.substring(mes_state.indexOf("^")+1);
								mes_state=mes_state.substring(0,mes_state.indexOf("^"));
								if(mes_name!=null && mes_name.indexOf("^")>-1)
								{
									total_spc=mes_name.substring(mes_name.indexOf("^")+1);
									mes_name=mes_name.substring(0,mes_name.indexOf("^"));
								}
							}
							Value=Value.substring(0,Value.indexOf("^"));
						}
						else if(Value==null)
						{
							Value="-";
							mes_name=keyMeasure;
							mes_state="GOOD";
						}

						boolean sameLabelFlag=false;
						if(sameLabelHash!=null && sameLabelHash.size()>0 && keydisplayMeasure!=null && sameLabelHash.containsKey(keydisplayMeasure))
						{
							ArrayList tmpArry=(ArrayList)sameLabelHash.get(keydisplayMeasure);
							ArrayList tmpNewArry=new ArrayList();
							tmpNewArry.addAll(tmpArry);
							if(tmpNewArry!=null && tmpNewArry.size()>0 && keyForList!=null && tmpNewArry.contains(keyForList))
								tmpNewArry.remove(keyForList);

							if(tmpNewArry!=null && tmpNewArry.size()>0)
							{
								sameLabelFlag=true;
								if(!dashboardModel.isTestActive(compValue, compName, keyTest, "custom"))
									Value="-";
							}
						}

						if((Value==null || Value.equals("-")) && sameLabelFlag && (sameLabelHash!=null && sameLabelHash.size()>0 && sameLabelHash.containsKey(keydisplayMeasure)))
						{
							ArrayList tmpArry=(ArrayList)sameLabelHash.get(keydisplayMeasure);
							ArrayList tmpOldArry=new ArrayList();
							if(tmpArry!=null && tmpArry.size()>0)
							{
								tmpOldArry.addAll(tmpArry);
								if(tmpOldArry.contains(keyForList))
									tmpOldArry.remove(keyForList);

								for(int kk=0;kk<tmpOldArry.size();kk++)
								{
									keyForList =(String)tmpOldArry.get(kk);
									String tmp_keyTest=null;
									String tmp_keyMeasure=null;
									String tmp_keydisplayMeasure=null;
									String tmp_keyDDMeasure=null;
									//String tmp_units=null;
									if(keyForList!=null && keyForList.indexOf(":")>-1)
									{
										ArrayList keyTokenList =  com.egurkha.util.StringUtils.egTokenizer(keyForList, ":",true,false,true);//param 3-->includeEmpty,4-->unique,5-->trim

										if(keyTokenList!=null && keyTokenList.size()==3)
										{
											tmp_keyTest=(String)keyTokenList.get(0);
											tmp_keyMeasure=(String)keyTokenList.get(1);
											tmp_keydisplayMeasure=(String)keyTokenList.get(2);
										}
										else if(keyTokenList!=null && keyTokenList.size()==5)//VmgPcoIPSessionTest:Round_trip:ClientIp:NONE:Client IP
										{
											tmp_keyTest=(String)keyTokenList.get(0);
											tmp_keyMeasure=(String)keyTokenList.get(1);
											tmp_keyDDMeasure=(String)keyTokenList.get(2);
											tmp_keydisplayMeasure=(String)keyTokenList.get(4);
										}
									}
									
									//tmp_units=tablesInfo.getUnitForMeasure(tmp_keyTest,tmp_keyMeasure);
									String tmp_keyOrgMeasure = tmp_keyMeasure;
									if(tmp_keyDDMeasure!=null)
										tmp_keyMeasure = Dbdata.getColumnForMeasure(tmp_keyTest+"_DDD",tmp_keyDDMeasure);
									else
										tmp_keyMeasure = Dbdata.getColumnForMeasure(tmp_keyTest,tmp_keyMeasure);

									String tmp_Value=null;
									boolean isTimeout = false;

									if(tmp_keyDDMeasure==null)
										isTimeout = isTimeoutCheck(compName,tmp_keyTest,msmtHost,compValue,info_to_lower);

									if((!isTimeout) || excludedTestList.contains(tmp_keyTest))
									{
										if(specsInfo.isTestRelevantForServer(compValue,tmp_keyTest))
										{
											tmp_Value=getMeasureValue(measureValues,tmp_keyTest,tmp_keyMeasure,info_to_lower,compNameWithOutPort);
											if(tmp_Value==null || tmp_Value.trim().length()==0)
											{
												if(info_to_lower!=null && (info_to_lower.indexOf(" ")>-1 && info_to_lower.indexOf("on")>-1))
												{
													ArrayList tokenList =  com.egurkha.util.StringUtils.egTokenizer(info_to_lower, " on ",false,false,true);//param 3-->includeEmpty,4-->unique,5-->trim
													if(tokenList!=null && tokenList.size()==2)
													{
														info_to_lower=(String)tokenList.get(0)+"_on_"+(String)tokenList.get(1);
													}
												}
												tmp_Value=getMeasureValue(measureValues,tmp_keyTest,tmp_keyMeasure,info_to_lower,compNameWithOutPort);
											}
										}

										if(tmp_Value!=null && tmp_Value.indexOf("^")>-1)
										{
											String tmp_mes_state=tmp_Value.substring(tmp_Value.indexOf("^")+1);
											String tmp_total_spc=null;
											String tmp_mes_name=null;
											if(tmp_mes_state!=null && tmp_mes_state.indexOf("^")>-1)
											{
												tmp_mes_name=tmp_mes_state.substring(tmp_mes_state.indexOf("^")+1);
												tmp_mes_state=tmp_mes_state.substring(0,tmp_mes_state.indexOf("^"));
												if(tmp_mes_name!=null && tmp_mes_name.indexOf("^")>-1)
												{
													total_spc=tmp_mes_name.substring(tmp_mes_name.indexOf("^")+1);
													tmp_mes_name=tmp_mes_name.substring(0,tmp_mes_name.indexOf("^"));
												}
											}
											tmp_Value=tmp_Value.substring(0,tmp_Value.indexOf("^"));

											if(tmp_Value!=null && !tmp_Value.trim().equals("-"))
											{
												keyTest=tmp_keyTest;
												keyMeasure=tmp_keyMeasure;
												keyOrgMeasure = tmp_keyOrgMeasure;
												Value=tmp_Value;
												total_spc= tmp_total_spc;
												mes_name=tmp_mes_name;
												mes_state=tmp_mes_state;
												break;
											}
										}
									}
								}
							}
						}
						
						String orgValue="0.0";
						
						try
						{
							if(Value!=null && Value.trim().length()>0 && Value.indexOf(".")>-1 && Double.parseDouble(Value)>0)
							{
								orgValue=Value;
								//Value=String.valueOf(com.egurkha.util.MathUtils.round(Double.parseDouble(Value),2));
								if(decimalFormatTestMeasureList!=null && decimalFormatTestMeasureList.size()>0 && decimalFormatTestMeasureList.contains(keyTest+":"+keyOrgMeasure))
								{
									Value=String.valueOf(com.egurkha.util.MathUtils.round(Double.parseDouble(Value),4));
								}
								else if(convertToDaysTestMeasureList!=null && convertToDaysTestMeasureList.size()>0 && convertToDaysTestMeasureList.contains(keyTest+":"+keyOrgMeasure))
								{
									Value = getConvertDays(Value,egDashboard);
								}
								else
								{
									Value=String.valueOf(com.egurkha.util.MathUtils.round(Double.parseDouble(Value),2));
								}

								Value=String.valueOf(Value);
							}
							else if(Value!=null && Value.trim().length()>0  && Double.parseDouble(Value)>0)
							{
								orgValue=Value;
								//Value=String.valueOf(com.egurkha.util.MathUtils.round(Double.parseDouble(Value),2));
								if(decimalFormatTestMeasureList!=null && decimalFormatTestMeasureList.size()>0 && decimalFormatTestMeasureList.contains(keyTest+":"+keyOrgMeasure))
								{
									Value=String.valueOf(com.egurkha.util.MathUtils.round(Double.parseDouble(Value),4));
								}
								else if(convertToDaysTestMeasureList!=null && convertToDaysTestMeasureList.size()>0 && convertToDaysTestMeasureList.contains(keyTest+":"+keyOrgMeasure))
								{
									Value = getConvertDays(Value,egDashboard);
								}
								else
								{
									//Value=String.valueOf(com.egurkha.util.MathUtils.round(Double.parseDouble(Value),2));
								}

								Value=String.valueOf(Value);
							}
						}
						catch(Exception ee)
						{
							if(Value==null || Value.equalsIgnoreCase("unknown"))
								Value = "-";

							Value=Value;
							orgValue=Value;
						}
						if(mes_state!=null && mes_state.length()>0 && mes_state.equalsIgnoreCase("NONE"))
						{
							mes_state="GOOD";
						}
						else if(mes_state!=null && mes_state.trim().length()==0)
						{
							mes_state="GOOD";
						}
						if(Value.equalsIgnoreCase("on"))
						{
							dataBuf.append("<td align=\"center\" ><img  src=\"/final/monitor/eg_images/yes2.gif\"></td>"); 
						}
						else if(Value.equalsIgnoreCase("off"))
						{
							dataBuf.append("<td align=\"center\" ><img  src=\"/final/monitor/eg_images/no2.gif\"></td>");
						}
						else
						{
							String measuresLink = "";
							if(fromMenuStr!=null && !fromMenuStr.equalsIgnoreCase("null") && fromMenuStr.trim().length()>0 && fromMenuStr.equalsIgnoreCase("true"))
							{
								String layerName = tablesInfo.getRelevantLayer(compValue,keyTest,keyOrgMeasure);
								layerName=(layerName==null || layerName.trim().length()==0)?ctype_layer:layerName;
								
								String infoKey = compValue+":"+compName+":"+keyTest+":"+info_to_lower;
								HashSet infosSet = null;
								if(fullInfoHash!=null && fullInfoHash.size()>0)
									infosSet = (HashSet)fullInfoHash.get(infoKey);
								ArrayList infosList = null;
								if(infosSet!=null && infosSet.size()>0)
									infosList = new ArrayList(infosSet);
								String info_name = "";
								if(infosList!=null && infosList.size()>1)
								{
									for(int is=0;is<infosList.size();is++)
									{
										String tmpInfo = (String)infosList.get(is);
										if(tmpInfo!=null && (tmpInfo.endsWith(":Summary") || tmpInfo.endsWith(":Total")))
										{
											info_name = tmpInfo;
											break;
										}
									}
									if(info_name==null || info_name.equalsIgnoreCase("null") || info_name.trim().length()==0)
									{
										info_name = (String)infosList.get(0);
									}
								}
								else if(infosList!=null && infosList.size()==1)
								{
									info_name = (String)infosList.get(0);
								}
								if(info_name==null || info_name.equalsIgnoreCase("null") || info_name.trim().length()==0)
								{
									info_name = "+" + info_to_lower;
								}
								measuresLink = "/final/monitor/EgSiteInfraView.jsp?qctr=2"+"&site=NULL"+"&fromalarm=0"+"&newWindow=false"+"&host="+EgURLEncoder.encode(compName,"UTF-8")+"&msmt_host="+EgURLEncoder.encode(msmtHost,"UTF-8")+"&comptype="+compValue+"&layer="+layerName+"&test="+keyTest+"-"+EgURLEncoder.encode(info_name,"UTF-8")+"&tstate="+mes_state+"&toDashBoardLayer=true";
							}

							if(mes_name!=null)
							{
								if(Value!=null && !Value.equals("-"))
								{
									try
									{
										double fillColorValue=Double.parseDouble(orgValue);
										if(units!=null && units.equals("MB"))
										{
											//units = "GB";
											fillColorValue=fillColorValue/1024.0;
										}
										Value=String.valueOf(fillColorValue);
										//Value=String.valueOf(com.egurkha.util.MathUtils.round(Double.parseDouble(Value),2));
										if(Value!=null && Value.trim().length()>0 && Value.indexOf(".")>-1 && Double.parseDouble(Value)>0)
										{
											if(decimalFormatTestMeasureList!=null && decimalFormatTestMeasureList.size()>0 && decimalFormatTestMeasureList.contains(keyTest+":"+keyOrgMeasure))
											{
												Value=String.valueOf(com.egurkha.util.MathUtils.round(Double.parseDouble(Value),4));
											}
											else if(convertToDaysTestMeasureList!=null && convertToDaysTestMeasureList.size()>0 && convertToDaysTestMeasureList.contains(keyTest+":"+keyOrgMeasure))
											{
												Value = getConvertDays(Value,egDashboard);
											}
											else
											{
												Value=String.valueOf(com.egurkha.util.MathUtils.round(Double.parseDouble(Value),2));
											}
										}
										else
										{
											//Value=String.valueOf(com.egurkha.util.MathUtils.round(Double.parseDouble(Value),2));
										}

										Value=String.valueOf(Value);
									}
									catch(Exception ee)
									{
										Value=String.valueOf(orgValue);
									}

									if(isDDDTestColumn || isLocationColumn)
									{
										dataBuf.append("<td  align=\"left\"  >");
										dataBuf.append("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"left\">");
									}
									else
									{
										dataBuf.append("<td  align=\"center\" >");
										//buf.append("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"right\">");
										dataBuf.append("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">");
									}
									dataBuf.append("<tr style=\"background:none !important\">");
									if(fromMenuStr!=null && !fromMenuStr.equalsIgnoreCase("null") && fromMenuStr.trim().length()>0 && fromMenuStr.equalsIgnoreCase("true"))
									{
										if(isDDDTestColumn || isLocationColumn)
										{
											dataBuf.append("<td class=\"mouse\" align=\"left\" style=\"text-align:left;\" \"data-qtip=\""+Value+"\" data-qclass=\"yellowTip\" >");
											
										}
										else
										{
											dataBuf.append("<td class=\"mouse\" align=\"right\" >");
										}
									}
									else
									{
										if(isDDDTestColumn || isLocationColumn)
										{
											dataBuf.append("<td style=\"white-space:pre-wrap;border:none;\" align=\"left\">");
										}
										else
										{
											dataBuf.append("<td style=\"white-space:pre-wrap;border:none;\" align=\"left\">");
										}
									}
								}
								else
								{
									if(isDDDTestColumn || isLocationColumn)
									{
										dataBuf.append("<td  style=\"text-align:left;\" align=\"left\" >");
											dataBuf.append("<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" borderColor=\"red\"  style=\"table-layout:auto;\" align=\"left\">");
									}
									else
									{
										dataBuf.append("<td align=\"center\" >");
											//buf.append("<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" borderColor=\"green\"  style=\"table-layout:auto;\" align=\"right\">");
											dataBuf.append("<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" borderColor=\"green\"  style=\"table-layout:auto;\" align=\"center\">");
									}
									dataBuf.append("<tr style=\"background:none !important\">");
									if(fromMenuStr!=null && !fromMenuStr.equalsIgnoreCase("null") && fromMenuStr.trim().length()>0 && fromMenuStr.equalsIgnoreCase("true"))
									{
										if(isDDDTestColumn||isLocationColumn)
										{
											dataBuf.append("<td align=\"left\" style=\"border:none;padding-right:10px;text-align:left;\" >");
										}
										else
										{
											dataBuf.append("<td class=\"mouse\" align=\"left\" style=\"border:none;padding-right:10px\" >");
										}
									}
									else
									{
										dataBuf.append("<td align=\"left\" style=\"border:none;padding-right:10px\">");
									}
								}
							}
							else
							{
								dataBuf.append("<td  style=\"padding-top:4px;\" align=\"center\"  >");
									dataBuf.append("<table cellspacing=\"0\" cellpadding=\"0\" style=\"table-layout:auto;border:0px solid red;border:none;\" align=\"right\">");
										dataBuf.append("<tr style=\"background:none !important\">");
											if(fromMenuStr!=null && !fromMenuStr.equalsIgnoreCase("null") && fromMenuStr.trim().length()>0 && fromMenuStr.equalsIgnoreCase("true"))
											{
												if(isDDDTestColumn||isLocationColumn)
												{
													dataBuf.append("<td align=\"right\" style=\"font-size:11px;text-align:right;width:20px;padding-right:10px\" >");
												}
												else
												{
													dataBuf.append("<td class=\"mouse\" align=\"right\" style=\"font-size:11px;text-align:right;width:20px;padding-right:10px\" onClick=\"javascript:goToDetails('"+measuresLink+"');\" >");
												}
											}
											else
											{
												dataBuf.append("<td align=\"right\" style=\"font-size:11px;text-align:right;width:20px;padding-right:10px\">");
											}
							}

							Value = formatDbValue(Value);

							String iniVar=keyTest+":"+keyOrgMeasure+":"+Value;
							boolean isMDV=false;
							String iniValue=(String)uiIni.getValue("Measure_value_display",iniVar);
							if(iniValue!=null && iniValue.trim().length()>0)
							{
								Value = iniValue;
								isMDV=true;
							}

							String labelTmpState = mappingInfo.getLabelDescription(mes_state);
							//dataVector.add(Value);
							
							if(Value!=null && !Value.equals("-"))
							{
								isAllNeg = false;
								boolean usage =true;
								if(mes_name!=null && mes_name.equalsIgnoreCase("Cpu_used") && (!isMDV))
								{
									dataVector.add("("+labelTmpState+")"+Value);
									usage = false;
									int columnWidth = 100;
									Long temp_measure_value=new Long(Math.round(Double.parseDouble(Value)));
									long fillColorValue=temp_measure_value.longValue();
									long value1 = (fillColorValue*100)/columnWidth;
									String mes_state_GOOD="";
									if(mes_state.equalsIgnoreCase("high"))
									{
										mes_state_GOOD="#cd0f0f";
									}
									else if(mes_state.equalsIgnoreCase("intermediate"))
									{
										mes_state_GOOD="#fa9d1c";
									}
									else if(mes_state.equalsIgnoreCase("low"))
									{
										mes_state_GOOD="#ccc100";
									}
									else if(mes_state.equalsIgnoreCase("unknown"))
									{
										mes_state_GOOD="#30a1d9";
									}
									else if(mes_state.equalsIgnoreCase("good")) 
									{
										mes_state_GOOD="#0c9a12";
									}

														dataBuf.append("<div style=\"width:80px;padding:0px;margin:0px;background:#e1e1e1;\">");
														//buf.append("<tr`>");
															//buf.append("<td align=\"left\" width=\"100%\" height=\"6\" //class=\"prog_line\">");
																dataBuf.append("<div style=\"width:"+value1+"% !important;display:inline-block;z-index:25000;height:6px;background:"+mes_state_GOOD+"\" height=\"6\">");
																		//buf.append("<div width=\"100%\" style=\"border:0px solid yellow;display:block;z-index:25000;height:6px\"></div>");
																dataBuf.append("</div>");
															//buf.append("</td>");
														//buf.append("</tr>");
													dataBuf.append("</div>");
								}
								else if(units!=null && units.equals("%") && !mes_name.equalsIgnoreCase("Ready") && usage && (!isMDV))
								{
									dataVector.add("("+labelTmpState+")"+Value);
									int columnWidth = 100;
									Long temp_measure_value=new Long(Math.round(Double.parseDouble(Value)));
									long fillColorValue=temp_measure_value.longValue();
									long value2 = (fillColorValue*100)/columnWidth;
									String mes_state_GOOD="";
									if(mes_state.equalsIgnoreCase("high"))
									{
										mes_state_GOOD="#cd0f0f";
									}
									else if(mes_state.equalsIgnoreCase("intermediate"))
									{
										mes_state_GOOD="#fa9d1c";
									}
									else if(mes_state.equalsIgnoreCase("low"))
									{
										mes_state_GOOD="#ccc100";
									}
									else if(mes_state.equalsIgnoreCase("unknown"))
									{
										mes_state_GOOD="#30a1d9";
									}
									else if(mes_state.equalsIgnoreCase("good")) 
									{
										mes_state_GOOD="#0c9a12";
									}
													dataBuf.append("<div style=\"width:80px;padding:0px;margin:0px;background:#e1e1e1;\">");
														//buf.append("<tr`>");
															//buf.append("<td align=\"left\" width=\"100%\" height=\"6\" //class=\"prog_line\">");
																dataBuf.append("<div style=\"width:"+value2+"% !important;display:inline-block;z-index:25000;height:6px;background:"+mes_state_GOOD+"\" height=\"6\">");
																		//buf.append("<div width=\"100%\" style=\"border:0px solid yellow;display:block;z-index:25000;height:6px\"></div>");
																dataBuf.append("</div>");
															//buf.append("</td>");
														//buf.append("</tr>");
													dataBuf.append("</div>");
								}
							}
							dataBuf.append("</td>");

							if(Value!=null && !Value.equals("-"))
							{
								boolean usage =true;
								if(isDDDTestColumn || isLocationColumn)
								{
									dataVector.add(Value);
									
									if(mes_name!=null && mes_name.equalsIgnoreCase("Cpu_used"))
									{
										usage =false;
										dataBuf.append("<td style=\"border:none;text-align:left;padding-left:3px;width:42px;white-space:nowrap\">"+Value+"</td>");
									}
									else if(units!=null && units.equals("%") && !mes_name.equalsIgnoreCase("Ready") && usage)
									{
										dataBuf.append("<td style=\"border:none;text-align:left;padding-left:3px;width:42px;white-space:nowrap\">"+Value+"</td>");
									}
									else
									{
										if(funcName!=null && (funcName.equalsIgnoreCase("NONE") || funcName.equalsIgnoreCase("DATE")))
										{
											dataBuf.append("<td style=\"border:none;text-align:left;padding-left:3px;width:42px;white-space:nowrap\">"+Value+"</td>");
										}
										else
										{
											dataBuf.append("<td style=\"border:none;text-align:right;padding-left:3px;width:42px;white-space:nowrap\">"+Value+"</td>");
										}
									}
								}
								else
								{
									if(mes_name!=null && mes_name.equalsIgnoreCase("Cpu_used")  && (!isMDV))
									{
										usage =false;
										dataBuf.append("<td style=\"border:none;text-align:left;padding-left:3px;width:42px;white-space:nowrap\">"+Value+"</td>");
									}
									else if(units!=null && units.equals("%") && !mes_name.equalsIgnoreCase("Ready") && usage  && (!isMDV))
									{
										dataBuf.append("<td style=\"border:none;text-align:left;padding-left:3px;width:42px;white-space:nowrap\">"+Value+"</td>");
									}
									else
									{
										if(funcName!=null && (funcName.equalsIgnoreCase("NONE") || funcName.equalsIgnoreCase("DATE")))
										{
											dataVector.add(Value);
											
											dataBuf.append("<td style=\"border:none;text-align:left;padding-left:3px;width:42px;white-space:nowrap\">"+Value+"</td>");
										}
										else
										{
											dataVector.add("("+labelTmpState+")"+Value);
											dataBuf.append("<td style=\"display:inline-flex;flex-flow: nowrap;border:none;text-align:center;width:100%;white-space:nowrap\"><div><span class='stateSymbol_"+mes_state+"' style='margin-top:3px;flex:0.2;'></span><span style='flex:0.8;'>"+Value+"</span></div></td>");
										}
									}
								}
							}
							else
							{
								dataVector.add(Value);
								
								if(isDDDTestColumn || isLocationColumn)
								{
									dataBuf.append("<td style=\"border:none;text-align:right;padding-left:3px;padding-right:30px;width:42px;white-space:nowrap\">"+Value+"</td>");
								}
								else
								{
									boolean usage =true;
									if(mes_name!=null && mes_name.equalsIgnoreCase("Cpu_used")  && (!isMDV))
									{
										dataBuf.append("<td style=\"border:none;text-align:center;padding-left:3px;padding-right:30px;width:42px;white-space:nowrap\">"+Value+"</td>");
									}
									else if(units!=null && units.equals("%") && !mes_name.equalsIgnoreCase("Ready") && usage  && (!isMDV))
									{
										dataBuf.append("<td style=\"border:none;text-align:center;padding-left:3px;padding-right:30px;width:42px;white-space:nowrap\">"+Value+"</td>");
									}
									else
									{
										dataBuf.append("<td style=\"border:none;text-align:center;padding-left:3px;width:100%;white-space:nowrap;\">"+Value+"</td>");
									}
								}
							}
										dataBuf.append("</tr>");
									dataBuf.append("</table>");
								dataBuf.append("</td>");
						}
						p++;
					}
				}
				else if(userType!=null && !(userType.equalsIgnoreCase("AppXenApp7") || userType.equalsIgnoreCase("AppDDXenApp7") || userType.equals("AppLaunchDDXenApp7") || userType.equalsIgnoreCase("AppVDI") || userType.equalsIgnoreCase("AppDDVDI")))
				{
					int p=0;
					while(p<measureList.size())
					{
									//buf.append("<td style=\"font-size:11px;text-align:right;width:20px;padding-right:10px;!important\" align=\"right\" class=\"x-grid-cell x-grid-cell-gridcolumn x-grid-cell-first\">-</td>"); 
									dataBuf.append("<td  style=\"padding-top:4px;\" align=\"center\" >");
										dataBuf.append("<table cellspacing=\"0\" cellpadding=\"0\" style=\"table-layout:auto;border:0px solid red\" align=\"left\">");
											dataBuf.append("<tr style=\"background:none !important\">");
												//buf.append("<td align=\"right\" style=\"font-size:11px;text-align:right;width:20px;padding-right:10px\">");
												//buf.append("</td>");
												dataBuf.append("<td style=\"text-align:left;border:none;\">");
												dataBuf.append("-</td>");
											dataBuf.append("</tr>");
										dataBuf.append("</table>");
									dataBuf.append("</td>");
						p++;
						dataVector.add("-");
					}
				}
									dataBuf.append("</tr>");

				if(!isAllNeg)
				{
					listData.add(dataVector);
					buf.append(dataBuf.toString());
				}
			}
								buf.append("</tbody>");	
							buf.append("</table>");
						buf.append("</div>");
					buf.append("</td>");
				buf.append("</tr>");
			buf.append("</table>");
		}
		
	}
	else
	{
		int col_span=measureList.size();
		buf.append("<table border=\"0\" width=\"100%\" height=\"100%\" bordercolor=\"green\">");
			buf.append("<tr style=\"background:none\">");
				buf.append("<td align=\"center\" width=\"100%\" colspan=\""+col_span+"\" height=\"100%\" class=\"commonErrorMsgText\" >");
					buf.append("<img src = \"/final/images/spacer.gif\" class=\"iconInformation\" lign = \"center\" border = \"0\"  vspace = \"10\"/>");
					if(userType!=null && userType.equalsIgnoreCase("VDIESX"))
					{
						//buf.append("<br>"+mappingInfo.getTextDescription("monitor.endUserDashboard.The relevant virtual components may not be Managed"));
						buf.append("<br>"+mappingInfo.getTextDescription("monitor.endUserDashboard.No Data Found"));
					}
					else
					{
						buf.append("<br>"+mappingInfo.getTextDescription("monitor.endUserDashboard.No Records Found"));
					}
				buf.append("</td>");
			buf.append("</tr>");
		buf.append("</table>");
	}
	session.setAttribute("endusercsvlist",listData);

	if(isDataManagerLogin)
	{
		if(request.getQueryString()!=null)
		{
			String qry=request.getQueryString();
			qry=com.egurkha.util.StringUtils.replace(qry, "\\", "\\\\");
			session.setAttribute("monitorLastSession","/final/monitor/endUserDashboard.jsp?access=allusers&"+qry);
		}
		else
			session.setAttribute("monitorLastSession","/final/monitor/endUserDashboard.jsp?access=allusers");
	}

	if(!isCSV)
		response.getWriter().write(buf.toString());
}
catch(Throwable th)
{
	th.printStackTrace();
}
%>

<%!
	private static DecimalFormat df = (DecimalFormat)NumberFormat.getNumberInstance();
	static{
		DecimalFormatSymbols dfs = new DecimalFormatSymbols();
		dfs.setDecimalSeparator('.');

		df.applyPattern("#.##");
		df.setDecimalFormatSymbols(dfs);
		df.setGroupingSize(0);
	}

	private static DecimalFormat df2 = (DecimalFormat)NumberFormat.getNumberInstance();
	static{
		DecimalFormatSymbols dfs2 = new DecimalFormatSymbols();
		dfs2.setDecimalSeparator('.');

		df2.applyPattern("#.####");
		df2.setDecimalFormatSymbols(dfs2);
		df2.setGroupingSize(0);
	}

	private static DecimalFormat df3 = (DecimalFormat)NumberFormat.getNumberInstance();
	static{
		DecimalFormatSymbols dfs3 = new DecimalFormatSymbols();
		dfs3.setDecimalSeparator('.');

		df3.applyPattern("#");
		df3.setDecimalFormatSymbols(dfs3);
		df3.setGroupingSize(0);
	}

	public static String formatDbValue(String measure)
	{
		String value="";
		try
		{
			/*
				* Check the indexOf "e", For avoid Exponent or Scientific Notation in a String, 
				Because of Address and other String field changed like double data type value
				when we use Double.parseDouble, Its wrong, So put this fix.

				* The real double value not affected because of this change. its shown as per db..

				* changed by Saravanan.A on 31-1-2012.
			*/

			/*
				* Double parsing have problem when double value range exceed, So used BigDecimal instead of Double parsing.

				* changed by Saravanan.A on 15-2-2012.
			*/

			String measure_lower=null;
			if(measure!=null && measure.length()>0)
				measure_lower=measure.toLowerCase().trim();
			
			if(measure_lower!=null && measure_lower.indexOf("e")>-1)
			{
				try
				{
					BigDecimal bigDecRef = new BigDecimal(measure);
					value=df2.format(bigDecRef);
				}
				catch(Exception eee)
				{
					value=measure;
				}
			}
			else
			{
				//double val=Double.parseDouble(measure);
				//value = df.format(val);

				BigDecimal bigDecRef = new BigDecimal(measure);
				value = df.format(bigDecRef);
				double xxx=bigDecRef.doubleValue();
				if(xxx>=100.0)
				{
					value = df3.format(bigDecRef);
				}
				else if(xxx>=1 && xxx<100)
				{
					value = df.format(bigDecRef);
				}
				else
				{
					value=df2.format(bigDecRef);
				}

			}
		}catch(Exception e)
		{
			value=measure;
		}
		return value;
	}

%>
<%!
	public void writeLog(String content,boolean isDebugEnabledField,int logFileSizeField)
	{
		if(isDebugEnabledField)
		{
			boolean append = true;
				try
				{
					String path = EgInstallInfo.getInstallDir()+ "/manager/logs/userExpDashBoard.txt";
					File f = new File(path); 
					if(f.exists())
					{
						int size = new FileInputStream(f).available();
						if(size>(1024*1024*logFileSizeField))
						{
							append = false;
							content = "";
						}
					}
					PrintWriter pw = new PrintWriter(new FileWriter(path,append));
					pw.write(new java.util.Date()+" endUserDashboardDataPrint.jsp "+content);
					pw.write("\n");
					pw.flush();
					pw.close();
				}
				catch (Exception e)
				{
					e.printStackTrace();
				}
		}
	}

	public static String getConvertDays(String Value,EgDashBoardModel egDashboard)
	{
		String dateDiff="";
		String currentValue=Value;
		try
		{
			if(currentValue!=null && !currentValue.trim().equals(""))
			{
				long minutes=0;
				float seconds=0.0f;
				if(currentValue!=null && currentValue.indexOf(".")>0)
				{
					minutes=Long.parseLong(currentValue.substring(0,currentValue.indexOf(".")));
					if(currentValue.substring(currentValue.indexOf(".")+1).length()>2)
					{
						seconds=Float.parseFloat(currentValue.substring(currentValue.indexOf("."),currentValue.indexOf(".")+3));
					}
					else
					{
						seconds=Float.parseFloat(currentValue.substring(currentValue.indexOf(".")));
					}
				}
				else
				{
					minutes=Long.parseLong(currentValue);
				}
				long valueInSecond=(minutes*60)+(long)(seconds*60);;
				dateDiff=egDashboard.getDateDifferenceStringforUptime(valueInSecond);
			}
			else
			{
				dateDiff=currentValue;
			}
		}
		catch(Exception eeew)
		{
			dateDiff=currentValue;
		}

		if(dateDiff!=null && dateDiff.indexOf("M")!=-1 && dateDiff.indexOf("S")!=-1)
		{
			try
			{
				dateDiff=dateDiff.substring(0,dateDiff.indexOf("M")+4);
			}
			catch(Throwable ee)
			{
				ee.printStackTrace();
				dateDiff=dateDiff;
			}
		}

		return dateDiff;
	}
	//------- Time Out Check -------
	public boolean isTimeoutCheck(String compName,String tmp_keyTest,String msmtHost,String compValue,String info_to_lower)
	{
		Hashtable lastMsmtTime =  (Hashtable)EgLastMeasureThread.lastMsmtTime;
		MonitorDAOFactory monitorDaoFactory = MonitorDAOFactory.getInstance();
		MeasuresDAO tmpMeasuresDao = monitorDaoFactory.getMeasuresDAO();

		//lastMsmtTime for Test
		String measureLastKey = compName+":"+tmp_keyTest+":"+msmtHost;
		String infoML = "";
		String msmtTimeML = "";
		boolean MlFinds = false;
		boolean isTimeout = true;
		
		if(info_to_lower.indexOf("+")<0)
		{
			info_to_lower = "+"+info_to_lower;
		}
		
		if(lastMsmtTime != null && lastMsmtTime.containsKey(measureLastKey))
		{
			ArrayList infoLastMsmtList = (ArrayList) lastMsmtTime.get(measureLastKey);
			if(infoLastMsmtList != null && infoLastMsmtList.size() > 0)
			{
				for(int k=0;k<infoLastMsmtList.size();k=k+2)
				{
					infoML = (String)infoLastMsmtList.get(k);
					msmtTimeML = (String)infoLastMsmtList.get(k+1);
					if(info_to_lower.equals(infoML))
					{
						MlFinds = true;
						break;
					}
				}
			}
		}

		String db_str_msmt_time = "";
		SimpleDateFormat currForm = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		SimpleDateFormat outForm = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");
		
		try
		{
			 db_str_msmt_time = outForm.format(currForm.parse(msmtTimeML));
		}
		catch(Exception e)
		{
			MlFinds = false;
		}

		if(MlFinds)
		{
			isTimeout = tmpMeasuresDao.isTimeOut(db_str_msmt_time,tmp_keyTest+"#"+msmtHost,compName,compValue);
		}

		return isTimeout;
	}

	public String removeSkipMetrics(String measuresOrg, String measuresToSkipTmp)
	{
		String measures="";
		try
		{
			ArrayList measures_t_list=new ArrayList();
			if(measuresToSkipTmp!=null && measuresToSkipTmp.trim().length()>0)
			{
				measures_t_list = StringUtils.egTokenizer(measuresToSkipTmp,",",false,true,true);//param 3-->includeEmpty,4-->unique,5-->trim
			}

			if(measures_t_list!=null && measures_t_list.size()>0)
			{
				boolean commaNeeded=false;
				String temp="";
				StringTokenizer values = new StringTokenizer(measuresOrg,",");
				while(values.hasMoreTokens())
				{
					String value = values.nextToken();
					if(value!=null && !value.equals(""))
					{
						if(!measures_t_list.contains(value))
						{
							temp += commaNeeded?","+value:value;
							commaNeeded = true;
						}
					}
				}

				if(temp!=null && temp.length()>0)
				{
					measures = temp;
				}
				else
					measures = measuresOrg;
			}
			else
			{
				measures = measuresOrg;
			}
		}
		catch(Throwable eee)
		{
			eee.printStackTrace();
			measures = measuresOrg;
		}

		return measures;
	}

	public String getMeasureForUI(String measuresD, String measuresT)
	{
		String measures="";
		try
		{
			ArrayList measures_t_list=new ArrayList();
			if(measuresT!=null && measuresT.trim().length()>0)
			{
				measures_t_list = StringUtils.egTokenizer(measuresT,",",false,true,true);//param 3-->includeEmpty,4-->unique,5-->trim
			}

			if(measures_t_list!=null && measures_t_list.size()>0)
			{
				boolean commaNeeded=false;
				String temp="";
				StringTokenizer values = new StringTokenizer(measuresD,",");
				while(values.hasMoreTokens())
				{
					String value = values.nextToken();
					if(value!=null && !value.equals(""))
					{
						StringTokenizer valTokens = new StringTokenizer(value,":");
						int count = valTokens.countTokens();
						if(count==3)
						{
							String tempTestMeasure = "";
							tempTestMeasure = value.substring(0,value.lastIndexOf(":"));
							String tempDisplayName = value.substring(value.lastIndexOf(":")+1);
							String tempTestMeasureDisp = tempTestMeasure+":"+tempDisplayName.trim();
							
							//if(!tempTestMeasure.equalsIgnoreCase(testMeasure))
							if(measures_t_list.contains(tempTestMeasureDisp))
							{
								temp += commaNeeded?","+tempTestMeasureDisp:tempTestMeasureDisp;
								commaNeeded = true;
							}
						}
						else
						{
							temp+= commaNeeded?","+value:value;
							commaNeeded = true;
						}
					}
				}

				if(temp!=null && temp.length()>0)
				{
					measures = temp;
				}
				else
					measures = measuresD;
			}
			else
			{
				measures = measuresD;
			}
		}
		catch(Throwable eee)
		{
			eee.printStackTrace();
			measures = measuresD;
		}

		return measures;
	}

	public ArrayList getTokenList(String inputStr,String sep)
	{
		ArrayList tmpList = new ArrayList();
		if(inputStr!=null && inputStr.trim().length()>0)
		{
			tmpList = com.egurkha.util.StringUtils.egTokenizer(inputStr,sep,false,true,true);//param 3-->includeEmpty,4-->unique,5-->trim
		}

		return tmpList;
	}

	public String getRelavantOrderByColumnNames(ArrayList metricsList,String columnDispName,EgDbInfo Dbdata)
	{
		String tmpOrderByColumnName=null;
		StringBuffer orderByColumnNameSb = new StringBuffer();
		if(metricsList != null && metricsList.size()>0)
		{
			int val_count = 0;
			for(int i=0;i<metricsList.size();i++)
			{
				String met = (String)metricsList.get(i);
				if(met == null || met.trim().length() == 0)
					continue;
				ArrayList check = com.egurkha.util.StringUtils.egTokenizer(met, ":", true,false,true);
				if(check != null)
				{
					int sizeCheck=check.size();
					if(sizeCheck==3 || sizeCheck==5)
					{
						String tempTest = "";
						String tempMeasure = "";
						String tempDispName = "";
						String tempLocColName = "";
						String meas = "";
						String colName = "";

						if(sizeCheck==3)
						{
							tempTest =  (String)check.get(0);
							tempMeasure =  (String)check.get(1);
							tempDispName =  (String)check.get(2);
						}
						else if(sizeCheck==5)
						{
							tempTest = (String)check.get(0);
							tempMeasure = (String)check.get(1);
							colName = (String)check.get(2);
							meas = (String)check.get(3);
							tempDispName = (String)check.get(4);
						}

						if(tempDispName!=null && tempDispName.equalsIgnoreCase(columnDispName))
						{
							if(sizeCheck==3)
							{
								String neworderByColumn = Dbdata.getColumnForMeasure(tempTest,tempMeasure); 
								if(neworderByColumn==null || neworderByColumn.trim().length()==0)
									neworderByColumn = tempMeasure;

								orderByColumnNameSb.append(","+neworderByColumn);
							}
							else if(sizeCheck==5)
							{
								String neworderByColumn = Dbdata.getColumnForMeasure(tempTest+"_DDD",colName); 
								if(neworderByColumn==null || neworderByColumn.trim().length()==0)
									neworderByColumn = colName;

								orderByColumnNameSb.append(","+neworderByColumn);
							}
						}
					}
				}
			}
		}

		if(orderByColumnNameSb!=null)
			tmpOrderByColumnName = orderByColumnNameSb.toString();
	
		if(tmpOrderByColumnName!=null && tmpOrderByColumnName.startsWith(","))
			tmpOrderByColumnName = tmpOrderByColumnName.substring(1);

		return tmpOrderByColumnName;
	}
	public String getMeasureValue(Hashtable measureValues,String test,String measure,String info,String compNameWithOutPort)
	{
		String value=(String)measureValues.get(test+"^"+measure+"^"+info+"^"+compNameWithOutPort);

		if(value==null || value.trim().length()==0)
			value=(String)measureValues.get(test+"^"+measure+"^"+info.toLowerCase()+"^"+compNameWithOutPort);

		if(value==null || value.trim().length()==0)
			value=(String)measureValues.get(measure+"^"+info+"^"+compNameWithOutPort);

		if(value==null || value.trim().length()==0)
			value=(String)measureValues.get(measure+"^"+info.toLowerCase()+"^"+compNameWithOutPort);

		return value;
	}

	public String getManagerTimeToUserTimeConvertion(IniFile egFormat, EgTimeZoneConverter convert, User user, String testName, String measureName, String orgValue)
	{
		String value = orgValue;
		String dateColumn ="";
		
		if(measureName!=null && measureName.trim().length()>0)			
			dateColumn=(String)egFormat.getValue("Convert_ManagerTime_To_UserTime",testName+":"+measureName);	
		
		try
		{

			if(dateColumn!=null && dateColumn.trim().length()>0 )
			{						
				String date = orgValue.substring(0,orgValue.indexOf(" ")).trim();
				String time = orgValue.substring(orgValue.indexOf(" ")).trim();						

				if(user != null)
				{
					String userFormat = user.getUserDateFormat();											
					date = DateUtil.changeDateFormat(date,dateColumn,userFormat);									
					convert = new EgTimeZoneConverter(date+" "+time,user);										
					date = convert.getDate(false)+" "+convert.getHour()+":"+convert.getMinute()+":"+convert.getSecond();		
					value = date;																	
				}
			}
		}
		catch(Exception e)
		{
			return value;
		}
		return value;
	}

	public ArrayList getUniqueUserList(EgList vdiDesktopsList)
	{
		ArrayList tmpList = new ArrayList();
		HashSet uniqueUserSet=new HashSet();
		if(vdiDesktopsList!=null)
		{
			for(int i=0;i<vdiDesktopsList.size();i++)
			{
				EgService serv = (EgService)vdiDesktopsList.get(i);
				String desktopComponent = serv.getName();
				String desktopState = serv.getState().getName();

				String desktopName = "";
				String info="";
				String comp = "";
				
				if(desktopComponent!=null && desktopComponent.indexOf("^")>-1)
				{
					desktopName = desktopComponent.substring(0,desktopComponent.lastIndexOf("^"));
					info = desktopName;
					comp = desktopComponent.substring(desktopComponent.lastIndexOf("^")+1);
				}

				if(info.indexOf("\\") > -1 && info.indexOf("_on_") > -1 && info.indexOf("\\") < info.indexOf("_on_"))
				{
					ArrayList user_and_desktop =  com.egurkha.util.StringUtils.egTokenizer(info, "_on_",false,false,true);//param 3-->includeEmpty,4-->unique,5-->trim

					if(user_and_desktop!=null && user_and_desktop.size()>0)
					{
						String only_user=(String)user_and_desktop.get(0);
						if(only_user!=null && only_user.trim().length()>0)
							uniqueUserSet.add(only_user);
					}
				}
				else
					uniqueUserSet.add(info);
			}
			if(uniqueUserSet!=null && uniqueUserSet.size()>0)
				tmpList.addAll(uniqueUserSet);
		}
		return tmpList;
	}
	public String getLabel(String name, String value)
	{
		return "<td><span style=\"float:left\" class=\"formLabel\">"+name+"</span><span style=\"float:left;width:10px\" align=\"center\" >:</span><span style=\"float:left;\" class=\"formValue\">"+value+"</span></td>";
	}

	public String HideDisabledTest(String measure, String userType , User user, EgSpecsInfo specsInfo ,IniFile ini,boolean isDetailsFromADOnly,boolean isShowUserLocation)
	{
		String tem_measures= measure;
		String result_measure= "";
		try
		{

			List test_comps = user.getServerTypes();
			List vmTypeList = user.getOnlyVMTypes();
			List vmServersList = user.getOnlyVMServers(false);
			String userTypeStr=ini.getValue("USER_TYPE_COMPONENTS",userType);
			ArrayList userTypeList = new ArrayList();
			if(userTypeStr!=null && userTypeStr.trim().length()>0)
				userTypeList = (ArrayList)getTokenList(userTypeStr,",");
			else
				 return tem_measures;
			
			ArrayList measure_List = new ArrayList();
			ArrayList tmp_measure_List = new ArrayList();
			
			if(measure!=null && measure.trim().length()>0)
				measure_List = (ArrayList)getTokenList(measure,",");
			else
				 return tem_measures;

			String selectedComp ="";
			if(test_comps!=null && test_comps.size()>0)
			{
				for(int b=0;b<test_comps.size();b++)
				{
					String compTypr= (String) test_comps.get(b);
					if(userTypeList.contains(compTypr))
					{
						selectedComp = (String) test_comps.get(b);
						if(selectedComp!= null && selectedComp.trim().length()>0)
						{
							for(int c=0;c<measure_List.size();c++)
							{
								String meas = (String)measure_List.get(c);
								String meas_test = meas.substring(0,meas.indexOf(":"));
								if(specsInfo.isTestRelevantForServer(selectedComp,meas_test))
								{
									if(!tmp_measure_List.contains(meas))
									{
										tmp_measure_List.add(meas);
										result_measure+=meas+",";
									}
								}
								else if(isDetailsFromADOnly && isShowUserLocation && meas_test.equals("GeoDetails"))
								{
									if(!tmp_measure_List.contains(meas))
									{
										tmp_measure_List.add(meas);
										result_measure+=meas+",";
									}
								}
							}
						}
					}
				}
				if(tmp_measure_List!=null && tmp_measure_List.size()==0 && (user.isOnlyVMAssigned() || user.isVMAssigned()) && user.getOnlyVMs().size()>0 && vmTypeList!=null && vmTypeList.size()>0)
				{
					for(int b=0;b<vmTypeList.size();b++)
					{
						String compTypr= (String) vmTypeList.get(b);
						if(userTypeList.contains(compTypr))
						{
							selectedComp = (String) vmTypeList.get(b);
							if(selectedComp!= null && selectedComp.trim().length()>0)
							{
								for(int c=0;c<measure_List.size();c++)
								{
									String meas = (String)measure_List.get(c);
									String meas_test = meas.substring(0,meas.indexOf(":"));
									if(specsInfo.isTestRelevantForServer(selectedComp,meas_test))
									{
										if(!tmp_measure_List.contains(meas))
										{
											tmp_measure_List.add(meas);
											result_measure+=meas+",";
										}
									}
									else if(isDetailsFromADOnly && isShowUserLocation && meas_test.equals("GeoDetails"))
									{
										if(!tmp_measure_List.contains(meas))
										{
											tmp_measure_List.add(meas);
											result_measure+=meas+",";
										}
									}
								}
							}
						}
					}
				}
			}
			else
				return tem_measures;

			if(result_measure.trim().length()>0 && result_measure.endsWith(","))
				result_measure = result_measure.substring(0,result_measure.lastIndexOf(","));
		}
		catch(Exception eeb)
		{
			eeb.printStackTrace();
			return tem_measures;
		}
		return result_measure;
	}
%>

