<!DOCTYPE html>

<%
/*****************************************************************************
*	File name		: ErCtxOverviewPrint.jsp
*	Purpose			: This page Handles Print Citrix Overview Report
*	Version			: Reporter 6.2
********************************************************************************/
%>
<%@ include file="ErTracker.jsp"%>
<%@ page import="egurkha.reporter.*"%>
<%@ page import="java.util.*"%>
<%@ page import = "net.sf.json.*" %>
<%@ page import="com.eg.*"%>
<%@ page import="com.eg.EgDbInfo"%>
<%@ page import="com.eg.IniFile"%>
<%@ page import="com.eg.EgDateInfo"%>
<%@ page import="java.text.Format.*"%>
<%@ page import="java.text.DateFormat.*"%>
<%@ page import="java.text.*"%>
<%@ page import="com.eg.EgReportInfo"%>
<%@ page import="com.eg.EgMappingInfo"%>
<%@ page import="com.eg.EgTablesInfo"%>
<%@ page import="com.egurkha.util.DateUtil"%>
<%@ page import="com.egurkha.util.*"%>
<%@ page import="com.egurkha.util.DateTimeTokenizer"%>
<%@ page import="com.eg.EgURLDecoder"%>
<%@ page import="com.eg.EgDbInfo"%>
<%@ page import="com.eg.EgConfigInfo"%>
<%@ page import="java.io.*"%>
<%@ page import="com.egurkha.util.StringUtils"%>
<%@ page import="com.eg.EgSpecsInfo"%>
<%@ taglib prefix="egui" uri="../WEB-INF/eg-taglib.tld"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%
try
{	
	String queryString =(String)ErUtils.prepareQueryString(request.getParameterMap());	
	String pdfPrint = request.getParameter("pdfPrint");
	EgReportInfo reportInfo = new EgReportInfo("manager");
	String strManagerURL = request.getScheme()+"://"+request.getServerName()+":"+ request.getServerPort();
	String controllerURL = strManagerURL+"/final/servlet/com.eg.ErCitrixOverviewReportC;jsessionid=" + session.getId() + "?";
	EgMappingInfo intlmp = new EgMappingInfo(thisuser.getLanguage());
	Map selectParams =  (Map)session.getAttribute("selectionDetail");
	String analysisBy = (String)selectParams.get("analysisBy");
	String siteName = (String)selectParams.get(analysisBy);
	List compListPrint = (List)selectParams.get("componentList");
	String compListStr="";
	for(int c=0;c<compListPrint.size();c++)
	{
		String eachComp=(String)compListPrint.get(c);
		compListStr+=eachComp;
		if(c != compListPrint.size()-1)
		{
			compListStr+=",";
		}
	}
	String startDate = (String)selectParams.get("startdate");
	String endDate = (String)selectParams.get("enddate");
	String starthr = (String)selectParams.get("starthr");
	String endhr = (String)selectParams.get("endhr");
	String startmin = (String)selectParams.get("startmin");
	String endmin = (String)selectParams.get("endmin");
	String weekends = (String)selectParams.get("weekends");
	String timeFrom = (String)selectParams.get("timeFrom");
	String timeTo   = (String)selectParams.get("toTime");
	String uid = request.getParameter("uid");
	String experAllWidget = request.getParameter("experAllWidget");
	String buttonId=request.getParameter("buttonId");
	String currentDateFormat = strUserDateFormat;
	String Days="Saturday,Sunday";
	if("00:00:00".equals(timeFrom))
	{
		timeFrom  = timeFrom.substring(0,timeFrom.lastIndexOf(":"));
		timeTo    = timeTo.substring(0,timeTo.lastIndexOf(":"));
	}
	String dispStart = startDate + " " + starthr  + ":" + startmin  ;
	String dispEnd   = endDate + " " + endhr + ":" + endmin ;
	Map allData = (Map)session.getAttribute("allData");
	List widgetOrderList=new ArrayList();					
	
	String titleToDisplay=reportInfo.getValue("CitrixXenApp_OverView","reportTitle");
	if(titleToDisplay == "")
		titleToDisplay="Citrix XenApp Performance";
	String fileName=titleToDisplay;
	HashMap paramVal =new HashMap();
	paramVal.put("fileName",fileName);
	session.setAttribute("parameters", paramVal);
	Map tRequestMap=(Map)session.getAttribute("tRequestMap");
	JSONObject widgetOrderObj=new JSONObject();
	List buttonList=new ArrayList();
	boolean experAll=false;

	
	if(experAllWidget != null && experAllWidget.equalsIgnoreCase("true"))
	{
		experAll=true;
		buttonList.add("citrixUserExperience");
		buttonList.add("citrixSessions");
		buttonList.add("citrixApplications");
		buttonList.add("citrixEvents");
		buttonList.add("citrixServer");
		buttonList.add("citrixLicense");		
	}
	else
	{
		buttonList.add(buttonId);
	}
	String columnRowCountPrint=reportInfo.getValue("CitrixXenApp_OverView","columnRowCountPrint");
	String menuListStr=reportInfo.getValue("CitrixXenApp_OverView","MenuList");
	String[] menuArry=menuListStr.split(",");
	JSONObject menuListObj=new JSONObject();
	for(int m=0;m<menuArry.length;m++)
	{
		String eachMenu=menuArry[m];
		if(eachMenu != null && eachMenu.indexOf("$") != -1)
		{
			String dispButton=eachMenu.substring(eachMenu.indexOf("$")+1);
			eachMenu=eachMenu.substring(0,eachMenu.indexOf("$"));
			menuListObj.put(eachMenu,dispButton);
		}
	}
	EgSpecsInfo specsInfo = new EgSpecsInfo("manager");
	ArrayList useSupportCompTypeList=new ArrayList();
	String CtxZoneComponents=reportInfo.getValue("CitrixXenApp_OverView","componentType");
	List CtxZoneComponentsList=null;
	if(CtxZoneComponents != null && CtxZoneComponents.trim() != "" && CtxZoneComponents.length() > 2)
		CtxZoneComponentsList=Arrays.asList(CtxZoneComponents.split(","));
	List v_components= UBean.getAllUserComponents(3);
	for(int v=0;v<v_components.size();v++)
	{
		String eachComp=(String)v_components.get(v);
		if(eachComp != null && eachComp.indexOf(":") != -1)
		{
			eachComp=eachComp.substring(eachComp.lastIndexOf(":")+1,eachComp.length());
			if(CtxZoneComponentsList != null && CtxZoneComponentsList.contains(eachComp))
			{
				if(!useSupportCompTypeList.contains(eachComp))
				{
					useSupportCompTypeList.add(eachComp);
				}
			}
		}
	}
	for(int b=0;b<buttonList.size();b++)
	{
		String eachButton=(String)buttonList.get(b);
		String buttonWidgetOrderStr=reportInfo.getValue("CitrixXenApp_OverView",eachButton+"_orderDetailPrint");	
		if(columnRowCountPrint != null && columnRowCountPrint != "" && columnRowCountPrint.equalsIgnoreCase("two"))
			buttonWidgetOrderStr=reportInfo.getValue("CitrixXenApp_OverView",eachButton+"_orderDetailPrintNew");
		JSONArray widgetOrderArry=(JSONArray)JSONSerializer.toJSON(buttonWidgetOrderStr);
		JSONArray widgetOrderArryNew = new JSONArray();
		for(int w=0;w<widgetOrderArry.size();w++)
		{
			JSONArray eachWidgetAry = (JSONArray)widgetOrderArry.get(w);
			for(int e=0;e<eachWidgetAry.size();e++)
			{
				String eachPanelName = (String)eachWidgetAry.get(e);
				String eachPanelDetail = (String)tRequestMap.get(eachPanelName+"_detail");
				JSONObject eachPanelDetailObj = (JSONObject)JSONSerializer.toJSON(eachPanelDetail);
				String testName = null;
				if(eachPanelDetailObj != null && eachPanelDetailObj.containsKey("barTest"))
				{
					testName = (String)eachPanelDetailObj.get("barTest");
				}
				else if(eachPanelDetailObj != null && eachPanelDetailObj.containsKey("pieTest"))
				{
					testName = (String)eachPanelDetailObj.get("pieTest");
				}
				if(testName != null && testName.indexOf("_DDD")>-1)
					testName = testName.substring(0,testName.indexOf("_DDD"));
				for(int u=0;u<useSupportCompTypeList.size();u++)
				{
					String eachComp = (String) useSupportCompTypeList.get(u);
					if(testName==null || specsInfo.isTestRelevantForServer(eachComp,testName) || testName.equalsIgnoreCase("report_state_summary") || testName.equalsIgnoreCase("ALARM_HISTORY_SUMMARY"))
					{
						widgetOrderArryNew.add(eachPanelName);
						break;
					}
				}
			}
		}
		//
		JSONArray widgetOrderNewAry = new JSONArray();
		for(int n=0;n<widgetOrderArryNew.size();n=n+2)
		{
			JSONArray widgetOrderArryTemp = new JSONArray();
			widgetOrderArryTemp.add(widgetOrderArryNew.get(n));
			if((n+1) < widgetOrderArryNew.size())
				widgetOrderArryTemp.add(widgetOrderArryNew.get(n+1));
			widgetOrderNewAry.add(widgetOrderArryTemp);
		}
		widgetOrderObj.put(eachButton,widgetOrderNewAry);
	}
	boolean needTOC=false;
	%>
	<!Doctype html>
		<head>
		<meta http-equiv="refresh">
		<link rel="stylesheet" type="text/css" href="../../final/styles/eGLightThemeIcons.css" />
		<link rel="stylesheet" type="text/css" href="../../final/reporter/styles/printpagestyle.css" />
		<link rel="stylesheet" type="text/css" href="../../final/styles/componentsLight.css" /><!-- for nomeasures and alarms icons -->
		<style>
			@media print {body {-webkit-print-color-adjust: exact;}}
			.ptoc1-style-left { margin-left: 0 }
			.ptoc2-style-left { margin-left: 16 }
			.ptoc3-style-left { margin-left: 32 }
			.ptoc4-style-left { margin-left: 48 }
			.ptoc5-style-left { margin-left: 64 }
			.ptoc6-style-left { margin-left: 80 }
			.ptoc-table { border: 0; width: 100%;align:center;valign:middle;font-size:30px;line-height:80px}
			.ptoc-left-col { width: 99%; padding-right: 0 }
			.ptoc-right-col { text-align: right; padding-left: 0;vertical-align: middle; }
			.ptoc-link { text-decoration: none; color: black }
			#only-table span.decimal-align{float: left; text-align: right; width:50%}
			#only-table span.decimal-align2{float: right; text-align: left; width:50%}
			.highlightFieldsetHtmlDivBox{
			  border-style: solid;
			  border-width: 1px 1px 1px 1px;
			  background:#ffffff;
			  border-color:#e7e7e7 #e7e7e7 #e7e7e7 #e7e7e7;
			  padding:0px;
			  text-align:center;
			   -webkit-box-sizing: border-box;
			  -moz-box-sizing: border-box;
			  box-sizing: border-box;
			  display:inline-block;
			  position:relative;
			}
			.highlightFieldsetHtmlDivBoxTitle{
				position: absolute;
				top:-12px;
				left: 20;
				background-color: #fff;
				color: #000000;
				padding: 2px 4px 2px 0px;
				font-size: 16px !important;
				font-family: 'Roboto';
				font-weight: 400 !important;
			}
			.appFlowSummaryDiv{
				background-color:#ffffff;
				display:block;
				width:740px;
				margin:0px;
				padding:0px;
				border:1px solid #dedede;
				box-sizing: border-box;
			}
			.appFlowSummaryTable{
				border-collapse: collapse;
				border-spacing: 0;
				table-layout:fixed;
				border-top:0px solid #b4b5b6;
			}
			
		.appFlowSummaryDivBg{
			background-color:#f6f6f6;
			display:block;
			width:620px;
			margin:0px;
			height:350px;
			padding:0px;
			border:1px solid #f6f6f6;
			box-sizing: border-box;
		}

		.appFlowSummaryTable tr td{padding:8px 5px 12px 0px;vertical-align:top;line-height:18px}
		</style>
		<%
		experAll=false;
		if(!experAll)
		{
			if(pdfPrint !=null && pdfPrint.equalsIgnoreCase("yes"))
			{			
				%>

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

				<%
			}
		%>
		</head>
		<body marginwidth="20" marginheight="20" bgcolor="#FFFFFF">
		<%
		String strLogCls = "printHeaderBoxLogo";
		boolean isPDF=false;
		if(pdfPrint !=null && pdfPrint.equalsIgnoreCase("yes"))
		{
			strLogCls = "printHeaderBoxLogo";
		}else
		{
			strLogCls = "printPdfHeaderBoxLogo";
			isPDF=true;
		}
		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(titleToDisplay))
		{
			%>
			<div class="printHeaderBoxTitle"><%= titleToDisplay %></div>
			<%
		}
		else
		{
			%>
			<div class="printHeaderBoxTitle"><egui:intnl text="reporter.common.Citrix Overview Report) " /></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>
		<div class="printOuterBoxNoBorder"> 
		<%
		EgDateInfo egdt = new EgDateInfo();
		SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");
		java.util.Date today = egdt.egetRealDate();
		String currentDateTime = sdf.format(today);
		String curFormatDate  = DateUtil.changeDateFormat(currentDateTime, "MM/dd/yyyy HH:mm:ss", strUserDateFormat+" HH:mm:ss");	
		if(isPDF)
		{
			%>

			<table width="650px" height="854px" border="0"   align="center" style="margin:50px">
				<tr>
					<td align="center" valign="middle" width="100%" height="100%">
						<div class="appFlowSummaryDiv">
						<table border="0" width="100%" height="428px" align="center" style="padding:15px 30px 30px 30px">
							<tr>
								<th align="center" style="padding:0px 10px 0px 10px;line-height:38px;height:105px" class="newFont_bold30">Citrix XenApp Performance Report</th>
							</tr>
							<tr>
								<td width="100%" style="border-top:1px solid #b4b5b6;padding-top:0px">
									<table border="0px" align="center" class="appFlowSummaryTable"><col width="32%"/><col width="3%"/><col width="55%"/>
									<tr>
										<td class="font_bold15"><egui:intnl text="reporter.common.Analyzed by"/></td>
										<td class="font_bold15">:</td>
										<td class="font_normal15"><%=analysisBy%></td>
									</tr>
									<%
									if(analysisBy != null && !analysisBy.equalsIgnoreCase("component"))
									{
										%>
										<tr>
											<td class="font_bold15"><%=analysisBy%></td>
											<td class="font_bold15">:</td>
											<td class="font_normal15"><%=siteName%></td>
										</tr>	
										<%
									}
									%>
									<tr>
										<td class="font_bold15"><egui:intnl text="reporter.common.Start Date" /> </td>
										<td class="font_bold15">:</td>
										<td class="font_normal15"><%=dispStart%></td>
									</tr>
									<tr>
										<td class="font_bold15"><egui:intnl text="reporter.common.End Date" /> </td>
										<td class="font_bold15">:</td>
										<td class="font_normal15"><%=dispEnd%></td>
									</tr>
									<tr>
										<td class="font_bold15"><egui:intnl text="reporter.common.Time Period"/> </td>
										<td class="font_bold15">:</td>
										<td class="font_normal15"><span class="bold"><%=timeFrom%>&nbsp;   <egui:intnl text="reporter.common.to "/>&nbsp; <%=timeTo%></span></td>
									</tr>
									<tr>
										<td class="font_bold15"><egui:intnl text="reporter.common.Components"/> </td>
										<td class="font_bold15">:</td>
										<td class="font_normal15"><%=compListStr%></td>
									</tr>
									<tr>
										<td class="font_bold15">Report Generated on </td>
										<td class="font_bold15">:</td>
										<td class="font_normal15"><%=curFormatDate%></td>
									</tr>
									</table>
								</td>
							</tr>
						</table></div>
					</td>
				</tr>
			</table>
			<pd4ml-page-break/>	
			<%
			if(needTOC)
			{
			%>
			<pd4ml:toc>
			<table cellspacing="0" style="border:0px solid red;table-layout:fixed;margin:20px" width="895px"  height="100%" ><col width="3%"/><col width="75%"/><col width="22%"/>
			
				<tr>
					<td colspan="3"><span class="newFont_normal25">Table Of Contents</span></td>
				</tr>
				<tr height="26px">
				<td colspan="3">&nbsp;</td>
				</tr>
				<tr height="26px">
				<td colspan="3">&nbsp;</td>
				</tr>
				
				<tr height="26px">  
					<td><span class="newFont_normal21">1.</span></td>
					<td class="ptoc-left-col"><a class="ptoc-link" href="#tocLine1">  
						<span class="newFont_normal21">User Experience</span></a></td>  
					<td class="ptoc-right-col"><a class="ptoc-link" href="#tocLine1">  
						<div class="ptoc1-style-right"><span class="newFont_normal21"> </span></div></a>
					</td>
				</tr> 
				<tr   height="26px">
					<td colspan="3">&nbsp;</td>
				</tr>
				<tr height="26px">  
					<td><span class="newFont_normal21">2.</span></td>
					<td class="ptoc-left-col"><a class="ptoc-link" href="#tocLine2">  
						<div class="ptoc1-style-left"><span class="newFont_normal21">Sessions</span></div></a></td>  
					<td class="ptoc-right-col"><a class="ptoc-link" href="#tocLine2">  
						  <div class="ptoc1-style-right"><span class="newFont_normal21"> </span></div></a>
					</td>
				</tr>  
				<tr height="26px">
					<td colspan="3">&nbsp;</td>
				</tr>
				<tr height="26px">  
					<td><span class="newFont_normal21">3.</span></td>
					<td class="ptoc-left-col"><a class="ptoc-link" href="#tocLine3">  
						<div class="ptoc1-style-left"><span class="newFont_normal21">Applications</span></div></a></td>  
					<td class="ptoc-right-col"><a class="ptoc-link" href="#tocLine3">  
						  <div class="ptoc1-style-right"><span class="newFont_normal21"> </span></div></a>
					</td>
				</tr>  
				<tr height="26px">
				<td colspan="3">&nbsp;</td>
				</tr>
				<tr height="26px">  
					<td><span class="newFont_normal21">4.</span></td>
					<td class="ptoc-left-col"><a class="ptoc-link" href="#tocLine4">  
						<div class="ptoc1-style-left"><span class="newFont_normal21">Events</span></div></a></td>  
					<td class="ptoc-right-col"><a class="ptoc-link" href="#tocLine4">  
						 <div class="ptoc1-style-right"><span class="newFont_normal21"> </span></div></a>
					</td>
				</tr>  
				<tr height="26px">
				<td colspan="3">&nbsp;</td>
				</tr>
				<tr height="26px">  
					<td><span class="newFont_normal21">5.</span></td>
					<td class="ptoc-left-col"><a class="ptoc-link" href="#tocLine5">  
						<div class="ptoc1-style-left"><span class="newFont_normal21">Servers</span></div></a></td>  
					<td class="ptoc-right-col"><a class="ptoc-link" href="#tocLine5">  
					  <div class="ptoc1-style-right"><span class="newFont_normal21"> </span></div></a>
					</td>
				</tr>  
				<tr height="26px">
				<td colspan="3">&nbsp;</td>
				</tr>
				<tr height="26px">  
					<td><span class="newFont_normal21">6.</span></td>
					<td class="ptoc-left-col"><a class="ptoc-link" href="#tocLine6">  
						<div class="ptoc1-style-left"><span class="newFont_normal21">License</span></div></a></td>  
					<td class="ptoc-right-col"><a class="ptoc-link" href="#tocLine6">  
						<div class="ptoc1-style-right"><span class="newFont_normal21"> </span></div></a>
					</td>
				</tr>  
				<tr height="326px">
				<td colspan="3">&nbsp;</td>
				</tr>
			</table>  
			</pd4ml:toc>
			<pd4ml-page-break/>
			<%
			}
		}
		else
		{
			if(analysisBy != null)
			{
				%>
				<div class="printSelectionFields"><egui:intnl text="reporter.common.Analyzed by"/>:<span class="bold"><%=analysisBy%></span></div>
				<%
			}
			if(weekends != null)
			{
				%>
				<div class="printSelectionFields"><egui:intnl text="reporter.common.Exclude Weekends"/>:<span class="bold"><%=weekends%></span></div>
				<%
			}
			if(dispStart != null)
			{
				%>
				<div class="printSelectionFields"><egui:intnl text="reporter.common.Start Date" />: <span class="bold"><%=dispStart%></span></div>
				<%
			}
			if(dispEnd != null)
			{
				%>
				<div class="printSelectionFields"><egui:intnl text="reporter.common.End Date" />: <span class="bold"><%=dispEnd%></span></div>
				<%
			}
			if(timeFrom != null)
			{
				%>
				<div class="printSelectionFields"><egui:intnl text="reporter.common.Time Period"/>: <span class="bold"><%=timeFrom%>&nbsp;   <egui:intnl text="reporter.common.to "/>&nbsp; <%=timeTo%></span></div>
				<%
			}
			%>
			</div>
			<%
		}
		String urlValue=null;
		boolean isData=false;
		Iterator buttonItr=widgetOrderObj.keySet().iterator();
		JSONArray tempWidgetOrderArry=null;	
		int titleCount=0;
		while(buttonItr.hasNext())
		{
			String eachButtonStr=(String)buttonItr.next();
			tempWidgetOrderArry=(JSONArray)widgetOrderObj.get(eachButtonStr);
			if(eachButtonStr.equalsIgnoreCase("citrixUserExperience") || eachButtonStr.equalsIgnoreCase("citrixSessions") || eachButtonStr.equalsIgnoreCase("citrixApplications") || eachButtonStr.equalsIgnoreCase("citrixServer") || eachButtonStr.equalsIgnoreCase("citrixEvents") || eachButtonStr.equalsIgnoreCase("citrixLicense"))
			{
				%>
				<br/>
				<div class="" id="tocLine<%=titleCount+1%>">
				<%
				if(isPDF)
				{
					%>
					<table width="1000px" height="1324px" border="0"   align="center" >
					<tr>
						<td align="center" valign="middle">
							<table width="858px" height="585px" border="0px" style="background-image:url('../images/btmPdf_highlightBorder.png')">
								<tr>
									<td align="center" valign="middle" height="100%" style="padding:20px;">
										<div class="appFlowSummaryDivBg">
										<table border="0px" width="100%" style="height:340px;" height="340px" align="center" >
											<tr>
												<td align="center" valign="middle">
													<table border="0px" align="center">
														<tr>
															<td align="center" class="newFont_bold25" style="line-height:30px"><%=menuListObj.get(eachButtonStr).toString()%>
															</td>
														</tr>
													</table>
												</td>
											</tr>
										</table>
										</div>
									</td>
								</tr>
							</table>
						</td>
					</tr>
				</table>
				<pd4ml-page-break/>
				<%
					titleCount++;
				}
				else
				{
					%>
					<div class="printOuterBox">
					<div class="printOuterBoxHeader"><%=menuListObj.get(eachButtonStr).toString()%></div>
					<%
				}
				%>
				<table valign="middle" width="100%" cellpadding="0px" cellspacing="0px" >
				<tbody>
					
				<%
				for(int i=0;i<tempWidgetOrderArry.size();i++)
				{
					JSONArray eachGpArry=(JSONArray)tempWidgetOrderArry.get(i);
					String groupWidth="33%";
					int chartWidth=280;
					System.out.println("columnRowCountPrint==>>>df>>>"+columnRowCountPrint);
					if(columnRowCountPrint != null && columnRowCountPrint.equalsIgnoreCase("two"))
					{
						groupWidth="50%";
						chartWidth=430;
					}
					if(eachButtonStr.equalsIgnoreCase("citrixLicense"))
					{
						groupWidth="100%";
						chartWidth=860;
					}
					%>
					<div class="clearDiv"></div>
					<tr  class="newimg">
					<%
					for(int e=0;e<eachGpArry.size();e++)
					{
						String eachWidgetNameStr=(String)eachGpArry.get(e);
						String widgetName=eachButtonStr+eachWidgetNameStr;
						Map eachWidgetMap=(Map)allData.get(widgetName);
						if(eachWidgetMap != null && eachWidgetMap.get("isData") != null)
						{
							isData=(Boolean)eachWidgetMap.get("isData");
							Map otherInfo=(Map)eachWidgetMap.get("otherInfo");
							JSONArray digitalChartArry=null;
							if(eachWidgetMap.get("digitalChartArry") != null)
								digitalChartArry=(JSONArray)eachWidgetMap.get("digitalChartArry");
							
							String widgetTitle=(String)otherInfo.get("title");
							String height=(String)otherInfo.get("height");
							
							String alignStyle="border-bottom:1px solid #dedede;";
							if(e==0 && i != tempWidgetOrderArry.size()-1)
								alignStyle="border-right:1px solid #dedede;border-bottom:1px solid #dedede;";
							else if(i == tempWidgetOrderArry.size()-1)
								alignStyle="border-right:1px solid #dedede;";

						%>
							<td width="<%=groupWidth%>" style="vertical-align:top;padding:10px 10px 10px 10px;<%=alignStyle%>" align="left" height="auto"  valign="top">
							<div class="print OuterBox">
								<div class="printOuterBoxHeader"><%=widgetTitle%></div>								
								<div style="width:100%;overflow:hidden;height:<%=height%>px;position: relative;">
							<%
							if(isData)
							{
								Object anyChart = eachWidgetMap.get("anyChartObj");
								Map anyChartObj=null;
								JSONArray anyChartObjList=null;
								if(anyChart instanceof Map)
								{
									anyChartObj=(Map)eachWidgetMap.get("anyChartObj");
								}
								else
								{
									anyChartObjList=(JSONArray)eachWidgetMap.get("anyChartObj");
								}
								
								boolean isPieChart=false;
								boolean isTable=false;
								if(anyChartObj!=null && anyChartObj.get("chartType") != null)
								{
									String chartType=(String)anyChartObj.get("chartType");
									if(chartType.equalsIgnoreCase("pie") || chartType.equalsIgnoreCase("donut"))
									{
										isPieChart=true;
									}
									if(chartType.equalsIgnoreCase("table"))
									{
										isTable=true;
									}
								}

								if(!isTable)
								{
									
									String minMaxAvg="";
									String digitalPart="";
									boolean isDigitalPercent=false;
									if(anyChartObj!=null && anyChartObj.get("minMaxAvg") != null)
										minMaxAvg=(String)anyChartObj.get("minMaxAvg");
									if(anyChartObj!=null && anyChartObj.get("digitalPart") != null)
										digitalPart=(String)anyChartObj.get("digitalPart");
									if(anyChartObj!=null && anyChartObj.get("digitalPercent") != null)
									{
										isDigitalPercent=true;
									}
									if(digitalChartArry != null)
									{
										%>
										<table valign="middle" width="100%" cellpadding="0px" cellspacing="0px" >
										<tr><!-- first tr for digital-->
										<td>
										<%
										if(minMaxAvg.equalsIgnoreCase("no"))
										{
											%>
											<table valign="middle" width="100%" cellpadding="0px" cellspacing="0px" style="padding:10px" >
											<tr>
												<%
												for(int f=0;f<digitalChartArry.size();f++)
												{
													JSONObject eachDigObj=(JSONObject)digitalChartArry.get(f);
													if(f==0)
													{
														%>
														<td class="chartminmax" style="padding:10px;">
														<div style="text-align:center;">
														<%
													}
													else
													{
														%>
														<td>
														<div style="margin-left:10px;padding:10px;text-align:center" class="chartminmax">
														<%
													}
													if(isDigitalPercent)
													{
														%>
														<table align="center"><tr><td style="text-align:center">
														<%
													}
														%>	
														
														<div class="font_normal20" style="line-height:normal"><%=eachDigObj.get("value")%></div>
														<div class="crl"></div>
														<table align="center">
															<tr>
															<%
															if(eachDigObj.get("bgColor") != null)
															{
																%>
																<td>
																	<svg xmlns="http://www.w3.org/2000/svg" height="10" width="10">
																	  <circle cx="5" cy="5" r="4" fill="<%=eachDigObj.get("bgColor")%>" />
																	</svg>
																</td>
																<%
															}
															%>
																<td style="padding-left:2px">
																	<div class="font_normal11"><%=eachDigObj.get("name")%></div>
																</td>
															</tr>
														</table>
													<%
													if(isDigitalPercent)
													{
														%>
														</td>
														<%
														if(f==1)
														{							
														
														%>
														<td style="text-align:center;">
														<div style="background:<%=anyChartObj.get("digitalBgColor").toString()%>;padding:5px 4px 3px 4px;margin-left:4px;color:#ffffff;font-family:arial;display:inline-block;text-align:left;line-height:.8em;font-size:12px"><%=anyChartObj.get("digitalPercent").toString()%>
														<span style="font-size:10px">%</span> <br> 
														<span style="font-size:8px">SLOW</span>
														</div>			
														</td>
														<%
														}
														%>
														</tr></table>
														<%
													}
													%>
													</div>
												</td>
												<%
											}
											%>
										</tr>
										</table>
												<%
									}
									else if(minMaxAvg.equalsIgnoreCase("yes"))
									{
										%>
										<table valign="middle" width="100%" cellpadding="0px" cellspacing="0px" style="padding:10px" >
										<tr>
										<%
										JSONObject firstDigObj=(JSONObject)digitalChartArry.get(0);
										if(!digitalPart.equalsIgnoreCase("one"))
										{
											%>
											<td width="30%" class="chartminmax">
												<div style="text-align:center;padding:10px;">
												<div class="font_normal20" style="line-height:normal"><%=firstDigObj.get("value")%></div>
												<div class="crl"></div>
												<div class="font_normal12"><%=firstDigObj.get("name")%></div>
												</div>															
											</td>
											<%
										}
										%>										
										<td width="70%">
											<div style="margin-left:10px;padding:10px" class="chartminmax">
											<table valign="middle" width="100%" cellpadding="0px" cellspacing="0px" >
											<tr>
										<%
										for(int f=0;f<digitalChartArry.size();f++)
										{
											JSONObject eachDigObj=(JSONObject)digitalChartArry.get(f);
											if(f!=0 || digitalPart.equalsIgnoreCase("one"))
										{
											%>
											<td>
											<%
											if(f != digitalChartArry.size()-1)
											{
												%>
														<div style="text-align:center;border-right:1px solid #d9d9d9">
														<%
													}
													else
													{
														%>
														<div style="text-align:center">
														<%
													}
													%>													
														<div class="font_normal20" style="line-height:normal"><%=eachDigObj.get("value")%></div>
														<div class="crl"></div>
														<table align="center">
															<tr>
															<%
															if(eachDigObj.get("bgColor") != null)
															{
																%>
																<td>
																	<svg xmlns="http://www.w3.org/2000/svg" height="10" width="10">
																	  <circle cx="5" cy="5" r="4" fill="<%=eachDigObj.get("bgColor")%>" />
																	</svg>
																</td>
																<%
															}
															%>
																<td style="padding-left:2px">
																	<div class="font_normal11"><%=eachDigObj.get("name")%></div>
																</td>
															</tr>
														</table>
													</div>
													</td>
													<%
													if(f != digitalChartArry.size()-1)
													{
														%>
														<td>
															<div class="chartLegendDivider" style="width:1px;"></div>
														</td>
													<%
													}
												}
											}
											%>	
												</tr>
												</table>
												</div>
											</td>											
											</tr>
											</table>												
											<%
										}
										%>
										</tr>

										<tr><!-- second tr- for grahp-->
										<td>
										<%											
								}
								if(isPieChart)
								{
									%>

									<table width="100%" height="100%">
									<tr>
									<td width="75%">
									<%
										if(pdfPrint !=null && pdfPrint.equalsIgnoreCase("yes"))
										{
									%>
											<img height="100%" width="100%" src="<%=controllerURL+"&er_view=print&width="+chartWidth+"&height=250&widgetName="+widgetName%>"/>
									<%
										}
										else
										{
									%>
											<img height="100%" width="100%" src="<%=controllerURL+"&er_view=print&width="+chartWidth+"&height=210&widgetName="+widgetName%>"/>
									<%
										}
									%>
										</td>
										<td width="25%">
										<div style="width:200px;display:inline-block;">
										<table cellpadding='0' cellspacing='0' border='0'>
									<%
											JSONArray dataSetArry=(JSONArray)anyChartObj.get("DataSet");
											JSONObject dataSetObj=(JSONObject)dataSetArry.get(0);
											JSONArray dataArry=(JSONArray)dataSetObj.get("data");
											for(int d=0;d<dataArry.size();d++)
											{
												JSONObject eachObj=(JSONObject)dataArry.get(d);
												String legendName=(String)eachObj.get("name");
												String legendColor=(String)eachObj.get("color");
												double dblVal=(Double)eachObj.get("y");
												%>
												<tr><td>
												<svg xmlns="http://www.w3.org/2000/svg" height="10" width="10">
														  <circle cx="5" cy="5" r="4" fill="<%=legendColor%>" />
														</svg>
													</td>
													<td style='padding:2px;' class='font_normal10'><%=legendName%></td><td style='padding:5px;' class='font_normal10'>	<%=dblVal%></td></tr>
										<%
												if(eachObj != null && eachObj.containsKey("innerMeasure")){
													JSONArray tmpArr=(JSONArray)eachObj.get("innerMeasure");
													JSONObject tmpObj2=null;
													if(tmpArr != null && tmpArr.size() > 0){
														for(int g=0;g<tmpArr.size();g++){
															tmpObj2=(JSONObject)tmpArr.get(g);
															if(tmpObj2 != null && tmpObj2.size() > 0){
										%>
													<tr>
														<td>&nbsp;</td>
														<td style='padding:2px;' class='font_normal10'>&nbsp;&nbsp;<%=(String)tmpObj2.get("name")%></td>
														<td style='padding:5px;' class='font_normal10'><%=(Double)tmpObj2.get("y")%></td>
													</tr>
										<%
															}
														}
													}
												}
											}
										%>
											</table>
											</div>
											</td>
										</tr>
									</table>
									<%
								}
								else
								{
									int heightInt=Integer.parseInt(height);
									if(digitalChartArry != null)
										heightInt=heightInt-80;
									if(anyChartObjList!=null && anyChartObjList.size()>0)
									{
										for(int u=0;u<anyChartObjList.size();u++)
										{
											JSONObject chartObj = (JSONObject)anyChartObjList.get(u);
											String keys = (String)chartObj.get("infoKey");
											JSONObject summaryObj=(JSONObject)chartObj.get("summaryObj");
										%>
										<div class="printOuterBoxHeader"><%=keys%></div>	
										<table valign="middle" width="100%" cellpadding="0px" cellspacing="0px" >
										<tr><td>
										<img src="<%=controllerURL+"&er_view=print&width=600&height="+(heightInt-54)+"&widgetName="+widgetName+"&licenseGraphIndex="+u%>"/>
										</td>
										<td>
											<table valign="middle" width="100%" cellpadding="0px" cellspacing="0px" >
												<tr>
													<td>
														<table width="100%" align="center" valign="middle"><tr>
														<td width="50%" align="center" class="chartminmax"><div style="text-align:center;padding:10px;"><div class="newFont_bold12" style="line-height:normal">Installed</div><div class="crl"></div><div class="font_normal20"><%=summaryObj.get("Installed")%></div></div></td>
														<td width="50%" align="center" class="chartminmax"><div style="text-align:center;padding:10px;"><div class="newFont_bold12" style="line-height:normal">Available</div><div class="crl"></div><div class="font_normal20"><%=summaryObj.get("Available")%></div></div></td>
														</tr>
														<tr>
														<td width="50%" align="center" class="chartminmax"><div style="text-align:center;padding:10px;"><div class="newFont_bold12" style="line-height:normal">Available(%)</div><div class="crl"></div><div class="font_normal20"><%=summaryObj.get("Available_PER")%></div></div></td>
														<td width="50%" align="center" class="chartminmax"><div style="text-align:center;padding:10px;"><div class="newFont_bold12" style="line-height:normal">Daily Used(Avg)</div><div class="crl"></div><div class="font_normal20"><%=summaryObj.get("Daily_used")%></div></div></td>
														</tr></table>
													</td>
												</tr>
												<tr>
													<td align="center"><img src="<%=controllerURL+"&er_view=print&width=250&height=250&widgetName="+widgetName+"&licenseGraphIndex="+u+"&donutChart=yes"%>"/></td>
												</tr>
											</table>
										</td>
										</tr></table>
										<%
											if(u<anyChartObjList.size()-1)
											{
											%>
											</div>
											<div style="width:100%;overflow:hidden;height:<%=height%>px;position: relative;">
											<%
											}
										}
									}
									else
									{
									%>
									<img src="<%=controllerURL+"&er_view=print&width="+chartWidth+"&height="+heightInt+"&widgetName="+widgetName%>"/>
									<%
									}
								}
								if(digitalChartArry != null)
								{
									%>
									</td>
									</tr>
									</table>
									<%
								}
							}
							else
							{
								JSONArray gridColumns=(JSONArray)anyChartObj.get("gridColumns");
								JSONArray gridData=(JSONArray)anyChartObj.get("gridData");
								String headerAlign="left";										
								%>
								<div class="newTable">
									<table id="only-table" align="center" cellspacing="0" cellpadding="0" width="100%">
										<thead>
										<tr>
										<%
										for(int g=0;g<gridColumns.size();g++)
										{
											String eachHeader=(String)gridColumns.get(g);
											if(eachHeader.indexOf("@@") != -1)
											{
												headerAlign=eachHeader.substring(eachHeader.indexOf("@@")+2);
												eachHeader=eachHeader.substring(0,eachHeader.indexOf("@@"));
												if(eachHeader.indexOf("$m$") != -1)
													eachHeader=eachHeader.substring(0,eachHeader.indexOf("$m$"));
											}
											%>
											<th align="<%=headerAlign%>"><%=eachHeader%></th>
											<%
										}
										%>
										</tr>
										</thead>
										<tbody>
										<%
										for(int d=0;d<gridData.size();d++)
										{
											JSONArray eachRow=(JSONArray)gridData.get(d);
											%>
											<tr>
											<%
											for(int dd=0;dd<eachRow.size();dd++)
											{
												String eachVal=(String)eachRow.get(dd);
												if(eachVal.indexOf("~DD~") != -1)
												{
													eachVal=eachVal.substring(0,eachVal.indexOf("~DD~"));
												}
												if(dd==1) //.. for decimal align numbers
												{
													if(eachVal.indexOf(".") != -1)
													{
														String str=eachVal.substring(0,eachVal.indexOf("."));
														String strDecimal=eachVal.substring(eachVal.indexOf("."));
														%>
														<td><span class="decimal-align"><%=str%></span><span class="decimal-align2"> <%=strDecimal %></span></td>
														<%
													}
													else
													{
														%>
														<td><span class="decimal-align"><%=eachVal%></span></td>
														<%
													}															
												}
												else
												{
													%>														
													<td><%=eachVal%></td>
													<%
												}
											}
											%>
											</tr>
											<%
										}
											%>
											</tbody>
										</table>
										</div>
									<%
								}
								
							}
							else
							{
								%>
								<table width="100%" height="100%"><tr><td align="center" valign="middle" style="vertical-align:middle">
								<img src="/final/images/Light/nomeasures_custom.png">
								</td></tr></table>
								<%

							}
								%>
						</div>
						</div>
					</td>
					<%
					}
					else
					{
						String errorMessage = "";
						String errorMessageIcon = "";
						String errorMessageTitle = "";
						if(eachWidgetMap!=null)
						{
							errorMessage = (String)eachWidgetMap.get("noMeasureMessage");
							errorMessageIcon = (String)eachWidgetMap.get("noMeasureIcon");
							errorMessageTitle = (String)eachWidgetMap.get("title");
						}
						
						%>
						<td width="<%=groupWidth%>" style="vertical-align:top;padding:10px 10px 10px 10px">
							<div class="printOuterBox" height="100%">
								<div class="printOuterBoxHeader"><%=errorMessageTitle%></div>
								<div style="width:100%;height:100%overflow:auto;padding:100px"><!-- padding :10px-->
								<%
									out.println("<table width='100%' height='100%'><tbody><tr><td align='center' valign='middle' class='font_normal12'><div class="+errorMessageIcon+"></div>"+errorMessage+"</td></tr></tbody></table>");
								%>
								</div>
							</div>
						</td>
						<%
					}						
				}
					%>
				</tr>				
				<%
				}
			%>					
			</tbody>
			</table>
			<%
			if(isPDF)
			{
				%>
				<%
			}
			else
			{
				%>
				</div>
				<%
			}
			%>		
			</div>			
			<%
		}
	}	
}
else
{
	%>
	<jsp:forward page = "/final/servlet/com.eg.EgOverviewPDFDownloadC"/>
	<%
}
		if(pdfPrint != null && pdfPrint.equalsIgnoreCase("yes"))
		{
	%>
		<div class="printFooterText"><%=strPrintFooterText%></div>
	<%
		}
	%>
	</body>
	</html>
	<%


}
catch(Exception e)
{
	e.printStackTrace();
}
%>