<!DOCTYPE html>

<%@ include file = "ErTracker.jsp" %>
<%@ page import = "com.eg.EgDateInfo" %>
<%@ page import = "com.eg.EgServicesInfo" %>
<%@ page import = "com.eg.EgTablesInfo" %>
<%@ page import = "com.eg.EgTesterInfo" %>
<%@ page import = "com.eg.EgDbInfo" %>
<%@ page import = "com.eg.EgMappingInfo"%>
<%@ page import = "com.eg.EgTestInfo"%>
<%@ page import = "com.eg.EgURLEncoder"%>
<%@ page import = "com.eg.EgURLDecoder" %>
<%@ page import = "com.eg.EgSpecsInfo"%>
<%@ page import = "com.eg.EgReportInfo"%>
<%@ page import = "egurkha.reporter.ErInfo" %>
<%@ page import = "net.sf.json.JSONArray" %>
<%@ page import = "net.sf.json.JSONObject" %>
<%@ page import = "com.egurkha.util.DateUtil" %>
<%@ page import = "com.egurkha.util.DateTimeTokenizer" %>
<%@ page import = "com.egurkha.util.DateUtil" %>
<%@ page import="com.egurkha.util.StringUtils"%>

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

<%!
	private int[] getDefinedPercentile(String testName, String measureName) {
		EgTesterInfo testerInfo=new EgTesterInfo("manager");
		EgServicesInfo servicesInfo = new EgServicesInfo("manager");
		String customPercentileName = testerInfo.getCustomPercentileName(testName + ":" + measureName);
		int[] percentile = null;
		if(customPercentileName == null) {
			percentile = servicesInfo.getDefaultPercentileForCapacity();
		} else {
			percentile = servicesInfo.getPercentileForCapacity(customPercentileName);
			if(percentile == null) {
				percentile = servicesInfo.getDefaultPercentileForCapacity();
			}
		}
		return percentile;
	}
	private static final String BLANK_SPACE = " ";
	private static final String COMA = ",";
	private static final String COLON = ":";
	private static final String UTF_8 = "UTF-8";
