<%@ include file = "ErTracker.jsp" %>
<%@ page import = "com.eg.EgDateInfo" %>
<%@ page import = "com.eg.EgGroupInfo" %>
<%@ page import = "com.eg.EgDiscInfo" %>
<%@ page import = "com.eg.EgTopoInfo" %>
<%@ page import = "com.eg.EgServicesInfo" %>
<%@ page import = "com.eg.EgDbInfo" %>
<%@ page import = "com.eg.EgTablesInfo" %>
<%@ page import = "com.eg.EgTesterInfo" %>
<%@ page import = "com.eg.EgURLEncoder" %>
<%@ page import = "com.eg.EgURLDecoder" %>
<%@ page import = "com.egurkha.util.DateTimeTokenizer" %>
<%@ page import = "com.egurkha.util.DateUtil" %>
<%@ page import = "com.eg.EgInstallInfo"%>
<%@ page import = "com.eg.EgMappingInfo"%>
<%@ page import = "com.eg.IniFile"%>
<%@ page import = "com.egurkha.pdfmaker.*" %>
<%@ page import = "com.eg.EgConfigInfo"%>
<%@ page import = "com.eg.EgReportInfo"%>
<%@ page import="com.egurkha.util.StringUtils"%>
<%@ page import="egurkha.reporter.*"%>
<%@ page import = "net.sf.json.*"%>
<%@ page import = "java.util.Date" %>

<%@ page import="java.text.*" %>

<%@ taglib prefix="egui" uri="../WEB-INF/eg-taglib.tld" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>

<%
String er_RmDispName = request.getParameter("er_RmDispName");