%>
<%
try
{
	
	String strManagerURL = request.getScheme()+"://"+request.getServerName()+":"+ request.getServerPort();
    List list = new LinkedList();		//Add List of Data
	Vector v_measure_csv = new Vector();	//User ColumnName
	List list_data = new LinkedList();	//ColumnData
	Hashtable h_tabrc = new Hashtable();	//SubTable Data
	Hashtable h_tab = new Hashtable();	//SunTitle with SubTable Data
	String s_title = "";
	String s_iniFile_dir = EgInstallInfo.getInstallDir()+ "/manager/config/";
	EgDbInfo dbInfo = new EgDbInfo("manager");
	ErReqData erd = new ErReqData(request);
	EgReportInfo reportInfo = new EgReportInfo("manager");
	EgTablesInfo tablesInfo = new EgTablesInfo ("manager");
	ErInfo erInfo = new ErInfo();
	EgMappingInfo intlmap = null;
	if(thisuser !=null)
	{
		intlmap = new EgMappingInfo(thisuser.getLanguage());
	}
	com.eg.EgTopoInfo topoInfo = new com.eg.EgTopoInfo("manager");
	User this_user = UserRegistry.getInstance().getUser(session.getId());
	ErUserData erdata = new ErUserData(UBean.getUserId(),false);
	ErComponentsUtils compUtil = new ErComponentsUtils(thisuser.getLoginID());
	EgCrawler crawlerBean = new EgCrawler(new IniFile(s_iniFile_dir + "eg_topology.ini"));
	ErReportHelper erh = new ErReportHelper();
	String sample = request.getParameter("sample");
	String drilldownenabled = request.getParameter("drilldownenabled");
	String selectedGroup = request.getParameter("select_group");
	String er_site = request.getParameter("er_site");
	String uiFile = "eg_ui.ini";
	com.eg.IniFile egUI = new com.eg.IniFile(s_iniFile_dir + uiFile);
	String currentDateFormat = strUserDateFormat;
	String s_st_time  = request.getParameter("startdate");
	String s_en_time  = request.getParameter("enddate");
	String s_st_hr    = request.getParameter("starthr");
	String s_en_hr    = request.getParameter("endhr");
	String strmin     = request.getParameter("startmin");
	String enmin      = request.getParameter("endmin");
	String pdfPrint = request.getParameter("pdfPrint");
	String throughschedule = request.getParameter("throughSchedule");
	String s_comptype = request.getParameter("er_comptype");
	String excludeweekend = request.getParameter("er_excwe");
	String eruserid = request.getParameter("eruserid");
	if (excludeweekend == null || excludeweekend.equals("")) {
		excludeweekend = "Yes";
	}
	String fontStyleDblSingl = "";
	String s_site = "";
	String s_component = "";
	Vector v_site = new Vector();
	Vector v_comptype = new Vector();
	Vector temp_component = new Vector();
	Vector unique_component = new Vector();
    String Days = (erh.getExcludeWeekends("EXCLUDE_WEEKEND","Days") == null) ? 
			"Saturday,Sunday" : erh.getExcludeWeekends("EXCLUDE_WEEKEND","Days");
	
  if(sample == null)
	{
		sample = "no";
	}
	Map resultMap = (Map) session.getAttribute("SYSTEM_CAPACITY_REPORT");
	
	if((dbInfo.doubleByteEnabled || !thisuser.getLanguage().equals("en_US")) && !(pdfPrint !=null && pdfPrint.equalsIgnoreCase("yes") || (sample != null && !sample.equalsIgnoreCase("yes") && drilldownenabled !=null && drilldownenabled.equalsIgnoreCase("yes"))))
	{
		fontStyleDblSingl = "multi_font";
	}
	else
	{
		fontStyleDblSingl = "";
	}
	String isSubmit = request.getParameter("isSubmit");
	boolean noDataFound = false;
	String er_type = null;
	if(resultMap != null )
	{
		Boolean noData = ((Boolean) resultMap.get("NO_DATA_FOUND"));
		if(noData != null)
			noDataFound = noData.booleanValue();
		er_type = (String)resultMap.get("er_type");
	}

	Vector v_component = new Vector();
	if(selectedGroup.equalsIgnoreCase("Zone"))
	{
		List v_siteList = compUtil.getUserZones();
		if(v_siteList!=null && v_siteList.size()>0)
		{
			v_site.addAll(v_siteList);
		}
		if(!v_site.contains("--Default--"))
			v_site.insertElementAt("--Default--",0);
		s_site = request.getParameter("er_site");
		temp_component = new Vector(compUtil.getTypeModifyComponents(compUtil.getZoneComponents(s_site,true),2));
		for(int i=0;i<temp_component.size();i++)
		{
			String temp = (String)temp_component.get(i);
			String tempStr = temp.substring(0,temp.lastIndexOf(COLON));
			String compName = temp.substring(temp.indexOf(COLON)+1,temp.lastIndexOf(COLON));
			if(compName.indexOf(COLON)>-1)
			{
				tempStr = tempStr.substring(0,tempStr.lastIndexOf(COLON));
				if(!unique_component.contains(tempStr))
				{
					unique_component.add(tempStr);
					v_component.add(temp);
				}
			}
			else
			{
				if(!unique_component.contains(tempStr))
				{
					unique_component.add(tempStr);
					v_component.add(temp);
				}
			}
		}
	}
	else if(selectedGroup.equalsIgnoreCase("Service"))
	{
		v_site = compUtil.getUserServices(true);
		s_site = request.getParameter("er_site");
		temp_component = compUtil.getTypeModifyComponents(compUtil.getServiceComponents(s_site),2);
		for(int i=0;i<temp_component.size();i++)
		{
			String temp = (String)temp_component.get(i);
			String tempStr = temp.substring(0,temp.lastIndexOf(COLON));
			String compName = temp.substring(temp.indexOf(COLON)+1,temp.lastIndexOf(COLON));
			if(compName.indexOf(COLON)>-1)
			{
				tempStr = tempStr.substring(0,tempStr.lastIndexOf(COLON));
				if(!unique_component.contains(tempStr))
				{
					unique_component.add(tempStr);
					v_component.add(temp);
				}
			}else
			{
				if(!unique_component.contains(tempStr))
				{
					unique_component.add(tempStr);
					v_component.add(temp);
				}
			}
		}
	}
	else if(selectedGroup.equals("Segment"))
	{
		v_site = compUtil.getUserSegments();
		s_site = request.getParameter("er_site");
		if(s_site != null) {
			temp_component = compUtil.getTypeModifyComponents(compUtil.getSegmentComponents(s_site),2);
			for(int i=0;i<temp_component.size();i++)
			{
				String temp = (String)temp_component.get(i);
				String tempStr = temp.substring(0,temp.lastIndexOf(COLON));
				String compName = temp.substring(temp.indexOf(COLON)+1,temp.lastIndexOf(COLON));
				if(compName.indexOf(COLON)>-1)
				{
					tempStr = tempStr.substring(0,tempStr.lastIndexOf(COLON));
					if(!unique_component.contains(tempStr))
					{
						unique_component.add(tempStr);
						v_component.add(temp);
					}
				}else
				{
					if(!unique_component.contains(tempStr))
					{
						unique_component.add(tempStr);
						v_component.add(temp);
					}
				}
			}
		}
	}
	String er_RmDispName = request.getParameter("er_RmDispName");
	String option = request.getParameter("option");
%>
<!Doctype html>
<head>
<%
	if(pdfPrint !=null && pdfPrint.equalsIgnoreCase("yes"))
	{
%>
	<title>&nbsp; <egui:intnl text="reporter.common.Reporter" />
	&nbsp; &nbsp; <egui:intnl text="reporter.common.Print" /> &nbsp;</title>
<%
	}
	else
	{
%>
	<title>&nbsp; <egui:intnl text="reporter.common.Reporter" />
	&nbsp; &nbsp;</title>
<%
	}
%>


<meta name="Author" content="">
<meta  charset="UTF-8">
<link rel="stylesheet" type="text/css" href="/final/reporter/styles/printpagestyle.css" />
<link rel="stylesheet" type="text/css" href="/final/styles/eGLightThemeIcons.css" />
<script language="JavaScript1.2" src="../reporter/scripts/er_imagesLite.js"></script>
<script src="/final/scripts/DD_roundies_0.0.2a-min.js"  type='text/javascript'></script>
<style>
.newimg {page-break-inside: avoid} 
#newimg {page-break-inside: avoid} 
</style>


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

<script>
	function closeParentWindow()
	{
		if(window.parent.Ext.getCmp('maximizeDataWindowLightBox')!=undefined)
			window.parent.Ext.getCmp('maximizeDataWindowLightBox').doClose();
		else if(window.parent.Ext.getCmp('popupprint')!=undefined)
			window.parent.Ext.getCmp('popupprint').doClose(); 
		else if(window.parent.Ext.getCmp('maximizeWindowLightBox')!=undefined)
			window.parent.Ext.getCmp('maximizeWindowLightBox').doClose(); 
	}
	function saveInCSVFormat()
	{
		window.location.href="../servlet/egurkha.reporter.SaveInCSVFormat","CSVFormat","width=1012,height=603,left=0,top=105,scrollbars=1,scrollbars=yes,resizable=yes";
	}
</script>

</head>
<!--<body  style="padding:10px;background-color:#ffffff">-->
<body marginwidth="20" marginheight="20" bgcolor="#FFFFFF">

<%
			if(option == null || !"data".equalsIgnoreCase(option))
			{
				String strLogCls = "printHeaderBoxLogo";
				if(pdfPrint !=null && pdfPrint.equalsIgnoreCase("yes"))
				{
					strLogCls = "printHeaderBoxLogo";
				}
				else
					strLogCls = "printPdfHeaderBoxLogo";
				if(pdfPrint !=null && pdfPrint.equalsIgnoreCase("yes"))
				{
%>
					<div class="<%=strLogCls%>" style="float:right;margin-top:10px"><img src="<%=imageName%>" border="0" /></div>
<%
				}
				else
				{
%>
					<div class="<%=strLogCls%>" style="float:right"><img src="<%=imageName%>" border="0" /></div>
<%
				}
%>
			<div class="printHeaderBox">
<%
	if (!StringUtils.isNull(er_RmDispName)){
	       list.add(er_RmDispName); 
%>
						<div class="printHeaderBoxTitle" style="float:left"><%= er_RmDispName %></div>
<%
	} else {
	       list.add(intlmap.getTextDescription("reporter.common.SYSTEM CAPACITY REPORT")); 
	%>
		<div class="printHeaderBoxTitle" style="float:left"><egui:intnl text="reporter.common.SYSTEM CAPACITY REPORT "/></div>
					

<%
	}
     	String timePeriodLbl = intlmap.getTextDescription("reporter.common.Time Period");
		String timeLineLbl = intlmap.getTextDescription("reporter.common.Timeline");
		String fromLbl = intlmap.getTextDescription("reporter.common.From");
		String toLbl = intlmap.getTextDescription("reporter.common.To");
		String compLbl = intlmap.getTextDescription("reporter.capacity.Component");
		String systemLbl = intlmap.getTextDescription("reporter.capacity.System");
    if(excludeweekend.equalsIgnoreCase("Yes") )
		{
			list.add('"'+timePeriodLbl+":"+fromLbl+" "+request.getParameter("timefrom")+":"+request.getParameter("minfrom")+intlmap.getTextDescription("reporter.common.Hrs")+" "+toLbl+" "+request.getParameter("timeto")+":"+request.getParameter("minto")+intlmap.getTextDescription("reporter.common.Hrs")+'"'+","+'"'+
			intlmap.getTextDescription("reporter.common.Exclude weekends")+":"+Days+'"');
		}
		else
		{
			list.add(timePeriodLbl+":"+fromLbl+" "+request.getParameter("timefrom")+":"+request.getParameter("minfrom")+intlmap.getTextDescription("reporter.common.Hrs")+" "+toLbl+" "+request.getParameter("timeto")+":"+request.getParameter("minto")+intlmap.getTextDescription("reporter.common.Hrs"));
		}




	if(pdfPrint !=null && pdfPrint.equalsIgnoreCase("yes"))
	{
%>
						<div class="printHeaderBoxPrintIcon" style="float:left"><img class="iconPrinter mouse"  id="prin tbt" src="data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" border="0" onClick="javascript:print()" alt='<egui:intnl text="reporter.common.PRINT"/>' title='<egui:intnl text="reporter.common.PRINT"/>'/></div>
<%
	}
%>
			</div>


<%
	EgTimeZoneConverter converterStart =new   EgTimeZoneConverter(s_st_time+" "+s_st_hr+":"+strmin,thisuser);
	String st_dateTime = converterStart.getDateTime()+" "+"hrs ";

	EgTimeZoneConverter converterEnd = new EgTimeZoneConverter(s_en_time+" "+s_en_hr+":"+enmin,thisuser);
	String en_dateTime = converterEnd.getDateTime()+" "+"hrs ";
     
	 Vector v_date = new Vector();
				v_date.add("\""+intlmap.getTextDescription("reporter.common.Start Date")+" : "+st_dateTime+"\"");
				v_date.add("\""+intlmap.getTextDescription("reporter.common.End Date")+" : "+en_dateTime+"\"");
				
				s_title = "";
				list.add(v_date);
	
	String chartType = "Data";
	if(er_type !=null && er_type.equalsIgnoreCase("Yes"))
		chartType = "Graph";

   %>

<div class="printOuterBoxNoBorder">
	<div class="printSelectionFields">Report Type - <span class="bold"><%=chartType%> </span></div>
	<div class="printSelectionFields">Timeline - <span class="bold"><%=st_dateTime%> to <%=en_dateTime%></span></div>
<%
	String heading = " Service - " + s_site;
	if(selectedGroup.equalsIgnoreCase("Component")) {
		heading = " Component Type - " + intlmap.getComponentTypeDescription(s_comptype);
	} else if(selectedGroup.equalsIgnoreCase("Segment")) {
		heading = " Segment - " + s_site;
	}
	else if(selectedGroup.equalsIgnoreCase("Zone")) {
		heading = " Zone - " + s_site;
	}
	list.add(intlmap.getTextDescription("reporter.common.System Capacity Report") +" - "+heading);
%>
		
</div>
	<%
		String printOuterStr = "";
		if(er_type != null && er_type.equalsIgnoreCase("No"))
			printOuterStr = "printOuterBox";
	%>
 <div class=<%= printOuterStr %>>
	<div class="printOuterBoxHeader"><egui:intnl text="reporter.common.System Capacity Report" />&nbsp; - <%= heading %></div>
<%}%>
<%
	String cpuUtilization = null;
	String freeMemoryAvailable = null;
	String diskspaceUsage = null;
	String diskBusy = null;
	String networkAvailability = null;
	EgSpecsInfo specsInfo = new EgSpecsInfo("manager");
	Vector v_test = new Vector();
	Map measureNameMap = new HashMap();
	Map measureCheckMap = new HashMap();
	Map testMeasureKeyMap = new HashMap();
	
	List measureList = new ArrayList();
	String measureOrder = reportInfo.getValue("SYSTEM_CAPACITY", "MeasureOrder");
	StringTokenizer measureOrderToken = new StringTokenizer(measureOrder, ",");
	while(measureOrderToken.hasMoreTokens())
	{
		String measure = measureOrderToken.nextToken();
		measureList.add(measure);
	}
	for(int i=0;i<measureList.size();i++)
	{
		String iniKey=(String)measureList.get(i);
		String testData = reportInfo.getValue("SYSTEM_CAPACITY",iniKey);
		StringTokenizer strtok = new StringTokenizer(testData, ",");
		while(strtok.hasMoreTokens())
		{
			String testAndMeasure = strtok.nextToken();
			String test = testAndMeasure.substring(0, testAndMeasure.indexOf(COLON));
			boolean isSelectedTest = false;
			if(selectedGroup.equalsIgnoreCase("Component"))
			{
				isSelectedTest = specsInfo.isTestRelevantForServer(s_comptype, test, false);
				if(isSelectedTest)
				{
					v_test.add(testAndMeasure);
					String measureName = reportInfo.getValue("SYSTEM_CAPACITY", iniKey+"_Title");
					String measure_Check = reportInfo.getValue("SYSTEM_CAPACITY",iniKey+"_Check");
					measureNameMap.put(testAndMeasure, measureName);
					measureCheckMap.put(testAndMeasure,measure_Check);
					testMeasureKeyMap.put(testAndMeasure,iniKey);
				}
			}
			else
			{	
				for(int j=0; j<v_component.size(); j++)
				{
					String component = (String)v_component.get(j);
					String compType = component.substring(0, component.indexOf(COLON));
					isSelectedTest = specsInfo.isTestRelevantForServer(compType, test, false);
					if(isSelectedTest)
					{
						if(!v_test.contains(testAndMeasure))
						{
							v_test.add(testAndMeasure);
							String measureName = reportInfo.getValue("SYSTEM_CAPACITY", iniKey+"_Title");
							String measure_Check = reportInfo.getValue("SYSTEM_CAPACITY",iniKey+"_Check");
							measureNameMap.put(testAndMeasure, measureName);
							measureCheckMap.put(testAndMeasure,measure_Check);
							testMeasureKeyMap.put(testAndMeasure,iniKey);
						}
					}
				}
			}
		}
	}
	int[] percentiles;
	String rhs = "";
	String strPercentile = "";
	if(s_comptype!=null && s_comptype.startsWith("Agg_") && selectedGroup.equalsIgnoreCase("Component"))
	{
		v_test = new Vector();
		String aggMeasureOrder = reportInfo.getValue("SYSTEM_CAPACITY", "AggMeasureOrder");
		measureOrderToken = new StringTokenizer(aggMeasureOrder, ",");
		measureList = new ArrayList();
		while(measureOrderToken.hasMoreTokens())
		{
			String measure = measureOrderToken.nextToken();
			measureList.add(measure);
		}
		for(int j=0;j<measureList.size();j++)
		{
			String iniKey=(String)measureList.get(j);
			String testData = reportInfo.getValue("SYSTEM_CAPACITY",iniKey);
			StringTokenizer strtok = new StringTokenizer(testData, ",");
			while(strtok.hasMoreTokens())
			{
				String testAndMeasure = strtok.nextToken();
				String test = testAndMeasure.substring(0, testAndMeasure.indexOf(COLON));
				boolean isSelectedTest = false;
				if(selectedGroup.equalsIgnoreCase("Component"))
				{
					isSelectedTest = specsInfo.isTestRelevantForServer(s_comptype, test, false);
					if(isSelectedTest)
					{
						String measureTiteleKey = iniKey.substring(3);
						String measureName = reportInfo.getValue("SYSTEM_CAPACITY", measureTiteleKey+"_Title");
						String measure_Check = reportInfo.getValue("SYSTEM_CAPACITY",measureTiteleKey+"_Check");
						String replaceTestName = reportInfo.getValue("SYSTEM_CAPACITY", measureTiteleKey);
						measureNameMap.put(testAndMeasure, measureName);
						v_test.add(replaceTestName);
						measureCheckMap.put(testAndMeasure,measure_Check);
						testMeasureKeyMap.put(testAndMeasure,measureTiteleKey);
					}
				}
			}
		}
	}
	boolean isSummaryOnly = false;
	String summaryOnly = reportInfo.getValue("SYSTEM_CAPACITY","SummaryOnly");
	if(summaryOnly != null && summaryOnly.equalsIgnoreCase("yes"))
		isSummaryOnly = true;
	
	String systemTest = "SystemTest";
	String greaterThan = ">";
	if(selectedGroup.equals("Component"))
	{
		String[] selectedComps = request.getParameterValues("er_component");
		if(selectedComps==null)
		{
			selectedComps = (String[]) session.getAttribute("selectedCompArrayForPrint");
		}
		List componentList = Arrays.asList(selectedComps);
		v_component.clear();
		v_component.addAll(componentList);
	}
	Collections.sort(v_component);
	
	if(!noDataFound)
	{
		if(option != null && "data".equalsIgnoreCase(option))
		{
			LinkedHashMap timeAndDataMap = new LinkedHashMap();
			HashMap reportData=(HashMap)session.getAttribute("SYSTEM_CAPACITY_REPORT");
			ErSystemCapacityReportBean appBean = new ErSystemCapacityReportBean();
			List lst =appBean.createDataForCSV(reportData,request);
			session.setAttribute("list_drilldown",lst);
%>
				<div class="printHeaderBox">
							<%if (!StringUtils.isNull(er_RmDispName)){
						%>

								<div class="printHeaderBoxTitle"><%= er_RmDispName %></div>
						<%
							} else {
						%>
								<div class="printHeaderBoxTitle" style="float:left"><egui:intnl text="reporter.common.SYSTEM CAPACITY REPORT "/></div>

						<%
							}
						%>
					<div style="float:right;margin:0px 5px 0px 5px"><img class="mouse" src="/final/images/Light/newPopupWindowClose.png" border="0" onclick="javascript:closeParentWindow();" /></div>
					<div style="float:right;margin:0px 5px 0px 5px;width:2px;height:16px" class="newLineRight"></div>
					<div style="float:right;margin:0px 5px 0px 5px"><img class="iconCsv mouse" src="data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" border="0" onclick="javascript:saveInCSVFormat();" alt='<egui:intnl text="reporter.common.CSV"/>' title='<egui:intnl text="reporter.common.CSV"/>'/></div>
					<div style="float:right;margin:0px 5px 0px 5px"><img class="iconPrinter mouse" src="data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" border="0" onClick="javascript:print();" alt='<egui:intnl text="reporter.common.PRINT"/>' title='<egui:intnl text="reporter.common.PRINT"/>'/></div>
				</div>
				<%
					EgTimeZoneConverter converterStart =new   EgTimeZoneConverter(s_st_time+" "+s_st_hr+":"+strmin,thisuser);
					String st_dateTime = converterStart.getDateTime()+" "+"hrs ";

					EgTimeZoneConverter converterEnd = new EgTimeZoneConverter(s_en_time+" "+s_en_hr+":"+enmin,thisuser);
					String en_dateTime = converterEnd.getDateTime()+" "+"hrs ";

					Vector v_date = new Vector();
					v_date.add("\""+intlmap.getTextDescription("reporter.common.Start Date")+" : "+st_dateTime+"\"");
					v_date.add("\""+intlmap.getTextDescription("reporter.common.End Date")+" : "+en_dateTime+"\"");

					s_title = "";
					list.add(v_date);

					String chartType = "Data";
					if(er_type !=null && er_type.equalsIgnoreCase("Yes"))
					chartType = "Graph";
				%>
		<div class="printOuterBoxNoBorder">
			<div class="printSelectionFields">Report Type - <span class="bold"><%=chartType%> </span></div>
			<div class="printSelectionFields">Timeline - <span class="bold"><%=st_dateTime%> to <%=en_dateTime%></span></div>
		</div>
			<%
				Map chartData = (Map) resultMap.get("chartData");
				String graphParam = request.getParameter("graphParam");
				if(graphParam != null && graphParam.indexOf("_data") > -1)
				{
					graphParam=graphParam.substring(0,graphParam.indexOf("_data"));
				}
				if(chartData != null && chartData.size() > 0)
				{
			%>
				<div class="printOuterBox">
					<div class="printOuterBoxHeader" style="padding:0px">
						<%=graphParam%>
					</div>
					<div class="newTable" style="padding-top:10px">
						<table align="center" style="width:100%" cellspacing="0" cellpadding="0" border="0">
							<thead>
								<tr>
									<th style="text-align:center;" align="center" valign="middle">
										<b>
											<egui:intnl text="reporter.common.Date"/>
										</b>
									</th>
									<%
										List comList = new ArrayList();
										if(graphParam != null)
										{
											comList.add(graphParam);
										}
										else
										{
											comList.add(chartData.keySet());
										}
										if(comList != null && comList.size() > 0)
										{
											for(int i=comList.size()-1;i>=0;i--)
											{
												String server = (String)comList.get(i);
												JSONObject chartJsonObj = (JSONObject)chartData.get(server);
												JSONArray dataSetAry = (JSONArray)chartJsonObj.get("DataSet");
												JSONArray xAxisLabelAry = (JSONArray)chartJsonObj.get("xAxisLabel");
												for(int lp=0;lp<dataSetAry.size();lp++)
												{
													JSONObject dataSetObj = (JSONObject)dataSetAry.get(lp);
													JSONArray dataArry=(JSONArray)dataSetObj.get("data");
													String name=(String)dataSetObj.get("name");
												%>
													<th style="text-align:center;" align="center" valign="middle"><b><%=name%></b> </th>
													<%
													for(int d=0;d<dataArry.size();d++)
													{
														JSONObject dataObj = (JSONObject)dataArry.get(d);
														double data=(Double)dataObj.get("y");
														if(timeAndDataMap.containsKey(xAxisLabelAry.get(d)))
														{
															String value = (String)timeAndDataMap.get(xAxisLabelAry.get(d));
															String newVal = value + ","+data;
															timeAndDataMap.put(xAxisLabelAry.get(d), newVal);
														}
														else
														{
															timeAndDataMap.put(xAxisLabelAry.get(d), data+"");
														}
													%>
													<%}%>
												<%}
											}
										}
										%>
										
								</tr>
							</thead>
							<tbody>
								<%
									if(timeAndDataMap != null && timeAndDataMap.size() > 0)
									{
										Iterator itr = timeAndDataMap.entrySet().iterator();
										while(itr.hasNext())
										{
											Map.Entry enrty = (Map.Entry)itr.next();
											String date = (String)enrty.getKey();
										%>
										<tr>
											<td style="text-align:center;"><%=date%></td>
											<%
												String value = (String)enrty.getValue();
												if(value != null && value.indexOf(",") > -1)
												{
													StringTokenizer valueTokens = new StringTokenizer(value,",");
													while(valueTokens.hasMoreTokens())
													{
											%>
														<td style="text-align:center;"><%=valueTokens.nextToken()%></td>
													<%}
												}
												else
												{
												%>
													<td style="text-align:center;"><%=value%></td>
												<%}
											%>
										</tr>
										<%}
									}%>
							</tbody>
						</table>
					</div>
				</div>
				<%}
				else
				{%>
					<table align="center" width="97%" cellspacing="0" cellpadding="4"   border="0">
						<tr>
							<table width='100%' height='100%'><tr><td align='center' valign='middle'><img src='../images/Light/nomeasures_custom.png' /></td></tr></table>
						</tr>
					</table>
				<%}%>
<%		}
		else
		{
		if(er_type != null && er_type.equalsIgnoreCase("No"))
		{
			%>
		<div class="newTable">
		<table width="100%" border="0" cellpadding="0" cellspacing="0">
			<thead><tr>
				<th class="printTableHeader" rowspan="2"><egui:intnl text="reporter.capacity.System" /></th>
				<%
					list_data = new LinkedList();
					v_measure_csv = new Vector();
					h_tabrc = new Hashtable();
					h_tab = new Hashtable();
					v_measure_csv.add(intlmap.getTextDescription("reporter.capacity.Component"));
					boolean descriptorAvail = false;
					for(int k=0;k<v_test.size();k++)
					{
						descriptorAvail = false;
						String temStrTest = (String)v_test.get(k);
						String test = temStrTest.substring(0,temStrTest.indexOf(COLON));
						String testMeasure = temStrTest.substring(temStrTest.indexOf(COLON)+1);
						if(test.indexOf("_")>-1)
						{
							continue;
						}
						String measureTitle = (String)measureNameMap.get(temStrTest);
						String measureUnit  = tablesInfo.getUnitForMeasure(test,testMeasure);
							
							String service =null;
							Vector infos = null;
							for(int j=0; j<v_component.size(); j++)
							{
								String componentType = "";
								String tempCompType = (String)v_component.get(j);
								String selectedComp = tempCompType.substring(0, tempCompType.indexOf(COLON));
								if(!selectedGroup.equalsIgnoreCase("Component"))
								{
									componentType = tempCompType.substring(tempCompType.indexOf(COLON)+1);
									componentType = componentType + COLON + tempCompType.substring(0,tempCompType.indexOf(COLON));
								}
								else
								{
									componentType = tempCompType;
								}
								
								infos = erInfo.getInfosForTest(service,test,componentType);
								
								if(infos.size()>0 && !infos.contains("+"))
								{
									descriptorAvail = true;
									break;
								}
							}
				%>
					<th class="printTableHeader" colspan="4"> <%= measureTitle + " -"+ measureUnit %></th>
			<%			
						if((isSummaryOnly && systemTest.equalsIgnoreCase(test)) || !descriptorAvail)
						{
							
							v_measure_csv.add(measureTitle + " - "+ measureUnit);
							v_measure_csv.add("");
							v_measure_csv.add("");
							
						}
						else
						{
							
							v_measure_csv.add(measureTitle + " - "+ measureUnit);
							v_measure_csv.add("");
							v_measure_csv.add("");
							v_measure_csv.add("");
						}
					}
				%>
			</tr><tr>
				<%	
					list_data.add("");

					
					Hashtable infoTable  = new Hashtable();

					for(int i =0; i<v_test.size();i++)
					{
						descriptorAvail = false;
						String tempStrTest = (String)v_test.get(i);
						String test = tempStrTest.substring(0,tempStrTest.indexOf(COLON));
						String measure = tempStrTest.substring(tempStrTest.indexOf(COLON)+1);
						String measureUnit = tablesInfo.getUnitForMeasure(test,measure);
						percentiles = getDefinedPercentile(test,measure);
						rhs = reportInfo.getValue("CAPACITY_PLANNING",test+ COLON +measure);
						if(rhs == null || rhs.length() == 0){
							rhs = "MAX";
						}
						if("MP".equalsIgnoreCase(rhs)){
							rhs = "MIN";
						}else{
							rhs = "MAX";
						}
						String percentile = (rhs.equals("MAX") ? String.valueOf(percentiles[1]) : String.valueOf(percentiles[0]));
						
						String service =null;
						Vector infos = null;
						for(int j=0; j<v_component.size(); j++)
						{
							String componentType = "";
							String tempCompType = (String)v_component.get(j);
							if(!selectedGroup.equalsIgnoreCase("Component"))
							{
								componentType = tempCompType.substring(tempCompType.indexOf(COLON)+1);
								componentType = componentType + COLON + tempCompType.substring(0,tempCompType.indexOf(COLON));

							}
							else
							{
								componentType = tempCompType;
							}
							//componentType = componentType.substring(componentType.indexOf("#")+1);
							infos = erInfo.getInfosForTest(service,test,componentType);
							if(infos.size()>0 && !infos.contains("+"))
								descriptorAvail = true;
						
						}
						infoTable.put(test,new Boolean(descriptorAvail));
						
						if((isSummaryOnly && systemTest.equalsIgnoreCase(test)) || !descriptorAvail)
						{
							//list_data.add(intlmap.getTextDescription("reporter.cpacity.Descriptor"));
							list_data.add(percentile+intlmap.getTextDescription("reporter.cpacity.th Percentile"));
							list_data.add(intlmap.getTextDescription("reporter.cpacity.Avg"));
							list_data.add(intlmap.getTextDescription("reporter.cpacity.Current"));
	%>
						<th class="subHeader" colspan="2"><%= percentile %><egui:intnl text = "reporter.capcity.th"/><egui:intnl text="reporter.common.%tile"/></th>
						<th class="subHeader"> <egui:intnl text ="reporter.cpacity.Avg"/> </th>
						<th class="subHeader"> <egui:intnl text ="reporter.cpacity.Current"/></th>
	<%
							
						}
						else
						{
							list_data.add(intlmap.getTextDescription("reporter.cpacity.Descriptor"));	list_data.add(percentile+intlmap.getTextDescription("reporter.cpacity.th Percentile"));
							list_data.add(intlmap.getTextDescription("reporter.cpacity.Avg"));
							list_data.add(intlmap.getTextDescription("reporter.cpacity.Current"));
	%>
						<th class="subHeader"><egui:intnl text = "reporter.capcity.Descriptor"/> </th>
						<th class="subHeader"><%= percentile %><egui:intnl text = "reporter.capcity.th"/><egui:intnl text="reporter.common.%tile"/></th>
						<th class="subHeader"> <egui:intnl text ="reporter.cpacity.Avg"/> </th>
						<th class="subHeader"> <egui:intnl text ="reporter.cpacity.Current"/></th>
	<%
						}
					}
	%>
		
		</tr></thead><tbody>
	<%
			
			String tdClass = "";
			Collections.sort(v_component,String.CASE_INSENSITIVE_ORDER);
			for(int i = 0; i < v_component.size(); i++)
			{
				String compStr = (String)v_component.get(i);
				String component = "";
				String compType = "";
				if(selectedGroup.equals("Component")) {
					compType = compStr.substring(compStr.lastIndexOf(COLON)+1);
					component = compStr.substring(0,compStr.indexOf(COLON));
				} else {
					component = compStr.substring(compStr.indexOf(COLON)+1,compStr.lastIndexOf(COLON));
					if(component.indexOf(COLON) != -1)
						component = component.substring(0,component.indexOf(COLON));
					compType = compStr.substring(0,compStr.indexOf(COLON));
				}
				
				compType = intlmap.getComponentTypeDescription(compType);
				boolean isInfosAvail = true;
				boolean initialFalg = true;
				boolean isSameComponent = true;
				int count = 0;
				s_site = null;
				String previousComp = "";
				int infoCount = 0;
				String strTemp = (String)resultMap.get(component+COLON+"rowSpan");
				if(strTemp != null) {
					infoCount = Integer.parseInt(strTemp);
				}
				Boolean valuesAvailable = (Boolean)resultMap.get(component);
				boolean isValuesAvailable = false;
				if(valuesAvailable != null)
					isValuesAvailable = valuesAvailable.booleanValue();
				if(!isValuesAvailable)
					continue;
				if(i == 0 && !tdClass.equalsIgnoreCase("tdborder")){
					tdClass = "tdborder";
				}else if( i % 2 ==  0 && !tdClass.equalsIgnoreCase("tdborder")){
					tdClass = "tdborder";
				}else if(!tdClass.equalsIgnoreCase("tdborder2")){
					tdClass = "tdborder2";
				} else {
					tdClass = "tdborder";
				}

	%>
				<tr>
					<td valign="center" rowspan='<%= infoCount %>' style="border-right:1px solid #cdcdcd;"><b>  <%= component %> </b> </td>
	<%
				while(isInfosAvail)
				{
					isInfosAvail = false;
					if(count == 0)
					{
						list_data.add(component);
					}
					else
					{
						list_data.add("");
					}
				
					if(!isSameComponent)
					{
	%>
				</tr><tr>
	<%
					}
					String majorColor=reportInfo.getValue("SYSTEM_CAPACITY","Major");
					String criticalColor=reportInfo.getValue("SYSTEM_CAPACITY","Critical");
					for( int j=0; j<v_test.size(); j++)
					{
						descriptorAvail = false;
						String tempStr = (String)v_test.get(j);
						String tempTest = tempStr.substring(0,tempStr.indexOf(COLON));
						String tempMeasure = tempStr.substring(tempStr.indexOf(COLON)+1);
						String tempStrMax = "";
						String tempStrAvg = "";
						String tempStrCurrent = "";
						String temprhs = reportInfo.getValue("CAPACITY_PLANNING",tempTest+ COLON +tempMeasure);

						if(temprhs == null || temprhs.length() == 0){
							temprhs = "MAX";
						}
						if("MP".equalsIgnoreCase(temprhs)){
							temprhs = "MIN";
						}else{
							temprhs = "MAX";
						}
						tempMeasure = dbInfo.getColumnForMeasure(tempTest, tempMeasure);
						
						List infoList = null;
						infoList = (ArrayList)resultMap.get(component+COLON+tempTest);
						if(infoList == null) {
							infoList = new ArrayList();
						}
						String desc = "";
						if(infoList.size() > 0)
						{
							if(infoList.size() > count)
								desc = (String) infoList.get(count);
							else
								desc = "-";
						}
						else
						{
							infoList = null;
							desc = "-";
						}
										
						if(desc != null)
						{
							tempStrMax = (String)resultMap.get(component+COLON+tempTest+COLON+tempMeasure+"_"+temprhs+COLON+desc+COLON+"minmax");
							tempStrAvg = (String)resultMap.get(component+COLON+tempTest+COLON+tempMeasure+"_"+temprhs+COLON+desc+COLON+"avg");
						   tempStrCurrent = (String)resultMap.get(component+COLON+tempTest+COLON+tempMeasure+"_"+temprhs+COLON+desc+COLON+"current");
							
						}

						if(desc == null)
							desc ="-";
						if(tempStrMax == null || tempStrMax.equals(""))
							tempStrMax= "-";

						if(tempStrAvg == null)
							tempStrAvg = "-";
						
						if(tempStrCurrent==null || "".equals(tempStrCurrent))
							tempStrCurrent="-";
						
						String color = "";
						double tempValue = 0;
						String testMeasureKey = (String)testMeasureKeyMap.get(tempStr);
						String measure_Check = (String)measureCheckMap.get(tempStr);

						if(!tempStrMax.equals("-"))
						{
							tempValue = Double.valueOf(tempStrMax).doubleValue();
						}
						if(!tempStrMax.equals("-"))
						{
							double dataValMin = Double.valueOf(reportInfo.getValue("SYSTEM_CAPACITY",testMeasureKey+"_Major")).doubleValue();
							double dataValMax = Double.valueOf(reportInfo.getValue("SYSTEM_CAPACITY",testMeasureKey+"_Critical")).doubleValue();
							if(measure_Check.equalsIgnoreCase(greaterThan))
							{
								if( tempValue > dataValMax )
									color = criticalColor;
								else if( tempValue > dataValMin )
									color = majorColor;
							}
							else
							{
								if( tempValue < dataValMin )
									color = criticalColor;
								else if( tempValue < dataValMax )
									color = majorColor;
							}
						}
						if(desc.length() > 0)
							desc = desc.substring(desc.indexOf("+")+1);
						if(desc.equals(""))
							desc = "-";
						String tempDesc = reportInfo.getValue("SYSTEM_CAPACITY","RemoveDescriptor");
						String removeTest = tempDesc.substring(0,tempDesc.indexOf(COLON));
						String removeMeasure = tempDesc.substring(tempDesc.indexOf(COLON)+1 , tempDesc.lastIndexOf(COLON));
						String removeDesc = tempDesc.substring(tempDesc.lastIndexOf(COLON)+1);
						if(tempTest.equalsIgnoreCase(removeTest)&& tempMeasure.equalsIgnoreCase(removeMeasure)&& desc.equalsIgnoreCase(removeDesc))
						{
							list_data.add(dbInfo.formatValue("-"));
							list_data.add(dbInfo.formatValue("-"));
							list_data.add(dbInfo.formatValue("-"));
						
	%>
			<td valign="center">-</td>
			<td valign="center">-</td>
			<td valign="center">-</td>
			<td valign="center">-</td>
	<%
							continue;
						}
						Boolean tempVal = (Boolean)infoTable.get(tempTest);
						descriptorAvail = tempVal.booleanValue();
						//if(isSummaryOnly && tempTest.equalsIgnoreCase(tempCpuTest) || tempTest.equalsIgnoreCase(tempMemoryTest))
						if((isSummaryOnly && tempTest.equalsIgnoreCase(systemTest)) || !descriptorAvail)
						{
	%>
		<td valign="center" colspan="2"><div style="background-color: <%= color %>;float:left;padding:2px;"><%= dbInfo.formatValue(tempStrMax) %></div></td>
						<%
						//added for csv starts
							//list_data.add("-");
							list_data.add(dbInfo.formatValue(tempStrMax));
							list_data.add(dbInfo.formatValue(tempStrAvg));
							list_data.add(dbInfo.formatValue(tempStrCurrent));
						//added for csv ends
						}
						else
						{
						%>
		<td valign="center"> <div style="width: 60px; word-wrap: break-word; overflow-x:auto;"><%= desc %></div> </td>
		<td valign="center"><div style="background-color: <%= color %>;float:left;padding:2px;"><%= dbInfo.formatValue(tempStrMax) %> </div></td>
						<%
						//added for csv starts
							list_data.add(desc);
							list_data.add(dbInfo.formatValue(tempStrMax));
							list_data.add(dbInfo.formatValue(tempStrAvg));
					 if(tempStrCurrent==null)tempStrCurrent="-";
						 list_data.add(tempStrCurrent);
						 //added for csv ends
						}
	%>	
		
		
		
			<td valign="center"><%= dbInfo.formatValue(tempStrAvg) %></td>
			<td valign="center"><%= tempStrCurrent %></td>
	<%
						if(infoList == null && !isInfosAvail )
						{
							isInfosAvail = false;
						}
						else if(count == infoCount-1)
						{
							isInfosAvail = false;
						}
						else
						{
							isInfosAvail = true;
						}		
							
					}// test loop
	%>
		</tr>
	<%
						count ++;
						isSameComponent = false;
				}// isinfo loop
			}// component loop
				h_tabrc.put(v_measure_csv,list_data);
				h_tab.put(s_title,h_tabrc);
				list.add(h_tab);
				list_data.add("\n");
				v_measure_csv = new Vector();
				list_data = new LinkedList();
				h_tabrc = new Hashtable();
				h_tab = new Hashtable();
				String majorColor = reportInfo.getValue("SYSTEM_CAPACITY","Major");
				String criticalColor = reportInfo.getValue("SYSTEM_CAPACITY","Critical");
				String legendTextMajor = reportInfo.getValue("SYSTEM_CAPACITY","LegendTextMajor");
				String legendTextCritical = reportInfo.getValue("SYSTEM_CAPACITY","LegendTextCritical");
				v_measure_csv.add("Measurements");
				v_measure_csv.add("Major / "+legendTextMajor);
				v_measure_csv.add("Critical / "+legendTextCritical);
	%>
</tbody></table></div><br/>
	
<div class="newTable">
<table width="100%" border="0" class="printTable" cellpadding="0" cellspacing="0"><col width="30%"><col width="30%"><col width="30%">
		<thead>
		<tr>
		<th class="printTableHeader"><egui:intnl text="reporter.common.Measurements"/></th>
		<th class="printTableHeader">
			<div style="float:left" class="state_footer_INTERMEDIATE"></div><div style="float:left;padding:4px 4px 0px 4px"><egui:intnl text="reporter.common.Major /"/>&nbsp;<%= legendTextMajor %></div>
			</th>
			<th class="printTableHeader">
			<div style="float:left;" class="state_footer_HIGH"></div><div style="float:left;padding:4px 4px 0px 4px"><egui:intnl text="reporter.common.Critical /"/><%= legendTextCritical %></div>
			</th>
		</tr>
		</thead>
		<tbody>
<%
				for(int i =0; i<v_test.size();i++)
				{
					String temStrTest = (String)v_test.get(i);
					String test = temStrTest.substring(0,temStrTest.indexOf(COLON));
					String tempMeasure = temStrTest.substring(temStrTest.indexOf(COLON)+1);
					String measureDispName = (String)measureNameMap.get(temStrTest);
					String measure_Check = (String)measureCheckMap.get(temStrTest);
					String measure_key = (String)testMeasureKeyMap.get(temStrTest);
					String measureUnit  = tablesInfo.getUnitForMeasure(test,tempMeasure);
					list_data.add(measureDispName);
					list_data.add(measure_Check+" "+reportInfo.getValue("SYSTEM_CAPACITY","Measure1_Major")+" "+measureUnit);
					list_data.add(measure_Check+" "+reportInfo.getValue("SYSTEM_CAPACITY","Measure1_Critical")+" "+measureUnit);
%>
		<tr>
			<td align="left" valign="top" ><%= measureDispName %></td>
			
			<td align="center" ><%= measure_Check %>&nbsp;<%= reportInfo.getValue("SYSTEM_CAPACITY",measure_key+"_Major") %>&nbsp;<%= measureUnit %></td>
			<td align="center" ><%= measure_Check %>&nbsp;<%= reportInfo.getValue("SYSTEM_CAPACITY",measure_key+"_Critical") %>&nbsp;<%= measureUnit %></td>
		</tr>
<%
				}
%>
		</tbody>
	</table></div>
<%
		}	
		else if(er_type != null && er_type.equalsIgnoreCase("Yes"))
		{			
			String controllerURL = "../servlet/com.eg.ErSystemCapacityReportC;jsessionid=" + session.getId()+"?";
			Map chartData = (Map)resultMap.get("chartData");
			List comList = new ArrayList(chartData.keySet());
			%>
			<div class="newTable" style="margin-top:10px">
			<table width="100%" border="0px" cellpadding="0" cellspacing="0" style="margin-top:10px;">	
			<tbody>	
			<%
			int comSize = comList.size();
			String width = "450";
			if(comSize==1)
			{
				width = "900";
			}
			boolean flag = false;
			int j = 0;
			for(int i=comSize-1;i>=0;i--)
			{
				String server = (String)comList.get(i);	
				JSONObject chartJsonObj = (JSONObject)chartData.get(server);
				chartJsonObj.put("legend", new Boolean(false));
				chartJsonObj.put("ShowLegendInBottom", "true");
				server = com.eg.EgURLEncoder.encode(server, "UTF-8");
				String PrintURL = controllerURL +"component="+server+"&er_view=print&width="+width+"&height=320";
				Map resultMapaa = (Map) session.getAttribute("SYSTEM_CAPACITY_REPORT");
				if(j%2==0)
				{
					if(j == comSize-1)
					{
						flag = true;
					}
					%><tr class="newimg"><%					
				}
				server = com.eg.EgURLDecoder.decode(server, "UTF-8");
				%>
					<td>
						<div class="printTable" >
						<div class="printOuterBoxHeader"><%=server%></div>
								<div style="padding:10px">
									<img src="<%=PrintURL%>"/>
								</div>
							</div>
						</td>
					<%
					if(j%2 != 0 || flag)
					{
					%>
					</tr>				
				<%
					}
					j++;
			}
			%>
			</tbody>
				</table></div>
			<%
		}
		}
	}// no data found false
else
	{
%>
<div class="newTable">
<table align="center" cellspacing ="0" cellpadding="4" width="100%" border="0" >
	<tr>
		<td class="blankspace" height="10px">&nbsp;</td>
	</tr>
	<tr>
		<!--<td  id="er_submit"  NOWRAP align="center" width="100%" colspan="9"> <egui:intnl text="reporter.common.No measures available for the current selection"/></td>-->
		<table width='100%' height='100%'><tr>	<td align='center' valign='middle'><img src='/images/Light/nomeasures_custom.png' /></td></tr></table>
	</tr>
	<tr>
		<td class="blankspace" height="10px">&nbsp;</td>
	</tr>
</table></div>
<%
	}
%>
<%
	if(pdfPrint != null && pdfPrint.equalsIgnoreCase("yes"))
{%>
		<div class="printFooterText"><%=strPrintFooterText%></div>
	<%
	}
            h_tabrc.put(v_measure_csv,list_data);
			h_tab.put(s_title,h_tabrc);
			list.add(h_tab);
			list_data.add("\n");
			session.setAttribute("ScheduleCSVData",list);
			
	if (!StringUtils.isNull(er_RmDispName)){
		//For Setting the PDf File Name
		er_RmDispName = er_RmDispName.replace(" ","_");
		HashMap paramVal =new HashMap();
		paramVal.put("fileName",er_RmDispName);
		session.setAttribute("parameters", paramVal);
	} else {
		//For Setting the PDf File Name
		HashMap paramVal =new HashMap();
		paramVal.put("fileName","capacity_planning_system");
		session.setAttribute("parameters", paramVal);
	}
}
catch(Throwable t)
{
	t.printStackTrace();
}
%>
</body>
</html>
<%@ include file = "ErRemoveUser.jsp" %>