try
{
	EgTimeZoneConverter converterStart=null;
	EgTimeZoneConverter converterEnd=null;
	String uiFile = "eg_ui.ini";
	String s_iniFile_dir = EgInstallInfo.getInstallDir()+ "/manager/config/";
	com.eg.IniFile egUI = new com.eg.IniFile(s_iniFile_dir + uiFile);
	String currentDateFormat = strUserDateFormat;
	EgDbInfo dbInfo = new EgDbInfo("manager");
	String pdfPrint = request.getParameter("pdfPrint");
	String selectedComp[] = request.getParameterValues("er_component");
	String er_timeline = request.getParameter("er_timeline");
	String sample = request.getParameter("sample");
	String analyzeBy = request.getParameter("er_datafrom");
	String compType = request.getParameter("er_comptype");
	String component = request.getParameter("er_component");
	String excweekends = request.getParameter("er_excwe");
	String serverTable_view = request.getParameter("serverTable_view");
	String isSummaryView = request.getParameter("isSummaryView");
	String er_option = request.getParameter("er_option");
	String er_site = request.getParameter("er_site");
	if(isSummaryView == null)
		isSummaryView="yes";	
	EgReportInfo reportInfo = new EgReportInfo("manager");
	EgTesterInfo testerInfo = new EgTesterInfo ("manager");
	EgTablesInfo tablesInfo = new EgTablesInfo ("manager");
	ErUtils erUtils = new ErUtils();
	ErReqData erd = new ErReqData(request);
	String mngrIP = new IniFile(new EgConfigInfo("manager").getDbFile()).getValue("DB_PROPERTIES","ManagerUrl");
	CitrixCapacityPlannigDAO ctrxbean=new CitrixCapacityPlannigDAO();
	String thisLanguage="";
	if (thisuser!=null)
	{
		String userLang = thisuser.getLanguage();
		if (userLang!=null && !userLang.equalsIgnoreCase("NULL"))
		{
			thisLanguage=userLang;
		}
	}
	EgMappingInfo	intlmap  = new EgMappingInfo(thisLanguage);
	if(compType != null)
		compType=intlmap.getComponentTypeDescription(compType);
	Map resultMap = (Map) session.getAttribute("CITRIX_CAPACITY_PLANNING_REPORT_RESULT");
	boolean noDataFound = true;
	if(resultMap != null )
	{
		Boolean noData = ((Boolean) resultMap.get("NO_DATA_FOUND"));
		if(noData != null)
			noDataFound = noData.booleanValue();
	}
	String resultFor = ((String) resultMap.get("resultsetFor"));
%>

<!Doctype html>
	<head>
		<title> <egui:intnl text="reporter.common.Capacity Planning Report"/> </title>
		<meta name="Author" content="">
		<meta  charset="UTF-8">
	
		<!-- <link rel="stylesheet" type="text/css" href="../../final/styles/eGLightTheme.css" /> -->

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

		<style>

			@media print {body {-webkit-print-color-adjust: exact;}}

			body{font-size:11px;line-height:1.5em;color:#2a292a;}
			.notesTextBold{
				font-size: 13px !important;
				font-weight:500;
				color:#000000;
			}
			.notes .paperPinPdf{
				background: url("/final/images/Light/paperPin.png")no-repeat top right;
				position:relative;
				top:-20px;
				left:950px;
				width:16px;
				height:28px;
			}
			.gunPoint{
				width:144px;
				height:144px;
				border:1px solid #f3f2f2;
				padding:6px;
				background:#ffffff;
				border-radius:50%;
			} 

			
.highlightColorBox{
background:transparent;
color:#7ed0a2;
padding:0px 10px 0px 10px;
border:2px solid #7ed0a2;
}

.highlightImageBoxWithoutCurve{
  border-style: solid;
  border-width: 1px 1px 1px 1px;
  background:#ececec;
  border-color:#ececec #ececec #ececec #ececec;
  border-radius:0;
  -webkit-border-radius:0;
  -moz-border-radius:0;
  display:inline-block;
  margin:0px 0px 0px 0px;
}
.newFont_normal38{
	font-size: 38px !important;
	color:#2a292a;
}

.plainTableRowHighlight{border:0px solid #b5b5b5;}
.plainTableRowHighlight table{border:1px solid #e3e3e3;}

.plainTableRowHighlight table tbody tr.addTr{background-color:#fbfbfb}
.plainTableRowHighlight table tbody tr.evenTr{background-color:#fbfbfb}

.plainTableRowHighlight table thead tr th {border-width:0px 1px 1px 0px;border-style:solid;border-right-color:#adadad;border-bottom-color:#e3e3e3;padding:6px 10px 3px 10px;font-size:11px;
background-color:#cdcdcd;text-transform:uppercase;line-height:1.8em;}

.plainTableRowHighlight table thead tr th:last-child {border-width:0px 1px 1px 0px;border-style:solid;border-color:#e3e3e3;}

.plainTableRowHighlight table tbody tr td {border-width:0px 0px 1px 0px;border-style:solid;border-color:#d3d3d3;padding:5px 10px 2px 10px;font-size:11px;
line-height:1.5em;}

.plainTableRowHighlight table tbody tr td.rowspanTd{border-width:0px 1px 1px 0px;border-style:solid;border-color:#d3d3d3;padding:5px 10px 2px 10px;font-size:11px;
line-height:1.5em;}

.plainTableRowHighlight table tbody tr td.highLight{background-color:#e8e8e8;border-width:0px 0px 1px 0px;border-style:solid;border-color:#d3d3d3;}

.plainTableRowHighlight table tbody tr td.suggestionTd{border-width:3px 0px 3px 0px;border-style:solid;border-color:#8eb363;}
.plainTableRowHighlight table tbody tr td.suggestionTd:first-child{border-width:3px 0px 3px 3px;border-style:solid;border-color:#8eb363;}
.plainTableRowHighlight table tbody tr td.suggestionTd:last-child{border-width:3px 3px 3px 0px;border-style:solid;border-color:#8eb363;}

.recommendationText{
	font-size: 10px !important;
	color:#505050;
	filter:alpha(opacity=80);
	opacity: 0.80;
}

.chartOuterBox .rectBox{
  border-style: solid;
  border-width: 1px 1px 1px 1px;
  border-color:#e8ae59 #e8ae59 #e8ae59 #e8ae59;
  width:68px;
  background-color:#e8ae59;
   font-size: 12px;
	font-weight:400;
   color:#ffffff;
   height:18px;
   text-align:center;
   margin:10px auto 0px auto;
   -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  border-radius:3px;
  -webkit-border-radius:3px;
  -moz-border-radius:3px;
}
.ctxDonutChartTitleOuter{
	width:80px;
	margin:0px;
	position:relative;
	margin-top:-5px;
	text-align:center;
	padding-top:8px;
}
.ctxDonutChartTitleMiddle{
	font-size:24px;
	color:#78c1dc;
	line-height:100%;
}

.ctxDonutChartTitleMiddleUnit{ 
	font-size:13px;
	color:#78c1dc;
	line-height:100%;
}
.ctxSessionsTextBlue11{
	font-size:11px;
	color:#78c1dc;
}

.ctxSessionsTextBrown11{
	font-size:11px;
	color:#e8ae59;
}

.ctxSessionsTextBlueLegend{
	background-color:#78c1dc;
	width:7px;
	height:7px;
	 border-radius:4px;
  -webkit-border-radius:4px;
  -moz-border-radius:4px;
	margin:4px;
}
.ctxSessionsTextBrownLegend{
	background-color:#e8ae59;
	width:7px;
	height:7px;
	border-radius:4px;
  -webkit-border-radius:4px;
  -moz-border-radius:4px;
	margin:4px;
}



.chartOuterBox{
  width:164px;
  height:154px;
  border:2px solid #fff;
  position:relative; 
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  display:inline-block;
  padding:0px;
  margin:0px 0px 0px 0px;
}

.chartOuterBox .header{
  width:90px;
  text-align:center;
  height:18px;
  padding:4px;
  color:#2a292a;
  margin:-5px auto 5px auto;
  background-color:#fff;
   -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  font-size: 13px !important;
	font-weight:400 !important;
  line-height:10px;
  
}

.chartOuterBox.highlight{
  width:164px;
  height:154px;
  border:2px solid #e1e1e1;
  position:relative;
   -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  display:inline-block;
  padding:0px;
  margin:0px 0px 0px 0px;
}

.chartOuterBox .triangleTopRight{
	width: 0;
	height: 0;
	border-top: 40px solid white;
	border-left: 40px solid transparent;
	position:absolute;
	top:0px;
	right:0px;
	z-index:-1;
}

.chartOuterBox.highlight .triangleTopRight{
	width: 0;
	height: 0;
	border-top: 40px solid #ed4b36;
	border-left: 40px solid transparent;
	position:absolute;
	top:0px;
	right:0px;
	z-index:0;
}

#newimg{page-break-inside:avoid}
.newimg{page-break-inside:avoid}
 
.consumptionperSessionTitleBgLine {
	width:100%; 
	height:1px; 
	background:#e4e4e4;
}
.notesTextBold14 {
	font-size: 14px !important;
    font-weight: 700 !important;
    color: #000000;
}
.notesTextBold28 {
	font-size: 28px !important;
    font-weight: 700 !important;
    color: #000000;
}
.newFont_normal30{
	font-size: 30px !important;
	color:#2a292a;
}
.resoureUsageTableDiv {
	float:left; 
	min-width:145px;
    justify-content: center;
    display: flex; 
	padding:0px 20px 0px 0px; 
}





	/* Capacity Planning New Design Starts*/
	.highlightContainerBoxFlex {
		background:#f8f8f8;
		display: flex;
		height: 100px;
		display: flex;
		display: -webkit-flex;
		flex-wrap: nowrap;
		flex-direction: row;
		align-items: stretch;
		align-content: stretch;
	}

	.highlightContainerBoxFlex .div1 {
		margin: 0px 5px 0px 20px;
		flex: 1;
		align-items: center;
		vertical-align: middle;
		justify-content: center;
		height: 100px;
		display: flex;
	}
	.alignMiddle {
		display: inline-block;
		align-items: center;
		vertical-align: middle;
	}
	.highLightValue48 {
		font-size: 48px;
		color: #2a292a;
		font-weight: 500;
	}
	.newFont_normal14{
		font-size: 14px;
		color: #2a292a;
	}
	.consumptionperSessionTitle {
		background: #ffffff;
		padding: 0px 10px;
		font-size: 12px;
	}
	.consumptionperSessionTitleBig {
		background: #e1e1e1;
		padding: 4px 10px;
		font-size: 14px;
	}
	.consumptionperSessionBox {
  display: flex;
  margin: 0px 0px 0px 0px;
  flex-direction: row;
  align-items: stretch;
  align-content: stretch;
  justify-content: center;
}

.consumptionperSessionBox .childDiv {
  display: flex;
  align-items: center;
  vertical-align: bottom;
  justify-content: center;
  margin: 0px 5px 10px 0px;
  padding: 10px;
  flex-grow: 1;
}

.consumptionperSessionBox .childDiv .resourceUsability {
  font-size: 28px;
  font-weight:500;
  color: #2a292a;
  line-height: 1em;
}

.consumptionperSessionBox .childDiv .resourceUnit {
  font-size: 12px;
  font-weight:500;
  color: #2a292a;
}

.consumptionperSessionBox .childDiv .resourceUnitText {
  font-size: 12px;
  color: #2a292a;
}

.consumptionperSessionBox .childDiv .resourceName {
  font-size: 13px;
  color: #2a292a;
}

.consumptionperSessionBox .childDiv:last-child {
  margin: 0px 0px 0px 0px;
}
.newFont_normal14{
    font-size: 14px;
    color: #2a292a;
}

.highlightContainerBox {
  border-style: solid;
  border-width: 1px 1px 1px 1px;
  background: #ffffff;
  border-color: #e1e1e1 #e1e1e1 #e1e1e1 #e1e1e1;
  padding: 8px;
  -webkit-column-count: 2;
  -moz-column-count: 2;
  column-count: 2;
  text-align: center;
  -webkit-column-gap: 20px;
  -moz-column-gap: 20px;
  column-gap: 20px;
  -webkit-column-rule: 1px outset #e1e1e1;
  -moz-column-rule: 1px outset #f7d6d6;
  column-rule: 1px outset #e1e1e1;
}


.recommendationTitle {
  margin-top: -17px;
  text-align: left;
  float: left;
}

.recommendationTitleText {
  background: #ffffff;
  padding: 0px 10px;
  font-size: 13px;
  font-weight:500;
  color: #2a292a;
  width: auto;
}
.resoureUsageTableContainer {
  border-right: 1px solid #e1e1e1;
}

.printOuterBoxNoPadding{
	background-color:#ffffff;
	display:block;
	width: 100%;
	margin:0px;
	padding:0px;
	border:1px solid #dedede;
	box-sizing: border-box;
} 
 .notesBlueTextBold {
  font-size: 13px;
  font-weight:500;
}

.containerBordercls {
	border:1px solid #e4e4e4;
}
.containerBorderTopcls {
	border-style: solid;
	border-width: 1px 0px 0px 0px;
	border-color: #e4e4e4;
}
.containerBorderBottomcls {
	border-style: solid;
	border-width: 0px 0px 1px 0px;
	border-color: #e4e4e4;
}
.containerBorderRightcls {
	border-style: solid;
	border-width: 0px 1px 0px 0px;
	border-color: #e4e4e4;
}
 

	/* Capacity Planning New Design Ends here*/
</style>

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

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

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

		if(pdfPrint !=null && pdfPrint.equalsIgnoreCase("yes"))
		{
	%>
			<div class="<%=strLogCls%>" style="padding:10px"><img src="<%=imageName%>" border="0" /></div>
	<%
		}
		else
		{
	%>
			<div class="<%=strLogCls%>"><img src="<%=imageName%>" border="0" /></div>
	<%
		}
	%>

		<div class="printHeaderBox">
	<%
		if (!StringUtils.isNull(er_RmDispName))
		{
	%>
			<div class="printHeaderBoxTitle"><%= er_RmDispName %></div>
	<%
		}

		if(pdfPrint !=null && pdfPrint.equalsIgnoreCase("yes"))
		{
	%>
			<div class="printHeaderBoxPrintIcon"><img class="iconPrinter mouse"  id="pri ntbt" src="data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" border="0" onClick="javascript:window.print()" alt='<egui:intnl text="reporter.common.PRINT"/>' title='<egui:intnl text="reporter.common.PRINT"/>'/></div>
	<%
		}
	%>
		<!-- <div class="printHeaderBoxContent">Content will display here if needed</div> -->
		</div>
		<div class="printOuterBoxNoBorder"> 
			<div class="printSelectionFields"><%=intlmap.getTextDescription("reporter.common.Analyze By")%> - <span class="bold"><%=intlmap.getTextDescription("reporter.common."+er_option)%></span></div>
	<%
		if(er_option != null && !er_option.equalsIgnoreCase("Component")){
	%>
			<div class="printSelectionFields"><%=intlmap.getTextDescription("reporter.common.Zone")%> - <span class="bold"><%=er_site%></span></div>
	<%
		}
	%>
			<div class="printSelectionFields"><%=intlmap.getTextDescription("reporter.common.Component Type")%> - <span class="bold"><%=compType%></span></div>
	<%
		if(er_option != null && er_option.equalsIgnoreCase("Component")){
	%>
			<div class="printSelectionFields"><%=intlmap.getTextDescription("reporter.common.Component")%> - <span class="bold"><%=component%></span></div>
	<%
		}
	%>
			<div class="printSelectionFields"><%=intlmap.getTextDescription("reporter.common.Exclude weekends")%> - <span class="bold"><%=excweekends%></span></div>
	<%
		String dispStart="";
		String dispEnd="";
		String comFormat="";
		String dispDate="";
		String startDte="";
		String endDte="";
		if(erd.s_stdate!=null)
		{
			if(DateUtil.isDate(erd.s_stdate,"MM/dd/yyyy"))
			{
				comFormat = "MM/dd/yyyy";
			}
			else
			{
				comFormat = currentDateFormat;
			}
			dispDate = 	DateUtil.changeDateFormat(erd.s_stdate,comFormat,currentDateFormat);
			startDte=dispDate;
			converterStart = new EgTimeZoneConverter(dispDate+" "+erd.s_sthr+":"+erd.s_startmin,thisuser);
			dispStart=converterStart.getDateTime()+" hrs";
		}
		if(erd.s_enddate!=null)
		{
			if(DateUtil.isDate(erd.s_enddate,"MM/dd/yyyy"))
			{
				comFormat = "MM/dd/yyyy";
			}
			else
			{
				comFormat = currentDateFormat;
			}
			dispDate = 	DateUtil.changeDateFormat(erd.s_enddate,comFormat,currentDateFormat);
			endDte=dispDate;
			converterEnd = new EgTimeZoneConverter(dispDate+" "+erd.s_endhr+":"+erd.s_endmin,thisuser);
			dispEnd=converterEnd.getDateTime()+" hrs";
		}
	%>
			<div class="printSelectionFields"><egui:intnl text="reporter.common.TimeLine"/> - <span class="bold"><%=dispStart%>&nbsp;<egui:intnl text="reporter.common.to" />&nbsp;<%=dispEnd%></span></div>
		</div>
		<div class="clearDiv"></div>
	<%
		ArrayList DetailsList=null;
		if(!noDataFound)
		{
			String coulmnList = reportInfo.getValue("CITRIX_CAPACITY_CPU_PLANNING", "componentwiseColumns");
			HashMap serverDatas = (HashMap)resultMap.get("ServerWiseDatas");
				DetailsList=new ArrayList();
				if(resultFor != null && resultFor.equalsIgnoreCase("ServerWise"))
				{
					String CompName ="";
					ArrayList al=new ArrayList();
					String limitBy="";
					JSONObject actveSessnGraph=null;
					JSONObject cpuMemoryGraph=null;
					JSONObject diskNetworkGraph=null;
					Iterator itr=serverDatas.keySet().iterator();
					while(itr.hasNext())
					{
						CompName = (String) itr.next();
						ArrayList value=(ArrayList)serverDatas.get(CompName);
						if(value != null && value.size() >0)
						{
							for(int i=0;i<value.size();i++)
							{
								HashMap h1=(HashMap)value.get(i); 
								if(h1 != null && h1.size() > 0)
								{
									CitrixInfoBean cib=new CitrixInfoBean(h1,coulmnList);
									DetailsList.add(cib);
									String posssibleCnt=cib.getPossibleSessnsCnt();
									if(cib.getBottleNeckresource() != null && !cib.getBottleNeckresource().equalsIgnoreCase(""))
										limitBy=cib.getBottleNeckresource();
									if(limitBy!= null && !limitBy.equalsIgnoreCase(""))
										al.add(new CustomSort(limitBy,posssibleCnt));
								}
							}
							JSONObject graphdataset=ctrxbean.getGraphDataset(DetailsList,CompName,currentDateFormat,intlmap,timezoneOffsetValue);
							if(graphdataset != null && graphdataset.size() > 0){
								actveSessnGraph=(JSONObject)graphdataset.get("ActiveSession");
								cpuMemoryGraph=(JSONObject)graphdataset.get("CpuMemoryGraph");
								diskNetworkGraph=(JSONObject)graphdataset.get("DiskNetworkGraph");
							}
						}
					}
				
					int additionalPossibleCnt=0;
					String capacityLimitBy="";
					JSONArray limitationArray=new JSONArray();
					JSONArray capacityLimit=null;
					if(al != null && al.size()>0)
					{
						CustomSort.orderby="asc";
						Collections.sort(al);
						int minCal = 0;
						int sInfoSize = al.size();
						if (sInfoSize > 0) 
						{
							String dataPointsForMinCal = reportInfo.getValue("CITRIX_CAPACITY_CPU_PLANNING", "DataPointsForMinCalinUI");
							double dataToBeConsidered = 5;
							if (dataPointsForMinCal != null) {
								dataPointsForMinCal = dataPointsForMinCal.trim();
								if (dataPointsForMinCal.endsWith("%")) 
									dataPointsForMinCal = dataPointsForMinCal.substring(0, dataPointsForMinCal.indexOf("%"));
								try {
									dataToBeConsidered = Integer.parseInt(dataPointsForMinCal);
								} catch (Exception e) {
								System.out.println("Error in data points specification in ini, using default");
								}
							}
							dataToBeConsidered /= 100;
//							minCal = (int) (sInfoSize * dataToBeConsidered);
							double maxVl=(sInfoSize)*(dataToBeConsidered);
							String strVal1=erUtils.round(maxVl,0);
							minCal=Integer.parseInt(strVal1);
							if(minCal > 0)
								minCal=minCal-1;
						}
						if (minCal < 0)
							minCal = 0;

						CustomSort  cs = (CustomSort)al.get(minCal);
						if(cs != null)
						{
							capacityLimitBy=(String)cs.col1;
							double count1=(Double)cs.col2;
							additionalPossibleCnt=(int)count1;
						}
						limitationArray.add(capacityLimitBy);
					}
					JSONObject tot_sessn_graph = (JSONObject)resultMap.get("totalSessionGraph");
					JSONObject totSessnGraph=ctrxbean.getTotalSessionGraphData(tot_sessn_graph,CompName,currentDateFormat,dispStart,dispEnd,intlmap);
					HashMap GraphDatas=new HashMap();
					GraphDatas.put("TotalSessionGraph",totSessnGraph);
					GraphDatas.put("ActiveSessionGraph",actveSessnGraph);
					GraphDatas.put("CpuMemoryGraphGraph",cpuMemoryGraph);
					GraphDatas.put("DiskNetworkGraph",diskNetworkGraph);
					JSONObject lstVal=ctrxbean.getDetailedValues(DetailsList,er_timeline,"true",null,intlmap); 
					if(lstVal != null && lstVal.containsKey("overview1")){
						JSONObject overviewJson=(JSONObject)lstVal.get("overview1");
						Integer possibleSessn=(Integer)overviewJson.get("Possible_Sessions");
						additionalPossibleCnt=possibleSessn.intValue();
						limitationArray=(JSONArray)overviewJson.get("Limit_By");
					}
	%>
		<div class="printOuterBoxNoPadding">
			<div class="printOuterBoxHeader consumptionperSessionTitleBig" style="text-transform:uppercase;"><%=intlmap.getTextDescription("reporter.common.Analysis")%></div>
			<div style="padding:10 10 0 10">
			<div class="printOuterBox">
				<table align="center" cellspacing="0" cellpadding="0" border="0px" width="100%" >
					<tr>
						<td width="50%" align="center">
							<table cellspacing="0" cellpadding="0" width="100%">
								<tr>
									<td  align="center">
										<h1 class="newFont_normal14" style="padding:3px 10px 12px 10px"><%=intlmap.getTextDescription("reporter.common.Additional Sessions Possible")%></h1>
									</td>
								</tr>
								<tr>
									<td align="center">
										<table cellspacing="0" cellpadding="0" class="highlightColorBox">
											<tr>
												<td class="newFont_bold28"><%=additionalPossibleCnt%></td>
										<%
											if(pdfPrint !=null && pdfPrint.equalsIgnoreCase("yes")){
										%>
												<td style="padding-left:5px"><div class="iconThumsUpColor"></div></td>
										<%
											}else{
										%>
												<td style="padding-left:5px"><div class="iconThumsUpColor"></div></td>
										<%
											}
										%>
											</tr>
										</table>
									</td>
								</tr>
							</table>
						</td>
						<td width="50%" align="center">
							<table cellspacing="0" cellpadding="0">
								<tr>
									<td colspan="<%=limitationArray.size()*2%>">
										<h1 class="newFont_normal14" style="padding:3px 10px 12px 10px" align="center"><%=intlmap.getTextDescription("reporter.common.Capacity is Limited By")%></h1>
									</td>
								</tr>
								<tr>
									<td align="center">
							<%
								for(int i=0;i<limitationArray.size();i++)
								{
									String limitby=(String)limitationArray.get(i);
									String cls="";
									if(limitby != null){
										if(limitby.equalsIgnoreCase("Memory"))
											cls="iconMemory32";
										else if(limitby.equalsIgnoreCase("cpu"))
											cls="iconCpu32";
										else if(limitby.equalsIgnoreCase("Disk")){
											limitby="Disk";
											cls="iconDisk32";
										}
										else
											cls="iconNetwork32";
									}
									if(limitationArray.size() == 1){
								%>
										<div class="newFont_normal13 highlightImageBox" style="margin-left:15px;width:140px">
								<%
									}else{
								%>	
										<div class="newFont_normal13 highlightImageBox" >
								<%
									}
								%>
											<table cellspacing="0" cellpadding="0" width="100%" style="border:0px solid red">
												<tr>
													<td align="center">
														<div><%=limitby%></div>
													</td>
													<td align="left">
														<div class=<%=cls%>></div>
													</td>
												</tr>
											</table>
										</div>
								<%
									if(limitationArray.size() > 1){
								%>
										&nbsp;&nbsp;&nbsp;
							<%
									}
								}
							%>
									</td>
								</tr>
							</table>
						</td>
					</tr>
				</table>
			</div>
			</div>
	<%
			String recommandatn="";
			if(lstVal != null)
			{
				if(lstVal.containsKey("Table_Data"))
				{
					JSONObject obj=(JSONObject)lstVal.get("Table_Data");
					recommandatn=(String)lstVal.get("Recommandatn");
					String recommandatnBasedCalculatn=(String)lstVal.get("RecommandatnBasedCalculatn");
					JSONArray header=(JSONArray)obj.get("header");
					JSONArray currentusage=(JSONArray)obj.get("dataArray");
					JSONArray byCapacity=(JSONArray)obj.get("dataArray_1");
						JSONObject usage=(JSONObject)lstVal.get("Usage");
						JSONObject cpuGraph=(JSONObject)lstVal.get("CPUGraph");
						JSONObject memoryGraph=(JSONObject)lstVal.get("MemoryGraph");
						JSONObject diskGraph=(JSONObject)lstVal.get("DiskGraph");
						JSONObject networkGraph=(JSONObject)lstVal.get("NetworkGraph");
						GraphDatas.put("CPUUsageGraph",cpuGraph);
						GraphDatas.put("MemoryUsageGraph",memoryGraph);
						GraphDatas.put("DiskUsageGraph",diskGraph);
						GraphDatas.put("NetworkUsageGraph",networkGraph);
	%>
				<div style="padding:10px 10px 20px 10px"><%=recommandatnBasedCalculatn%></div>
					<table width="100%" border="0" cellpadding="0px" cellspacing="0px" valign="top" border="0px" style="padding:0 10 0 10">
						<tr>
							<td width="20%" height="100%" valign="top">
								<div style="position:relative;margin-right:20px;height:214px;min-width:100px" class="highlightFieldsetBox" >
									<div class="newFont_bold13" style="width:80px;position:relative;top:-30px;left:5px;background-color:#fff;padding:4px;"><%=intlmap.getTextDescription("reporter.common.Sessions")%></div>
									<div align="center" class="ctxSessionsValueBlue" style="margin-top:5px;"><%=(Integer)usage.get("AtCapacity")%><br><span class="ctxSessionsTextBlue"><%=intlmap.getTextDescription("reporter.common.At Capacity")%></span></div>
									<div align="center" class="ctxSessionsValueBrown"><%=(Integer)usage.get("currentUsage")%><br><span class="ctxSessionsTextBrown"><%=intlmap.getTextDescription("reporter.common.Current Usage")%></span></div>
								</div>
							</td>
							<td width="80%" style="padding-bottom:10px;height:214px;" valign="top">
								<div style="position:relative;" class="highlightFieldsetBox">
									<div class="newFont_bold13" style="width:280px;position:relative;top:-30px;left:5px;background-color:#fff;padding:4px;"><%=intlmap.getTextDescription("reporter.common.Resource Utilization at Capacity")%></div>
									<table width="100%" cellpadding="0px" cellspacing="0px" valign="top" border="0px">
										<tr>
											<td width="25%" class="graphSeperatorLineRight">
										<%
											Boolean cpuHighlight=(Boolean)cpuGraph.get("highlightEnable");
											if(cpuHighlight.booleanValue()){
										%>
												<div class="chartOuterBox highlight">
												<div style="border:0px solid red;position:absolute;right:0px"><img src="./images/servicewiseHighlight.png"/></div>
										<%
											}else{
										%>
												<div class="chartOuterBox">
										<%
											}

											if(pdfPrint !=null && pdfPrint.equalsIgnoreCase("yes")){
										%>
												<div nowrap class="header" style="margin-top: 0px;"><%=intlmap.getTextDescription("reporter.common.CPU")%></div>
										<%
											}else{
										%>
												<div nowrap class="header" style="margin-top:0px;margin-left:20px;width:125px;"><%=intlmap.getTextDescription("reporter.common.CPU")%></div>
										<%
										
											}


										%>
											<!--<div class="triangleTopRight"></div>-->
											<%
												String urlCPU ="../../final/servlet/com.eg.ErCitrixCapacityPlanningReportC;jsessionid="+session.getId()+"?forPrint=yes&chartType=donut&chartValue=CPUUsageGraph&imagereq=yes&er_width=94&er_height=94";
											%>
													<div style="margin-left:30px;"><img src="<%=urlCPU%>" /></div>
											<%
												if(pdfPrint !=null && pdfPrint.equalsIgnoreCase("yes")){
											%>
													<div class="rectBox" style="margin-top:10px;margin-right:10px;margin-bottom:5px;margin-left:45px;text-align:center;display:inline-block"><%=(Integer)cpuGraph.get("val")%>%</div>
													<div style="position:absolute;top: 50px;right: 45px;"><div><%=(String)cpuGraph.get("title")%></div>
											<%
												}else{
											%>
													<div style="margin-right:10px;margin-left:45px;text-align:center;display:inline-block">
													<svg xmlns="http://www.w3.org/2000/svg">
														<g>
															<rect x="0" y="0" rx="5" ry="5" width="68" height="18" style="fill:#e8ae59;stroke-width:0" ></rect>
															<text x="22" y="14" font-size="12" fill="#ffffff" style="text-align:center"><%=(Integer)cpuGraph.get("val")%>%</text>
														</g>
													</svg></div>
													<div style="position:absolute;top: 50px;left: 37px;"><div><%=(String)cpuGraph.get("title")%></div>
											<%
												}
											%>
												</div>
											</td>
											<td width="25%" class="graphSeperatorLineRight">
										<%
											Boolean memoryHighlight=(Boolean)memoryGraph.get("highlightEnable");
											if(memoryHighlight.booleanValue()){
										%>
												<div class="chartOuterBox highlight">
												<div style="border:0px solid red;position:absolute;right:0px"><img src="./images/servicewiseHighlight.png"/></div>
										<%
											}else{
										%>
												<div class="chartOuterBox">
										<%
											}
											if(pdfPrint !=null && pdfPrint.equalsIgnoreCase("yes")){
										%>
												<div nowrap class="header" style="margin-top: 0px;"><%=intlmap.getTextDescription("reporter.common.Memory")%></div>
										<%
											}else{
										%>
												<div nowrap class="header" style="margin-top:0px;margin-left:20px;width:125px;"><%=intlmap.getTextDescription("reporter.common.Memory")%></div>
										<%
										
											}
										%>
												<!--<div class="triangleTopRight"></div>-->
											<%
												String urlMemory ="../../final/servlet/com.eg.ErCitrixCapacityPlanningReportC;jsessionid="+session.getId()+"?forPrint=yes&chartType=donut&chartValue=MemoryUsageGraph&imagereq=yes&er_width=94&er_height=94";
											%>
													<div style="margin-left: 30px;"><img src="<%=urlMemory%>" /></div>
													
											<%
												if(pdfPrint !=null && pdfPrint.equalsIgnoreCase("yes")){
											%>
													<div class="rectBox" style="margin-top:10px;margin-right:10px;margin-bottom:5px;margin-left:45px;text-align:center;display:inline-block"><%=(Integer)memoryGraph.get("val")%>%</div>
													<div style="position:absolute;top: 50px;right: 45px;"><div ><%=(String)memoryGraph.get("title")%></div>
											<%
												}else{
											%>
													<div style="margin-right:10px;margin-left:45px;text-align:center;display:inline-block">
													<svg xmlns="http://www.w3.org/2000/svg">
														<g>
															<rect x="0" y="0" rx="5" ry="5" width="68" height="18" style="fill:#e8ae59;stroke-width:0" ></rect>
															<text x="22" y="14" font-size="12" fill="#ffffff" style="text-align:center"><%=(Integer)memoryGraph.get("val")%>%</text>
														</g>
													</svg>
													</div>
													<div style="position:absolute;top: 50px;left: 37px;"><div ><%=(String)memoryGraph.get("title")%></div>
											<%
												}
											%>
													</div>
											</td>
											<td width="25%" class="graphSeperatorLineRight">
										<%
											Boolean diskHighlight=(Boolean)diskGraph.get("highlightEnable");
											if(diskHighlight.booleanValue()){
										%>
												<div class="chartOuterBox highlight">
												<div style="border:0px solid red;position:absolute;right:0px"><img src="./images/servicewiseHighlight.png"/></div>
										<%
											}else{
										%>
												<div class="chartOuterBox">
										<%
											}
											if(pdfPrint !=null && pdfPrint.equalsIgnoreCase("yes")){
										%>
												<div nowrap class="header" style="margin-top: 0px;"><%=intlmap.getTextDescription("reporter.common.Disk")%></div>
										<%
											}else{
										%>
												<div nowrap class="header" style="margin-top:0px;margin-left:20px;width:125px;"><%=intlmap.getTextDescription("reporter.common.Disk")%></div>
										<%
										
											}
										%>

										<%
										String grpahMrgn="";
										%>
										<!-- <div class="triangleTopRight"></div>-->
													
											<%
												String urlDisk ="../../final/servlet/com.eg.ErCitrixCapacityPlanningReportC;jsessionid="+session.getId()+"?forPrint=yes&chartType=donut&chartValue=DiskUsageGraph&imagereq=yes&er_width=94&er_height=94";
											%>
													<div style="margin-left: 30px;"><img src="<%=urlDisk%>" /></div>
											<%
												if(pdfPrint !=null && pdfPrint.equalsIgnoreCase("yes")){
											%>
													<div class="rectBox" style="margin-top:10px;margin-right:10px;margin-bottom:5px;margin-left:45px;text-align:center;display:inline-block"><%=(Integer)diskGraph.get("val")%>%</div>
													<div style="position:absolute;top: 50px;right: 45px;"><div><%=(String)diskGraph.get("title")%></div>
											<%
												}else{
											%>
													<div  style="margin-right:10px;margin-left:45px;text-align:center;display:inline-block">
													<svg xmlns="http://www.w3.org/2000/svg">
														<g>
															<rect x="0" y="0" rx="5" ry="5" width="68" height="18" style="fill:#e8ae59;stroke-width:0" ></rect>
															<text x="22" y="14" font-size="12" fill="#ffffff" style="text-align:center"><%=(Integer)diskGraph.get("val")%>%</text>
														</g>
													</svg>
													</div>
													<div style="position:absolute;top: 50px;left: 37px;"><div><%=(String)diskGraph.get("title")%></div>
											<%
												}
											%>
												</div>
											</td>
											<td width="25%" class="graphSeperatorLineRight">
										<%
											Boolean networkHighlight=(Boolean)networkGraph.get("highlightEnable");
											if(networkHighlight.booleanValue()){
										%>
												<div class="chartOuterBox highlight">
												<div style="border:0px solid red;position:absolute;right:0px"><img src="./images/servicewiseHighlight.png"/></div>
										<%
											}else{
										%>
												<div class="chartOuterBox">
										<%
											}

											if(pdfPrint !=null && pdfPrint.equalsIgnoreCase("yes")){
										%>
												<div class="header" style="margin-top:0px;width:125px;margin-left:8px;" ><%=intlmap.getTextDescription("reporter.common.Network")%></div>
										<%
											}else{
										%>	
												<div class="header" style="margin-top:0px;width:135px;margin-left:10px;" ><%=intlmap.getTextDescription("reporter.common.Network")%></div>
										<%
											}
										%>
													<!--<div class="triangleTopRight"></div>-->
											<%
												String urlNetwork ="../../final/servlet/com.eg.ErCitrixCapacityPlanningReportC;jsessionid="+session.getId()+"?forPrint=yes&chartType=donut&chartValue=NetworkUsageGraph&imagereq=yes&er_width=94&er_height=94";
											%>
													<div style="margin-left: 30px;"><img src="<%=urlNetwork%>" /></div>
											<%
												if(pdfPrint !=null && pdfPrint.equalsIgnoreCase("yes")){
											%>
													<div class="rectBox" style="margin-top:10px;margin-right:10px;margin-bottom:5px;margin-left:45px;text-align:center;display:inline-block"><%=(Integer)networkGraph.get("val")%>%</div>
													<div style="position:absolute;top: 50px;right: 45px;"><div><%=(String)networkGraph.get("title")%></div>
											<%
												}else{
											%>
													<div  style="margin-right:10px;margin-left:45px;text-align:center;display:inline-block">
													<svg xmlns="http://www.w3.org/2000/svg">
														<g>
															<rect x="0" y="0" rx="5" ry="5" width="68" height="18" style="fill:#e8ae59;stroke-width:0" ></rect>
															<text x="22" y="14" font-size="12" fill="#ffffff" style="text-align:center"><%=(Integer)networkGraph.get("val")%>%</text>
														</g>
													</svg>
													</div>
													<div style="position:absolute;top: 50px;left: 37px;"><div><%=(String)networkGraph.get("title")%></div>
											<%
												}
											%>
												</div>
											</td>
										</tr>
									</table>
								</div>
							</td>
						</tr>
						<tr>
						<%
							String legStyle="margin-top:3px;";
							if(pdfPrint !=null && pdfPrint.equalsIgnoreCase("yes"))
								legStyle="";
								
						%>
							<td colspan="2">
								<div style="right:20px;bottom:3px;border:0px solid red;display:flex;float:right;">
								
									<div style="float:left;<%=legStyle%>"><svg height="12" width="12">
									<circle cx="4" cy="6" r="4" fill="#e8ae59" stoke-width="0" /></svg></div>
									<div class="ctxSessionsTextBrown11" style="float:left;margin-right:10px;"><%=intlmap.getTextDescription("reporter.common.Current Usage")%></div>
									<div style="float:left;<%=legStyle%>"><svg height="12" width="12">
									<circle cx="4" cy="6" r="4" fill="#78c1dc" stoke-width="0" /></svg></div><div class="ctxSessionsTextBlue11" style="float:left;"><%=intlmap.getTextDescription("reporter.common.At Capacity")%></div>
								</div>
							</td>
						</tr>
					</table>
					<br/>
					<div  class="notes" style="margin:0px 10px 10px 10px;">
						<div class="paperPin"> </div>
						<div class="newFont_normal13"><%=recommandatn%></div></div>
					</div>
					<div class="clearDiv"></div>
	<%
			}
		}
		session.setAttribute("GraphDatas",GraphDatas);
	%>
				</div>
				<div class="clearDiv">&nbsp;</div>
				<div class="printOuterBoxNoPadding">
					<div class="printOuterBoxHeader consumptionperSessionTitleBig" style="border-bottom:0px solid #dedede;text-transform:uppercase;margin-bottom:10px;"><%=intlmap.getTextDescription("reporter.common.Detailed Statistics")%></div>
						<table width="100%" cellpadding="0px" cellspacing="0px" style="padding:0px 10px 10px 10px">
							<tr>
								<td width="50%" style="padding:10px 10px 10px 0px;border-bottom:1px solid #dedede;border-right:1px solid #dedede;">
									<div class="print OuterBox">
								<%
									String urlTmp1 ="../../final/servlet/com.eg.ErCitrixCapacityPlanningReportC;jsessionid="+session.getId()+"?forPrint=yes&chartType=line&chartValue=ActiveSessionGraph&imagereq=yes&er_width=410&er_height=250";
								%>
										<div class="printOuterBoxHeader"><%=intlmap.getTextDescription("reporter.common.Active Session")%></div>
										<div style="height:250px;width:100%;overflow:auto;padding:0px"><img src="<%=urlTmp1%>" /></div>
									</div>
								</td>
								<td width="50%" style="padding:0px 0px 10px 10px !important;border-bottom:1px solid #dedede;">
									<div class="print OuterBox">
								<%
									String urlTmp ="../../final/servlet/com.eg.ErCitrixCapacityPlanningReportC;jsessionid="+session.getId()+"?forPrint=yes&chartType=bar&chartValue=TotalSessionGraph&imagereq=yes&er_width=410&er_height=250";
								%>
										<div  class="printOuterBoxHeader"><%=intlmap.getTextDescription("reporter.common.Total Session")%></div>
										<div style="height:250px;width:100%;overflow:auto;padding:0px"><img src="<%=urlTmp%>" /></div>
									</div>
								</td>
							</tr>
							<tr>
								<td width="50%" style="padding:20px 10px 10px 0px;border-bottom:0px solid #dedede;border-right:1px solid #dedede;">
									<div class="print OuterBox">
								<%
									String urlTmp2 ="../../final/servlet/com.eg.ErCitrixCapacityPlanningReportC;jsessionid="+session.getId()+"?forPrint=yes&chartType=line&chartValue=CpuMemoryGraphGraph&imagereq=yes&er_width=410&er_height=250";
								%>
										<div  class="printOuterBoxHeader"><%=intlmap.getTextDescription("reporter.common.CPU vs Memory Usage of Servers")%></div>
										<div style="height:250px;width:100%;overflow:auto;padding:0px"><img src="<%=urlTmp2%>" /></div>
									</div>
								</td>
								<td width="50%" style="padding:20px 0px 10px 10px !important;border-bottom:0px solid #dedede;">
									<div class="print OuterBox">
									<%
										String urlTmp3 ="../../final/servlet/com.eg.ErCitrixCapacityPlanningReportC;jsessionid="+session.getId()+"?forPrint=yes&chartType=line&chartValue=DiskNetworkGraph&imagereq=yes&er_width=410&er_height=250";
									%>
										<div class="printOuterBoxHeader"><%=intlmap.getTextDescription("reporter.common.Disk vs Network Usage of Servers")%></div>
										<div style="height:250px;width:100%;overflow:auto;padding:0px"><img src="<%=urlTmp3%>" /></div>
									</div>
								</td>
							</tr>
						</table>
					</div>
			<%
				}
				else
				{
					HashMap GraphDatas=new HashMap();
					ArrayList zoneDatas = (ArrayList)resultMap.get("ZoneWiseDatas");
					String UniqueUserCnt = (String)resultMap.get("UniqueUsersCount");
					if(UniqueUserCnt == null)
						UniqueUserCnt="-";
					String zoneCols = reportInfo.getValue("CITRIX_CAPACITY_CPU_PLANNING", "zonewiseColumns");
					CitrixInfoBeanforZone ctrxZne=null;
					SimpleDateFormat ntesdf=new SimpleDateFormat(currentDateFormat);
					SimpleDateFormat dbformat=new SimpleDateFormat("yyyy-MM-dd");
					String dbdateFormat=ctrxbean.getChartlabelFormat(currentDateFormat);
					SimpleDateFormat uiformat=new SimpleDateFormat(dbdateFormat);
					JSONObject AnalysisDataObj=new JSONObject();
					String serversCount="0";
					String strtDate="";
					String endDate="";
					int possibleSessionsbyZone=0;
					int peakValue=0;
					try{
						Date dte=ntesdf.parse(startDte);
						strtDate=ntesdf.format(dte);
						dte=ntesdf.parse(endDte);
						endDate=ntesdf.format(dte);
					}
					catch(Exception ee){}
					String totalCompletedSessions="0";
					String totalserversCount="0";
					double totalserversCountVal=0;
					String analysisNote="";
					if(zoneDatas != null && zoneDatas.size() > 0){
						AnalysisDataObj=ctrxbean.getZoneWiseGraphDatas(zoneDatas,zoneCols,dbformat,uiformat,strtDate,endDate,UniqueUserCnt,intlmap);
						if(AnalysisDataObj != null && AnalysisDataObj.containsKey("peakUsagevsServerCountGraph"))
							GraphDatas.put("peakLoadvsServerCountGraph",(JSONObject)AnalysisDataObj.get("peakUsagevsServerCountGraph"));
						JSONObject resourceConsumptionGraph=new JSONObject();
						if(AnalysisDataObj != null && AnalysisDataObj.containsKey("resourceConsumptionGraph"))
							resourceConsumptionGraph=(JSONObject)AnalysisDataObj.get("resourceConsumptionGraph");
						if(resourceConsumptionGraph != null && resourceConsumptionGraph.size() > 0)
							resourceConsumptionGraph.put("chartType","linePlain");
						GraphDatas.put("resourceConsumptionGraph",resourceConsumptionGraph);
						serversCount=(String)AnalysisDataObj.get("TotalServers");

						if(AnalysisDataObj != null && AnalysisDataObj.containsKey("CompletedSessions"))
							totalCompletedSessions=(String)AnalysisDataObj.get("CompletedSessions");
						if(AnalysisDataObj != null && AnalysisDataObj.containsKey("TotalServers"))
							totalserversCount=(String)AnalysisDataObj.get("TotalServers");
						if(AnalysisDataObj != null && AnalysisDataObj.containsKey("AnalysisText"))
							analysisNote=(String)AnalysisDataObj.get("AnalysisText");
						String possibleSessnCnt=(String)AnalysisDataObj.get("AdditionalPossibleSessionsByZone");
						if(possibleSessnCnt != null )
							possibleSessionsbyZone=(int)Double.parseDouble(possibleSessnCnt);
						possibleSessnCnt=(String)AnalysisDataObj.get("PeakLoadByZone");
						if(possibleSessnCnt != null )
							peakValue=(int)Double.parseDouble(possibleSessnCnt);

					}
					if(totalserversCount != null)
						totalserversCountVal=Double.parseDouble(totalserversCount);
					String servrCols = reportInfo.getValue("CITRIX_CAPACITY_CPU_PLANNING", "componentwiseColumns");
					ArrayList compWisedatas=new ArrayList();
					ArrayList zoneWiseUsagedatas=new ArrayList();
					HashMap zoneWiseUsagedataObj=new HashMap();
					ArrayList tmpArray=null;
					JSONArray analysArr=null;
					CitrixInfoBean ctrxServrBean=null;
					HashMap tmpObjct=null;
					if(serverDatas != null && serverDatas.size() > 0){
						double dataToBeConsidered = 5;
						double dataToBeMaxConsidered = 95;
						try{
							String dataPointsForMinCal = reportInfo.getValue("CITRIX_CAPACITY_CPU_PLANNING", "DataPointsForMinCalinUI");
							if (dataPointsForMinCal != null) 
							{
								dataPointsForMinCal = dataPointsForMinCal.trim();
								if (dataPointsForMinCal.endsWith("%")) {
									dataPointsForMinCal = dataPointsForMinCal.substring(0, dataPointsForMinCal.indexOf("%"));
								}
								try {
									dataToBeConsidered = Integer.parseInt(dataPointsForMinCal);
								} catch (Exception e) {
									System.out.println("Error in data points specification in ini, using default");
								}
							}
							dataToBeConsidered /= 100;
							String dataPointsForMaxCal = reportInfo.getValue("CITRIX_CAPACITY_CPU_PLANNING", "DataPointsForMaxCalinUI");
							if (dataPointsForMaxCal != null) 
							{
								dataPointsForMaxCal = dataPointsForMaxCal.trim();
								if (dataPointsForMaxCal.endsWith("%")) {
									dataPointsForMaxCal = dataPointsForMaxCal.substring(0, dataPointsForMaxCal.indexOf("%"));
								}
								try {
									dataToBeMaxConsidered = Integer.parseInt(dataPointsForMaxCal);
								} catch (Exception e) {
									System.out.println("Error in data points specification in ini, using default");
								}
							}
							dataToBeMaxConsidered /= 100;
						}catch(Exception ee){
							ee.printStackTrace();
						}
						int minCal = 0;
						int maxCal = 0;
						int possiblesessnCnt=0;
						Iterator itr=serverDatas.keySet().iterator();
						ArrayList all=new ArrayList();
						ArrayList ServCapacity=new ArrayList();
						ArrayList StstsList=new ArrayList();
						ArrayList pieval=null;

						ArrayList cpuLimitation=new ArrayList();
						ArrayList memoryLimitaion=new ArrayList();
						ArrayList diskLimitaion=new ArrayList();
						ArrayList networkLimitation=new ArrayList();
						int cpuCnt=0;
						int memoryCnt=0;
						int diskCnt=0;
						int networkCnt=0;
						int overallSessionCnt=0;
						while(itr.hasNext()){
							int totalSessnsCnt=0;
							compWisedatas=new ArrayList();
							pieval=new ArrayList();
							String compName=(String)itr.next();
							tmpArray=(ArrayList)serverDatas.get(compName);
							if(tmpArray != null && tmpArray.size() > 0){
								int sInfoSize=tmpArray.size();
								double maxVl=(sInfoSize)*(dataToBeConsidered);
								String strVal1=erUtils.round(maxVl,0);
								minCal=Integer.parseInt(strVal1);
								if(minCal > 0)
									minCal=minCal-1;
								maxVl=(sInfoSize)*(dataToBeMaxConsidered);
								strVal1=erUtils.round(maxVl,0);
								maxCal=Integer.parseInt(strVal1);
								if(maxCal > 0)
									maxCal=maxCal-1;

								if (minCal <= 0) {
									minCal = 0;
								}
								if (maxCal <= 0) {
									maxCal = 0;
								}
								for(int i=0;i<tmpArray.size();i++){
									tmpObjct=(HashMap)tmpArray.get(i);
									ctrxServrBean=new CitrixInfoBean(tmpObjct,servrCols);
									compWisedatas.add(ctrxServrBean);
									zoneWiseUsagedatas.add(ctrxServrBean);
									String limitBy=ctrxServrBean.getBottleNeckresource();
									String total_sessns=ctrxServrBean.getTotalSessions();
									int tmpVl=(int)Double.parseDouble(total_sessns);
									totalSessnsCnt+=tmpVl;
									overallSessionCnt+=tmpVl;
									if(!pieval.contains(limitBy))
										pieval.add(limitBy);
								}
				//for resourse limitation analysis
								if(pieval.contains("MEMORY") || pieval.contains("Memory") || pieval.contains("2.0000") ){
									memoryCnt+=1;
									if(!memoryLimitaion.contains(compName))
									memoryLimitaion.add(compName);
								}
								else if(pieval.contains("DISK") || pieval.contains("3.0000")){
									diskCnt+=1;
									if(!diskLimitaion.contains(compName))
									diskLimitaion.add(compName);
								}
								else if(pieval.contains("NETWORK") || pieval.contains("4.0000")){
									networkCnt+=1;
									if(!networkLimitation.contains(compName))
									networkLimitation.add(compName);
								}
								else if(pieval.contains("CPU") ||pieval.contains("Cpu") || pieval.contains("1.0000")){
									cpuCnt+=1;
									if(!cpuLimitation.contains(compName))
									cpuLimitation.add(compName);
								}

			//for find 95% of current active sessions
							Collections.sort(compWisedatas,
							new CitrixInfoBean() {
								public int compare(Object obj1, Object obj2) {
									CitrixInfoBean bean1 = (CitrixInfoBean) obj1;
									CitrixInfoBean bean2 = (CitrixInfoBean) obj2;
									if (bean1.getActiveSessions() == bean2.getActiveSessions()) {
										return 0;
									} else if (Double.parseDouble(bean1.getActiveSessions()) >	Double.parseDouble(bean2.getActiveSessions())) {
										return 1;
									} else {
										return -1;
									}
								}
							});
							CitrixInfoBean ctrx_activeSessn=(CitrixInfoBean)compWisedatas.get(maxCal);
							String actveSessions=ctrx_activeSessn.getActiveSessions();

			//for find 5% of additional possible sessions
								Collections.sort(compWisedatas,
								new CitrixInfoBean() {
									public int compare(Object obj1, Object obj2) {
										CitrixInfoBean bean1 = (CitrixInfoBean) obj1;
										CitrixInfoBean bean2 = (CitrixInfoBean) obj2;
										if (bean1.getPossibleSessnsCnt() == bean2.getPossibleSessnsCnt()) {
										return 0;
										} else if (Double.parseDouble(bean1.getPossibleSessnsCnt()) > Double.parseDouble(bean2.getPossibleSessnsCnt())) {
										return 1;
										} else {
										return -1;
										}
									}
								});
								CitrixInfoBean additnlSessn=(CitrixInfoBean)compWisedatas.get(minCal);
								String addtnlSessions=additnlSessn.getPossibleSessnsCnt();
								possiblesessnCnt+=(int)Double.parseDouble(addtnlSessions);
								all.add(new CustomSort(compName+"$"+addtnlSessions,actveSessions));
								
							//ServCapacity
								double xtraSessnVal=0;
								double curntSessnsVal=0;
								if(addtnlSessions != null)
									xtraSessnVal=Double.parseDouble(addtnlSessions);
								if(actveSessions != null)
									curntSessnsVal=Double.parseDouble(actveSessions);
								ServCapacity.add(new CustomSort((compName+"$"+curntSessnsVal+"#"+xtraSessnVal),String.valueOf(xtraSessnVal+curntSessnsVal)));
							//for server Loads Calculation
								StstsList.add(new CustomSort(compName,String.valueOf(totalSessnsCnt)));
							}
							zoneWiseUsagedataObj.put(compName,compWisedatas);
						}
						analysArr=(JSONArray)AnalysisDataObj.get("SingleSessionUsageFromZoneTable");


%>

				<div class="printOuterBoxNoPadding">
					<div class="printOuterBoxHeader consumptionperSessionTitleBig" style="margin-bottom:10px;"><%=intlmap.getTextDescription("reporter.common.Analysis of Session Usage")%></div>
					<div style="margin-left:10px;"><span class="newFont_normal12"><egui:intnl text="reporter.common.Based on average resource consumption per session, how many more concurrent sessions are possible?"/></span></div>
					<div class="highlightContainerBoxFlex containerBordercls" style="margin:10px;vertical-align: middle;">
						<table width="100%" border="0px" valign="middle" height="80px" style="margin:10px 0px 10px 0px;vertical-align: middle;">
							<tr>
								<td width="33%" align="center" class="containerBorderRightcls">
									<table border="0px" align="center">
										<tbody>
											<tr>
												<td align="center" style="padding:5px 0px 0px 0px"><div class="iconLogonUser"></div></td>
												<td style="text-align:left;" class="newFont_bold30"><%=UniqueUserCnt%></td>
											</tr>
											<tr>
												<td colspan="2" style="text-align:center;" class="newFont_normal16"><%=intlmap.getTextDescription("reporter.common.Users")%></td>
											</tr>
										</tbody>
									</table>
								</td>
								<td width="33%" align="center" class="containerBorderRightcls">
									<table border="0px" align="center">
										<tbody>
											<tr>
												<td align="center" style="padding:5px 0px 0px 0px"><div class="iconServerGray"></div></td><td style="text-align:left;" class="newFont_bold30"><%=totalserversCount%></td>
											</tr>
											<tr>
												<td colspan="2" style="text-align:center;" class="newFont_normal16"><%=intlmap.getTextDescription("reporter.common.Servers")%></td>
											</tr>
										</tbody>
									</table>
								</td>
								<td width="33%" align="center">
									<table border="0px" align="center">
										<tbody>
											<tr>
												<td align="center" style="padding:5px 0px 0px 0px"><div class="iconSessionsCompleted"></div></td><td style="text-align:left;" class="newFont_bold30"><%=totalCompletedSessions%></td>
											</tr>
											<tr>
												<td colspan="2" style="text-align:center;" class="newFont_normal16"><%=intlmap.getTextDescription("reporter.common.Sessions Completed")%></td>
											</tr>
										</tbody>
									</table>
								</td>
							</tr>
						</table>
					</div>
					<!--<div class="newFont_normal14"  style="margin:0 20 30 20;padding: 0 10 0 10;"><%=analysisNote%></div>-->
					<div  style="padding: 0 10 0 10;">
						<table width="100%">
							<tr>
								<td class="containerBorderBottomcls">
									<div class="printOuterBoxHeader"><%=intlmap.getTextDescription("reporter.common.Current Sessions vs Servers Used")%></div>
				<%
						String urlTmp ="../../final/servlet/com.eg.ErCitrixCapacityPlanningReportC;jsessionid=" + session.getId()+"?forPrint=yes&chartType=donut&chartValue=peakLoadvsServerCountGraph&imagereq=yes&er_width=900&er_height=300";
				%>
									<div align="center">
										<img src="<%=urlTmp%>" />
									</div>
								</td>
							</tr>
							<tr>
								<td style="padding-bottom:20px">
									<div  style="margin-top:20px" class="printOuterBoxHeader"><%=intlmap.getTextDescription("reporter.common.Resource Consumption Per Session Per Day")%></div>
				<%
						urlTmp ="../../final/servlet/com.eg.ErCitrixCapacityPlanningReportC;jsessionid=" + session.getId()+"?forPrint=yes&chartType=donut&chartValue=resourceConsumptionGraph&imagereq=yes&er_width=900&er_height=300";
				%>
									<div align="center">
										<img src="<%=urlTmp%>" /> 
									</div>
								</td>
							</tr>
						</table>
					</div>
<%
				String consumptionperSessionBoxStyle = "";
				String paddingForTopic = "";
				if(pdfPrint !=null && pdfPrint.equalsIgnoreCase("yes"))
					consumptionperSessionBoxStyle = "consumptionperSessionBox";
				else
					paddingForTopic = "padding:8px 10px";

				JSONObject tmpJson=new JSONObject();
				if(analysArr != null)
				{					
%>
					<div  class="containerBordercls" style="margin:20px 10px 10px 10px;background:#f8f8f8;border-top:0px">
						<div style="line-height:0px;">
						<div class="consumptionperSessionTitleBgLine" style=""></div>
<%
							if(pdfPrint !=null && pdfPrint.equalsIgnoreCase("yes"))
							{
%>
								<div align="center" style="position:relative; top:-16px; ">
<%
							}
							else
							{
%>
								<div align="center" style="position:relative; top:-12px;text-align:center">
<%
							}
%>									<table>
									<tr>
										<td class="consumptionperSessionTitleBig" style="<%=paddingForTopic%>"><%=intlmap.getTextDescription("reporter.common.Resource Consumption Per Session")%><span style="font-size:11px">&nbsp;(<egui:intnl text="reporter.common.95th percentile"/>)</span></td>
									</tr>
									</table>

							</div>
						</div>
						<div class="<%=consumptionperSessionBoxStyle%>" style="padding-bottom:10px" align="center">
							<table width="100%">
								<tr>
									
					<%
						for(int l=0;l<analysArr.size();l++)
						{
							tmpJson=(JSONObject)analysArr.get(l);
					%>
									<td width="25%">
										<div class="childDiv">
											<table align="center" border="0px">
												<tbody>
													<tr>
														<td align="right"><div style="margin-right:5px" class=<%=(String)tmpJson.get("iconclass")%>></div></td>
														<td class="resourceUsability" valign="bottom" align="center"><%=(String)tmpJson.get("value")%><span class="resourceUnit">%</span></td>
													</tr>
													<tr>
														<td colspan="2" style="vertical-align:top;" align="center" class="resourceName"><%=(String)tmpJson.get("name")%></td>
													</tr>
												</tbody>
											</table>
										</div>
									</td>
					<%
							}
					%>
								</tr>
							</table>
						</div>
					</div>
			<%
				}
			%>
				</div>
				<div class="clearDiv" style="height: 10px;"></div>
				<pd4ml:page.break/>


<%


// Distribution panel Data Processing Starts Here
						JSONObject distrubutnObj=new JSONObject();
						JSONObject tmpObj2=null;
						int serverCount =serverDatas.size();
						distrubutnObj=ctrxbean.getDistributionGraphandTableperServers(all,possiblesessnCnt,serverCount,intlmap);

				//for server and capacity Graph
						CustomSort.orderby="desc";
						Collections.sort(ServCapacity);
						tmpObj2=ctrxbean.getServerCapacityGraph(ServCapacity,false,intlmap);
						String chartHeight="300";
						if(tmpObj2 != null && tmpObj2.containsKey("datasetSize")){
							Integer innnt=(Integer)tmpObj2.get("datasetSize");
							if(innnt > 7)
								chartHeight="320";
						}

						if(distrubutnObj!= null && distrubutnObj.containsKey("distributionGraph"))
							GraphDatas.put("distributionGraph",(JSONObject)distrubutnObj.get("distributionGraph"));
						GraphDatas.put("ServrCapacityGraph",tmpObj2);

						String limitVal=reportInfo.getValue("CITRIX_CAPACITY_CPU_PLANNING","ServerandCapacityGrpahLimit");
						String servCapactyTitle="";
						if(limitVal != null){
							double dd=Double.parseDouble(limitVal);
							if(dd > 1)
								servCapactyTitle=intlmap.getTextDescription("reporter.common.Top")+" "+limitVal+" "+intlmap.getTextDescription("reporter.common.Servers Based on Additional Capacity");
							else
								servCapactyTitle=intlmap.getTextDescription("reporter.common.Top")+" "+limitVal+" "+intlmap.getTextDescription("reporter.common.Server Based on Additional Capacity");
						}
						double singlVal=(double)overallSessionCnt/StstsList.size();
						double low_Sessions=(singlVal-(singlVal/2));
						double high_Sessions=(singlVal+(singlVal/2));
						int lowConsumptn=0;
						int normalConsumptn=0;
						int highConsumption=0;
						int crntCapacity=overallSessionCnt+possiblesessnCnt;

						float normalVal=(float)overallSessionCnt/StstsList.size();
						CustomSort.orderby="asc";
						Collections.sort(StstsList);
						for(int i=0;i<StstsList.size();i++)
						{
							CustomSort cs =(CustomSort)StstsList.get(i);
							String col=(String)cs.col1;
							Double val=(Double)cs.col2;
							if(val.intValue() > 0 && val.intValue() <= low_Sessions){
								lowConsumptn+= 1;
							}
							if(val.intValue() > low_Sessions && val.intValue() <= high_Sessions){
								normalConsumptn+= 1;
							}
							if(val.intValue() > high_Sessions ){
								highConsumption+= 1;
							}
						}
						JSONArray tmpArr=null;
						JSONObject obj=null;
//						int peakValue =0;
//						if(resultMap != null && resultMap.containsKey("PeakLoadDatas")){
//							ArrayList PeakLoadDataArr = (ArrayList)resultMap.get("PeakLoadDatas");
//							Collections.sort(PeakLoadDataArr);
//							double maxVl=(PeakLoadDataArr.size())*(dataToBeMaxConsidered);
//							String strVal1=erUtils.round(maxVl,0);
//							int peakVal=Integer.parseInt(strVal1);
//							if(peakVal  > 0)
//								peakVal=peakVal-1;
//							Double tmpVl=(Double)PeakLoadDataArr.get(peakVal);
//							peakValue = Integer.valueOf(tmpVl.intValue());
//						}
//						crntCapacity=possiblesessnCnt+peakValue;
						crntCapacity=possibleSessionsbyZone+peakValue;
						double usrSessnRatio=0;
						double totalCapcity=0;
						if(UniqueUserCnt != null && !UniqueUserCnt.equalsIgnoreCase("-")){
							try{
								Double unqUsr=Double.parseDouble(UniqueUserCnt);
								if(unqUsr > 0 && peakValue > 0){
									usrSessnRatio=unqUsr/peakValue;
									totalCapcity=usrSessnRatio*crntCapacity;
								}
							}
							catch(Exception ee){}
						}
						
						
						String distSummaryVal="During the period of "+strtDate+" - "+endDate+", peak load was at "+peakValue+" concurrent user sessions. Based on the resource consumption of the user sessions and the available resources on the "+serversCount+" servers, "+possibleSessionsbyZone+" additional sessions can be accommodated, which bring the total capacity to "+crntCapacity+" concurrent user sessions. Based on the User-to-Session ratio observered, "+crntCapacity+" concurrent user sessions roughly equates to "+erUtils.round(totalCapcity,0)+" unique users.";

%>
				<div class="printOuterBoxNoPadding">
					<div class="printOuterBoxHeader consumptionperSessionTitleBig" style="margin-bottom:10px;"><%=intlmap.getTextDescription("reporter.common.Predicting Additional Sessions")%></div>
			<%
					if(distrubutnObj != null ){
						JSONArray servrSessnTable=(JSONArray)distrubutnObj.get("distributionTable");
			%>
					
					<table width="100%"  style="padding: 0 10 0 10;" >
						<tr>
							<td colspan="2"><span class="newFont_normal12"><egui:intnl text="reporter.common.How many more sessions can be additionally supported? How are sessions load-balanced across servers?"/></span></td>
						</tr>
						<tr>
			<%
						if(servrSessnTable != null && servrSessnTable.size() > 0){
						
							int heightVal = 260;
							if(pdfPrint !=null && pdfPrint.equalsIgnoreCase("yes"))
							{
								heightVal = 226;
							}
							if(highConsumption>0)
							{
								heightVal+=18;
							}
							if(lowConsumptn>0)
							{
								heightVal+=18;
							}
			%>
							<td rowspan="2" width="45%" valign="top">
								<div class="newTable" style="height:<%=heightVal%>px">
									<table width="100%" height="<%=heightVal%>px">
										<thead>
											<tr>
												<th align="center"><%=intlmap.getTextDescription("reporter.common.ACTUAL WORKLOAD (CONCURRENT SESSIONS)")%></th>
												<th align="center"><%=intlmap.getTextDescription("reporter.common.NUMBER OF SERVERS")%></th>
												<th align="center"><%=intlmap.getTextDescription("reporter.common.ADDITIONAL SESSIONS POSSIBLE")%></th>
											</tr>
										</thead>
										<tbody>
				<%
								for(int k=0;k<servrSessnTable.size();k++){
									tmpJson=(JSONObject)servrSessnTable.get(k);
									String strbgColor="";
									if(k>0 && (k+1)%2 ==0)
										strbgColor="background-color:#f9f9f9";
									else
										strbgColor="background-color:#ffffff";
				%>
											<tr style="<%=strbgColor%>">
												<td align="center"><%=(String)tmpJson.get(("SessionCount"))%></td>
												<td align="center"><%=(Integer)tmpJson.get(("ServerCount"))%></td>
												<td align="center"><%=(Integer)tmpJson.get(("PossibleSessionCount"))%></td>
											</tr>
				<%
								}
				%>
										</tbody>
									</table>
								</div>
							</td>
			<%
						}
						urlTmp ="../../final/servlet/com.eg.ErCitrixCapacityPlanningReportC;jsessionid=" + session.getId()+"?forPrint=yes&chartType=donut&chartValue=distributionGraph&imagereq=yes&er_width=450&er_height=170";
				%>
							<td width="55%" valign="top">
								<div style="padding:5px;" align="center">
									<img src="<%=urlTmp%>" /> 
								</div>
							</td>
						</tr>
						<tr>
							<td>
								<div  class="notes" style="margin:0px 10px 10px 10px;">
									<div class="<%=paperPinCls%>"></div>
									<table class="newFont_normal12" width="100%">
										<tr>
											<td style="width:10px;border:0px;padding:0px" valign="top" align="left"><div class="iconArrowBullet" style="vertical-align:middle"/></td>
											<td style="padding-left:2px;vertical-align:top;"><%=totalCompletedSessions%>&nbsp;<egui:intnl text="reporter.common.sessions are distributed across"/>&nbsp;<%=totalserversCount%>&nbsp;<egui:intnl text="reporter.common.servers"/></td>
										</tr>
<%
							if(highConsumption>0)
							{
%>
										<tr>
											<td style="width:10px;border:0px;padding:0px" valign="top" align="left"><div class="iconArrowBullet" style="vertical-align:middle"/></td>
											<td style="padding-left:2px;vertical-align:top;"><%=highConsumption%>&nbsp;<egui:intnl text="reporter.common.are supporting more than average workload and are not load-balanced"/></td>
										</tr>
<%
							}
							if(lowConsumptn>0)
							{
%>
										<tr>
											<td style="width:10px;border:0px;padding:0px" valign="top" align="left"><div class="iconArrowBullet" style="vertical-align:middle"/></td>
											<td style="padding-left:2px;vertical-align:top;"><%=lowConsumptn%>&nbsp;<egui:intnl text="reporter.common.are supporting less than average workload and are not load-balanced"/></td>
										</tr>
<%
							}
%>
									</table>
								</div>
							</td>
						</tr>
					</table>
					<div  style="padding: 0 10 0 10;">
						<table width="100%">
							<tr>
								<td>
									<div class="printOuterBoxHeader"><%=servCapactyTitle%></div>
					<%
							urlTmp ="../../final/servlet/com.eg.ErCitrixCapacityPlanningReportC;jsessionid=" + session.getId()+"?forPrint=yes&chartType=donut&chartValue=ServrCapacityGraph&imagereq=yes&er_width=900&er_height="+chartHeight;

					%>
									<div class="newFont_normal12" style="margin:0px 0px 0px 0px">
										<egui:intnl text="reporter.common.Which servers can accommodate more user sessions?"/>
									</div>
									<div>
										<img src="<%=urlTmp%>" /> 
									</div>
								</td>
							</tr>
							<tr>
								<td style="padding-top: 10px;">
									<table width="100%">
										<tr>
											<td width="50%">
												<div style="margin:20 10 0 0;background:#f8f8f8;border-top:0px" class="containerBordercls">
													<div style="line-height:0px;">
													<div class="consumptionperSessionTitleBgLine" style=""></div>
<%
														if(pdfPrint !=null && pdfPrint.equalsIgnoreCase("yes"))
														{
%>
															<div align="center" style="position:relative; top:-16px; ">
<%
														}
														else
														{
%>
															<div align="center" style="position:relative; top:-12px;text-align:center">
<%
														}
%>									
															<table>
																<tr>
																	<td class="consumptionperSessionTitleBig" style="<%=paddingForTopic%>"><%=intlmap.getTextDescription("reporter.common.Session Usage vs Prediction")%></td>
																</tr>
															</table>
													</div>
													<div class="<%=consumptionperSessionBoxStyle%>">
														<table width="100%">
															<tr>
																<td width="50%">
																	<div class="childDiv">
																		<table align="center" border="0px">
																			<tbody>
																				<tr>
																					<td align="right"><div style="margin-right:5px" class="iconSessionsCompleted"></div></td>
																					<td class="resourceUsability" valign="bottom" align="center"><%=peakValue%><span class="resourceUnitText">&nbsp;</span></td>
																				</tr>
																				<tr>
																					<td colspan="2" style="vertical-align:top;" align="center" class="resourceName"><%=intlmap.getTextDescription("reporter.common.Concurrent Sessions")%></td>
																				</tr>
																			</tbody>
																		</table>
																	</div>
																</td>
																<td width="50%">
																	<div class="childDiv">
																		<table align="center" border="0px">
																			<tbody>
																				<tr>
																					<td align="right"><div style="margin-right:5px" class="iconSessionsCompleted"></div></td>
																					<td class="resourceUsability" valign="bottom" align="center"><%=possibleSessionsbyZone%><span class="resourceUnitText">&nbsp;</span></td>
																				</tr>
																				<tr>
																					<td colspan="2" style="vertical-align:top;" align="center" class="resourceName"><%=intlmap.getTextDescription("reporter.common.Additional Sessions Possible")%></td>
																				</tr>
																			</tbody>
																		</table>
																	</div>
																</td>
															</tr>
														</table>
													</div>
												</div>
											</td>
											<td width="50%">
												<div style="margin:20 0 0 0;background:#f8f8f8;border-top:0px" class="containerBordercls">
													<div style="line-height:0px;">
													<div class="consumptionperSessionTitleBgLine" style=""></div>
<%
														if(pdfPrint !=null && pdfPrint.equalsIgnoreCase("yes"))
														{
%>
															<div align="center" style="position:relative; top:-16px; ">
<%
														}
														else
														{
%>
															<div align="center" style="position:relative; top:-12px;text-align:center">
<%
														}
%>									
																<table>
																	<tr>
																	<td class="consumptionperSessionTitleBig" style="<%=paddingForTopic%>"><%=intlmap.getTextDescription("reporter.common.Total Workload Possible Based on Capacity")%></td>
																	</tr>
																</table>
															</div>
													</div>
													<div class="<%=consumptionperSessionBoxStyle%>">
														<table width="100%">
															<tr>
																<td width="50%">
																	<div class="childDiv">
																		<table align="center" border="0px">
																			<tbody>
																				<tr>
																					<td align="right"><div style="margin-right:5px" class="iconSessionsCompleted"></div></td>
																					<td class="resourceUsability" valign="bottom" align="center"><%=crntCapacity%><span class="resourceUnitText">&nbsp;</span></td>
																				</tr>
																				<tr>
																					<td colspan="2" style="vertical-align:top;" align="center" class="resourceName"><%=intlmap.getTextDescription("reporter.common.Concurrent Sessions")%></td>
																				</tr>
																			</tbody>
																		</table>
																	</div>
																</td>
																<td width="50%">
																	<div class="childDiv">
																		<table align="center" border="0px">
																			<tbody>
																				<tr>
																					<td align="right"><div style="margin-right:5px" class="iconLogonUser"></div></td>
																					<td class="resourceUsability" valign="bottom" align="center"><%=erUtils.round(totalCapcity,0)%><span class="resourceUnitText">&nbsp;</span></td>
																				</tr>
																				<tr>
																					<td colspan="2" style="vertical-align:top;" align="center" class="resourceName"><%=intlmap.getTextDescription("reporter.common.Unique Users")%></td>
																				</tr>
																			</tbody>
																		</table>
																	</div>
																</td>
															</tr>
														</table>
													</div>
												</div>
											</td>
										</tr>
									</table>
								</td>
							</tr>
						</table>
					</div>
					<!--<div class="newFont_normal14"  style="margin:0 20 0 20;padding: 0 10 10 10;"><%=distSummaryVal%></div>-->
					<div class="newFont_normal12"  style="margin:0 20 0 20;padding: 0 10 10 10;text-align:right;">*<egui:intnl text="reporter.common.Computed based on current user-to-session ratio"/></div>
				</div>
				<div class="clearDiv" style="height: 10px;"></div>
			<%
				}


// Optimization panel Data Processing Starts Here
						JSONObject optimizatnObj=new JSONObject();
						JSONObject tmpObj=new JSONObject();
						int serverCnt=StstsList.size();
						obj=ctrxbean.getServerDetails(serverDatas,tmpObj,coulmnList,intlmap);
						optimizatnObj.put("ServerDetails",obj);
						JSONObject resourcelimitationMap=new JSONObject();
						if(obj != null && obj.containsKey("ResourcelimitatnMap"))
							resourcelimitationMap=(JSONObject)obj.get("ResourcelimitatnMap");

						JSONArray cpuLimitatnArr=new JSONArray();
						JSONArray memLimitatnArr=new JSONArray();
						JSONArray diskLimitatnArr=new JSONArray();
						JSONArray netwrkLimitatnArr=new JSONArray();
						if(resourcelimitationMap != null && resourcelimitationMap.size() > 0){
							Iterator resrceitr=resourcelimitationMap.keySet().iterator();
							while(resrceitr.hasNext()){
								String str=(String)resrceitr.next();
								String limtatnVal=(String)resourcelimitationMap.get(str);
								if(limtatnVal != null && limtatnVal.indexOf("CPU") >-1){
									if(cpuLimitatnArr != null && !cpuLimitatnArr.contains(str))
										cpuLimitatnArr.add(str);
								}
								else if(limtatnVal != null && limtatnVal.indexOf("Memory") >-1){
									if(memLimitatnArr != null && !memLimitatnArr.contains(str))
										memLimitatnArr.add(str);
								}
								else if(limtatnVal != null && limtatnVal.indexOf("Disk") >-1){
									if(diskLimitatnArr != null && !diskLimitatnArr.contains(str))
										diskLimitatnArr.add(str);
								}
								else if(limtatnVal != null && limtatnVal.indexOf("Network") >-1){
									if(netwrkLimitatnArr != null && !netwrkLimitatnArr.contains(str))
										netwrkLimitatnArr.add(str);
								}
							}
						}
						cpuCnt=cpuLimitatnArr.size();
						memoryCnt=memLimitatnArr.size();
						diskCnt=diskLimitatnArr.size();
						networkCnt=netwrkLimitatnArr.size();
						int maxLimitationVal = networkCnt;
						if(maxLimitationVal<cpuCnt)
						{
							maxLimitationVal = cpuCnt;
						}
						if(maxLimitationVal<memoryCnt)
						{
							maxLimitationVal = memoryCnt;
						}
						if(maxLimitationVal<diskCnt)
						{
							maxLimitationVal = diskCnt;
						}
						cpuLimitation=new ArrayList(cpuLimitatnArr);
						memoryLimitaion=new ArrayList(memLimitatnArr);
						diskLimitaion=new ArrayList(diskLimitatnArr);
						networkLimitation=new ArrayList(netwrkLimitatnArr);
						
						ctrxbean.getOptimizationRecommendation(tmpObj,optimizatnObj,serverCnt,crntCapacity,usrSessnRatio,intlmap);
		//for Optimizing Capacity Datas
						JSONArray datasetArr=new JSONArray();
						JSONArray resourseTableArr=new JSONArray();
						if(memoryCnt > 0){
							obj=new JSONObject();
							obj.put("name","Memory");
							obj.put("y",new Double(memoryCnt));
							obj.put("color","#FF7C78");
							datasetArr.add(obj);
						}
						if(diskCnt > 0){
							obj=new JSONObject();
							obj.put("name","Disk");
							obj.put("y",new Double(diskCnt));
							obj.put("color","#FFCD50");
							datasetArr.add(obj);
						}
						if(networkCnt > 0){
							obj=new JSONObject();
							obj.put("name","Network");
							obj.put("y",new Double(networkCnt));
							obj.put("color","#99D3C5");
							datasetArr.add(obj);
						}
						if(cpuCnt > 0){
							obj=new JSONObject();
							obj.put("name","CPU");
							obj.put("y",new Double(cpuCnt));
							obj.put("color","#778AAA");
							datasetArr.add(obj);
						}
						JSONObject resourceLimitationGraph=new JSONObject();
						if(datasetArr != null && datasetArr.size() > 0){
							JSONArray breakdwnArr=new JSONArray();
							obj=new JSONObject();
							obj.put("data",datasetArr);
							breakdwnArr.add(obj);
							resourceLimitationGraph.put("DataSet",breakdwnArr);
						}
						resourceLimitationGraph.put("chartType","donut");
						resourceLimitationGraph.put("pieSize","150%");
						resourceLimitationGraph.put("innerSize","60%");
						resourceLimitationGraph.put("chartHeight","130");
						resourceLimitationGraph.put("chartWidth","130");
						resourceLimitationGraph.put("isShadowEnable",new Boolean(false));
						resourceLimitationGraph.put("enableTooltpPercent","true");
						optimizatnObj.put("limitingFactorGraph",resourceLimitationGraph);
						GraphDatas.put("resourceLimitationGraph",resourceLimitationGraph);


						if(cpuCnt > 0){
							obj=new JSONObject();
							obj.put("value",cpuCnt+"");
							obj.put("name","CPU");
							obj.put("ServerMaxCount",maxLimitationVal+"");
							resourseTableArr.add(obj);
						}
						if(memoryCnt > 0){
							obj=new JSONObject();
							obj.put("value",memoryCnt+"");
							obj.put("name","Memory");
							obj.put("ServerMaxCount",maxLimitationVal+"");
							resourseTableArr.add(obj);
						}
						if(diskCnt > 0){
							obj=new JSONObject();
							obj.put("value",diskCnt+"");
							obj.put("name","Disk");
							obj.put("ServerMaxCount",maxLimitationVal+"");
							resourseTableArr.add(obj);
						}
						if(networkCnt > 0){
							obj=new JSONObject();
							obj.put("value",networkCnt+"");
							obj.put("name","Network");
							obj.put("ServerMaxCount",maxLimitationVal+"");
							resourseTableArr.add(obj);
						}
						double totalServrCount=totalserversCountVal-(cpuCnt+memoryCnt+diskCnt+networkCnt);


						session.setAttribute("GraphDatas",GraphDatas);
						String divwidth="100%";
						String divwidth2="100%";
						if(tmpJson != null && tmpJson.size() > 0 && isSummaryView != null && isSummaryView.equalsIgnoreCase("no")){
							if(!(pdfPrint !=null && pdfPrint.equalsIgnoreCase("yes")))
							{
								divwidth="1240px";
								divwidth2="1260px";
							}
			%>
							<pd4ml:page.break htmlWidth="1270"/>
			<%
						}else{
			%>
							<pd4ml:page.break/>
			<%
						}
%>
					<div class="printOuterBoxNoPadding" >
						<div class="printOuterBoxHeader consumptionperSessionTitleBig"style="margin-bottom:10px;width:<%=divwidth2%>"><%=intlmap.getTextDescription("reporter.common.Analysis of Server Resource Bottlenecks")%></div>
<%
			
					if(resourseTableArr != null && resourseTableArr.size() > 0)
					{
%>
						<div  style="padding: 0 10 0 10;width:<%=divwidth%>">
							<table width="100%">
								<tr>
									<td colspan="2" align="left"><span class="newFont_normal12"><egui:intnl text="reporter.common.How is server capacity bottlenecked by resource usage?"/></span></td>
								</tr>
								<tr>
								<!-- left side Table Starts Here -->
<%
						String percntVal="";
						String resourceCharUrl ="../../final/servlet/com.eg.ErCitrixCapacityPlanningReportC;jsessionid=" + session.getId()+"?forPrint=yes&chartType=donut&chartValue=resourceLimitationGraph&imagereq=yes&er_width=130&er_height=130";
%>
									<td  width="50%">
									<div style="font-size:12px" class="printOuterBoxHeader" align="center"><%=intlmap.getTextDescription("reporter.common.Number of Servers Limited By Resource Bottlenecks")%></div>
										
										<table width="100%" border="0px" height="100%" style="border-right:1px solid #cdcdcd;padding:0px 5px 0px 0px;">
										   <tbody>
											  <tr>
												 <td width="33%" align="center" class="newLineBottom" valign="middle" style="padding-right:10px">
													<table border="0px">
													   <tbody>
														  <tr style="background:#ececec;">
															 <td  align="center" valign="middle">
																<table border="0px" cellpadding="2px" cellspacing="0px" class="highlightImageBoxWithoutCurve">
																	<tr>
																		<td>									 
																			<div class="iconCpu32"></div>
																		</td>
																		<td class="newFont_normal30">
																			<%=cpuCnt%>
																		</td>
																	</tr>
																</table>
															</td>
														  </tr>
														  <tr>
															 <td align="middle" class="newFont_normal13" style="padding-top:5px"><span style="background:#778AAA; color:#fff; padding:2px 4px; position:relative; top:-7px;">&nbsp;<%=intlmap.getTextDescription("reporter.common.CPU")%>&nbsp;</span></td>
														  </tr>
													   </tbody>
													</table>
												 </td>
												 <td rowspan="2" width="34%" align="center">
													<div class="gunPoint">
														<img src="<%=resourceCharUrl%>" /> 
													</div>
												 </td>
												 <td align="center" valign="middle" class="newLineBottom" width="33%" style="padding-left:0px">
													<table border="0px">
													   <tbody>
														  <tr style="background:#ececec;">
															 <td  align="center" valign="middle">
																<table border="0px" cellpadding="2px" cellspacing="0px" class="highlightImageBoxWithoutCurve">
																	<tr>
																		<td>									 
																			<div class="iconMemory32"></div>
																		</td>
																		<td class="newFont_normal30">
																			<%=memoryCnt%>
																		</td>
																	</tr>
																</table>
															 </td>
														  </tr>
														  <tr>
															 <td align="middle" class="newFont_normal13" style="padding-top:5px"><span style="background:#FF7C78; color:#fff; padding:2px 4px; position:relative; top:-7px;">&nbsp;<%=intlmap.getTextDescription("reporter.common.Memory")%>&nbsp;</span></td>
														  </tr>
													   </tbody>
													</table>
												 </td>
											  </tr>
											  <tr>
												 <td align="center" valign="middle" width="33%" style="padding-Right:10px;padding-top:15px">
													<table border="0px">
													   <tbody style="background:#ececec;">
														  <tr>
															 <td  align="center" valign="middle">
																<table border="0px" cellpadding="2px" cellspacing="0px" class="highlightImageBoxWithoutCurve">
																	<tr>
																		<td>									 
																			<div class="iconDisk32"></div>
																		</td>
																		<td class="newFont_normal30">
																			<%=diskCnt%>
																		</td>
																	</tr>
																</table>
															</td>
														  </tr>
														  <tr>
															 <td align="middle" class="newFont_normal13" style="padding-top:5px"><span style="background:#FFCD50; color:#fff; padding:2px 4px; position:relative; top:-7px;">&nbsp;<%=intlmap.getTextDescription("reporter.common.Disk")%></span></td>
														  </tr>
													   </tbody>
													</table>
												 </td>
												 <td align="center" valign="middle" width="33%" style="padding-left:10px;padding-top:15px">
													<table border="0px">
													   <tbody style="background:#ececec;">
														  <tr>
															 <td  align="center" valign="middle">
																<table border="0px" cellpadding="2px" cellspacing="0px" class="highlightImageBoxWithoutCurve">
																	<tr>
																		<td>									 
																			<div class="iconNetwork32"></div>
																		</td>
																		<td class="newFont_normal30">
																			<%=networkCnt%>
																		</td>
																	</tr>
																</table>
															</td>
														  </tr>
														  <tr>
															 <td align="middle" class="newFont_normal13" style="padding-top:5px"><span style="background:#99D3C5; color:#fff; padding:2px 4px; position:relative; top:-7px;">&nbsp;<%=intlmap.getTextDescription("reporter.common.Network")%>&nbsp;</span></td>
														  </tr>
													   </tbody>
													</table>
												 </td>
											  </tr>
										   </tbody>
										</table>

									</td>
								<!-- left side Table Ends Here -->
								<!-- right side Table Starts Here -->
									<td  width="50%" valign="middle">
										<div class="newTable" style="column-count:1;height:100%;display:flex;flex-direction:column; justify-content center;margin-top:8px;">
											<table class="" border="0px" style="border-left:0px;border-right:0px;margin-left:3px;" >
												<tbody>
				<%
							boolean haveBottleneck = false;
							for(int x=0;x<resourseTableArr.size();x++)
							{
								JSONObject tmpObj3=(JSONObject)resourseTableArr.get(x);
								System.out.println("tmpObj3  "+tmpObj3);
								String s_count = (String)tmpObj3.get("value");
								String ServerMaxCount = (String)tmpObj3.get("ServerMaxCount");
								if(s_count!=null && ServerMaxCount!=null && ServerMaxCount.equals(s_count) && !haveBottleneck)
								{
									haveBottleneck = true;
				%>
										 <tr>
											<td style="padding:10px;" >
											   <div class="resoureUsageTableDiv">
												  <table border="0px" height="30px" style="border:0px">
													 <tbody>
														<tr style="background:transparent">
														   <td valign="bottom" style="padding:0px;line-height:100%;border:0px">
															  <div class="iconServerGray"></div>
														   </td>
														   <td valign="bottom" style="text-align:right;border:0px">
															  <div class="newFont_normal30" style="line-height:80%"><%=(String)tmpObj3.get("value")%></div>
														   </td>
														   <td style="text-align:left;padding:0px;line-height:100%;border:0px">
															  <div class="newFont_normal13"><%=intlmap.getTextDescription("reporter.common.Servers had")%>&nbsp;<%=(String)tmpObj3.get("name")%>&nbsp;<%=intlmap.getTextDescription("reporter.common.bottleneck")%></div>
														   </td>
														</tr>
													 </tbody>
												  </table>
											   </div>
											</td>
										 </tr>
				<%
								}
						}
						if(totalServrCount > 0)
						{
			%>
							 <tr style="background-color:#ffffff">
								<td style="padding:10px;" >
								   <div class="resoureUsageTableDiv">
									  <table border="0px" height="30px" style="border:0px">
										 <tbody>
											<tr style="background:transparent">
											   <td valign="bottom" style="padding:0px;line-height:100%;border:0px">
												  <div class="iconServerGray"></div>
											   </td>
											   <td valign="bottom" style="text-align:right;border:0px">
												  <div class="newFont_normal30" style="line-height:80%"><%=erUtils.round(totalServrCount,0)%></div>
											   </td>
											   <td style="text-align:left;padding:0px;line-height:100%;border:0px">
												  <div class="newFont_normal13"><%=intlmap.getTextDescription("reporter.common.Servers were not used during the selected time period")%> </div>
											   </td>
											</tr>
										 </tbody>
									  </table>
								   </div>
								</td>
							 </tr>
				<%

						}
				%>
									  </tbody>
								   </table>
								</div>
							</td>
				<!-- right side Table Ends Here -->
						</tr>
					</table>
				</div>
		<%
					}
					tmpJson=new JSONObject();
					if(optimizatnObj != null && optimizatnObj.containsKey("ServerDetails"))
						tmpJson=(JSONObject)optimizatnObj.get("ServerDetails");

					if(tmpJson != null && tmpJson.size() > 0 && isSummaryView != null && isSummaryView.equalsIgnoreCase("no"))
					{
						JSONArray cols=(JSONArray)tmpJson.get("columns");
						JSONArray dataArr=(JSONArray)tmpJson.get("dataArray");
%>
						<div class="clearDiv">&nbsp;</div>
						<div class="plainTableRowHighlight newTable"  style="padding: 0 10 0 10;">
							<div class="printOuterBoxHeader"><%=intlmap.getTextDescription("reporter.common.Servers Limited By Resource Bottlenecks")%></div>
							<table width="100%">
								<thead>
									<tr>
										<th rowspan="2"><%=intlmap.getTextDescription("reporter.common.Server Name")%></th>
										<th rowspan="2"><%=intlmap.getTextDescription("reporter.common.Current Sessions")%></th>
										<th rowspan="2"><%=intlmap.getTextDescription("reporter.common.Additional Sessions Possible")%></th>
										<th rowspan="2"><%=intlmap.getTextDescription("reporter.common.Projected Sessions")%></th>
										<th style="text-align:center;" colspan="3"><%=intlmap.getTextDescription("reporter.common.CPU Usage")%> (%)</th>
										<th style="text-align:center;" colspan="3"><%=intlmap.getTextDescription("reporter.common.Memory Usage")%> (%) </th>
										<th style="text-align:center;" colspan="3"><%=intlmap.getTextDescription("reporter.common.Disk Usage")%> (%) </th>
										<th style="text-align:center;" colspan="3"><%=intlmap.getTextDescription("reporter.common.Network Usage")%> (%) </th>
									</tr>
									<tr>
					<%
									for(int k=0;k<4;k++){
					%>
										<th align="center" ><%=intlmap.getTextDescription("reporter.common.per session")%></th>
										<th align="center" ><%=intlmap.getTextDescription("reporter.common.Current")%></th>
										<th align="center" ><%=intlmap.getTextDescription("reporter.common.Projected")%></th>
					<%
									}
					%>
										
									</tr>
								</thead>
								<tbody>
					<%
							if(dataArr != null && dataArr.size() > 0){
								for(int l=0;l<dataArr.size();l++){
									JSONObject tmpObjj=(JSONObject)dataArr.get(l);
									if(tmpObjj != null && cols != null){
								%>
									<tr style="background-color:#ffffff">
								<%
										for(int k=0;k<cols.size();k++){
											String tmp2=(String)cols.get(k);
											Object valTmp=(Object)tmpObjj.get(tmp2);
											if(valTmp instanceof String){
												String tdVal=(String)tmpObjj.get(tmp2);
												if(tdVal != null && tdVal.indexOf("$") > -1){
													tdVal=tdVal.substring(0,tdVal.indexOf("$"));
								%>
													<td style="border-bottom:0px;">
														<table border="0" cellspacing="0" cellpadding="4px" align="center" style="border:0px">
															<tr>
																<td style="border:0px;padding:0px;width:46px;text-align:right"><%=tdVal%></td>
																<td style="width:20px;border:0px;padding:0px;text-align:right" valign="top" align="left"><div class="iconArrowOrange" style="border:0px solid red;vertical-align:middle" border="0px"></div></td>
															</tr>
														</table>
													</td>
								<%
												}else{
								%>
													<td style="border-bottom:0px;"><%=tdVal%></td>
								<%
												}
											}
											else if(valTmp instanceof Integer){
								%>
												<td style="border-bottom:0px;"><%=(Integer)tmpObjj.get(tmp2)%></td>
								<%
											}
										}
								%>		
									</tr>
									<tr style="background-color:#ffffff">
										<td colspan="<%=tmpObjj.size()%>">
											<div style="margin:5px 5px 5px 20px">
											<table style="border:0px;padding:0px">
												<tr style="background-color: transparent;">
													<td style="width:10px;border:0px;padding:0px" valign="top" align="left"><img src="/final/images/spacer.gif" class="iconArrowBullet"></td>
													<td style="border:0px;padding:0px"><%=(String)tmpObjj.get("Suggestion")%></td>
												</tr>
												<tr>
													<td style="width:10px;border:0px;padding:0px" valign="top" align="left"><img src="/final/images/spacer.gif" class="iconArrowBullet"></td>
													<td style="border:0px;padding:0px"><%=(String)tmpObjj.get("Recommendation")%></td>
												</tr>
											</table>
											</div>
										</td>
									</tr>
								<%
									}
								}
							}
					%>
								</tbody>
							</table>
						</div>
						 <!-- <pd4ml:page htmlWidth="reset"> -->
				<%
					}
					else
					{
						JSONArray cols=(JSONArray)tmpJson.get("Summary_columns");
						JSONArray dataArr=(JSONArray)tmpJson.get("Summary_dataArray");
						if(cols != null && cols.size() > 0 && dataArr != null && dataArr.size() > 0){
			%>
						
						<div class="clearDiv">&nbsp;</div>
						<div class="newTable"  style="padding: 0 10 0 10;">
							<div class="printOuterBoxHeader"><%=intlmap.getTextDescription("reporter.common.Servers Limited By Resource Bottlenecks")%></div>
							<table width="100%">
								<thead>
									<tr>
			<%
							String tdAlgn="";
							for(int l=0;l<cols.size();l++){
								tdAlgn="center";
								if( l == 0 || l == cols.size()-1)
									tdAlgn="left";

								
			%>
										<th align="<%=tdAlgn%>"><%=(String)cols.get(l)%></th>
			<%
							}
			%>
									</tr>
								</thead>
								<tbody>
			<%
							for(int l=0;l<dataArr.size();l++){
								JSONObject tmpObjj=(JSONObject)dataArr.get(l);
								if(tmpObjj != null && tmpObjj.size() > 0){
									String strbgColor="";
									if(l>0 && (l+1)%2 ==0)
										strbgColor="background-color:#f9f9f9";
									else
										strbgColor="background-color:#ffffff";
			%>
										<tr style="<%=strbgColor%>">
			<%
									for(int k=0;k<cols.size();k++){
										String tmpStr=(String)cols.get(k);
										Object valTmp=(Object)tmpObjj.get(tmpStr);
										if(valTmp instanceof String){
			%>
											<td><%=(String)tmpObjj.get(tmpStr)%></td>
			<%
										}else if(valTmp instanceof Integer){
			%>
											<td align="center"><%=(Integer)tmpObjj.get(tmpStr)%></td>
			<%
										}
									}
			%>
										</tr>
			<%
								}
							}
			%>
								</tbody>
							</table>
						</div>
			<%
						}
					}
%>

					<div class="clearDiv" style="height:30px">&nbsp;</div>
						<div style="padding: 0 10 0 10;width:<%=divwidth%>">
						<div style="position:relative;padding:0px 0px 10px 0px" class="printOuterBox">
							<div  style="height:20px;position:relative;top:-14px;left:10px;text-align:left;">
								<table><tr><td class="newFont_bold13" style="background-color:#fff;padding:4px;"><%=intlmap.getTextDescription("reporter.common.Recommendations for")%> &nbsp;<%=er_site%>&nbsp;<%=intlmap.getTextDescription("reporter.common.zone")%></td></tr></table>
							</div>
							<table class="newFont_normal13" border="0px" style="padding-left:10px">
			<%
			//RecommendationNotes
							JSONObject recmndtnObj=null;
							if(optimizatnObj != null && optimizatnObj.containsKey("RecommendationNotes"))
								recmndtnObj=(JSONObject)optimizatnObj.get("RecommendationNotes");
							if(recmndtnObj != null){
								Iterator graphitr=recmndtnObj.keySet().iterator();
%>
								<tr>
									<td colspan="2"><span class="newFont_normal12"><egui:intnl text="reporter.common.How many sessions can be supported by the servers when resource capacity is increased?"/></span></td>
								</tr>
<%
								while(graphitr.hasNext()){
									String tmpname = (String) graphitr.next();
									JSONArray tmpRecmndtnArr=(JSONArray)recmndtnObj.get(tmpname);
									if(tmpname != null && tmpname.equalsIgnoreCase("Disk")){
										tmpname="Disk Capacity";
									}
									else if(tmpname != null && tmpname.equalsIgnoreCase("Cpu")){
										tmpname="CPU";
									}
			%>
								<tr>
									<td colspan="2" align="left" style="padding-top:5px;padding-bottom: 6px;padding-left:5px;font-weight:500"><egui:intnl text="reporter.common.Additional capacity gains by increasing"/>&nbsp;<%=tmpname%></td>
								</tr>
							
			<%		
								if(tmpRecmndtnArr != null){
									for(int k=0;k<tmpRecmndtnArr.size();k++){
										String valTemp = (String)tmpRecmndtnArr.get(k);
										if(valTemp.indexOf("; >")>-1)
										{
											valTemp = "<a"+valTemp.substring(valTemp.indexOf("; >")+1);
										}
										
			%>
									<tr><td style="width:10px;border:0px;padding:0px" valign="top" align="left"><div class="iconArrowBullet" style="vertical-align:middle"></div></td><td style="padding-left: 20px;"><%=valTemp%></td></tr>
			<%
									}
								}
							}
						}
			%>
							</table>
						</div>
					</div>
					<div class="clearDiv">&nbsp;</div>
<%
						

						JSONArray optimizationSummaryArr=null;
						if(optimizatnObj != null && optimizatnObj.containsKey("optimizationSummary"))
							optimizationSummaryArr=(JSONArray)optimizatnObj.get("optimizationSummary");
						if(optimizationSummaryArr != null && optimizationSummaryArr.size() > 0)
						{
			%>
					<div style="margin:20 10 10 10;background:#f8f8f8;border-top:0px" class="containerBordercls">
					   <div style="line-height:0px;">
							<div class="consumptionperSessionTitleBgLine" style=""></div>
<%
							if(pdfPrint !=null && pdfPrint.equalsIgnoreCase("yes"))
							{
%>
								<div align="center" style="position:relative; top:-16px; ">
<%
							}
							else
							{
%>
								<div align="center" style="position:relative; top:-12px;text-align:center">
<%
							}
%>									
									<table>
										<tr>
										<td class="consumptionperSessionTitleBig" style="<%=paddingForTopic%>"><%=intlmap.getTextDescription("reporter.common.Total Workload Possible After Capacity Expansion")%></td>
										</tr>
									</table>
								</div>
						</div>
					   <div class="<%=consumptionperSessionBoxStyle%>">
						<table width="100%">
							<tr>
							<td width="20%">
						  <div class="childDiv" style="background:none;padding:0px;">
							 <table align="left" border="0px">
								<tbody>
								   <tr>
									  <td class="resourceUsability" valign="bottom" style="padding-left:7px;padding-right:7px">&nbsp;</td>
								   </tr>
								   <tr>
									  <td style="vertical-align:bottom;" class="resourceName">&nbsp;</td>
								   </tr>
								</tbody>
							 </table>
						  </div>
						  </td>
			<%
					for(int z=0;z<optimizationSummaryArr.size();z++){
						obj=(JSONObject)optimizationSummaryArr.get(z);
			%>
						  <td width="30%">
						  <div class="childDiv" style="padding:0px;">
							 <table align="center" border="0px">
								<tbody>
								   <tr>
										<td align="right"><div style="margin-right:5px" class="<%=(String)obj.get("iconCls")%>"></div></td>
										<td class="resourceUsability" valign="bottom" align="left"><%=(String)obj.get("value")%><span class="resourceUnitText"></span></td>
								   </tr>
								   <tr>
										<td colspan="2" style="vertical-align:top;" align="center" class="resourceName"><%=(String)obj.get("name")%></td>
								   </tr>
								</tbody>
							 </table>
						  </div>
						   </td>
			<%
					}
			%>

						  <!-- <div class="childDiv">
							 <table align="center" border="0px">
								<tbody>
								   <tr>
									  <td class="resourceUsability" valign="bottom" align="center">14014<span class="resourceUnitText">&nbsp;</span></td>
								   </tr>
								   <tr>
									  <td style="vertical-align:top;" align="center" class="resourceName">Unique Users</td>
								   </tr>
								</tbody>
							 </table>
						  </div> -->
						    <td width="20%">
						  <div class="childDiv" style="background:none;padding:0px;">
							 <table align="left" border="0px">
								<tbody>
								   <tr>
									  <td class="resourceUsability" valign="bottom" style="padding-left:7px;padding-right:7px">&nbsp;</td>
								   </tr>
								   <tr>
									  <td style="vertical-align:bottom;" class="resourceName">&nbsp;</td>
								   </tr>
								</tbody>
							 </table>
							</div>
						  </td>
						 </tr>
						</table>
					   </div>
					</div>
			<%
				}
			%>
					</div>
			<%
					}
				}
	%>
					</div>
	<%	}
		else{
	%>
			<table>
				<tr>
					<td><img src='/images/Light/nomeasures_custom.png' /></td>
				</tr>
			</table>
	<%
		}
	%>

<%
		if(pdfPrint != null && pdfPrint.equalsIgnoreCase("yes"))
		{
%>
			<div class="printFooterText"><%=strPrintFooterText%></div>
<%		}
	}
	catch(Throwable t)
	{
		t.printStackTrace();
	}
%>
