<%@ page contentType="text/html; charset=utf-8" %>
<%@ page import="kr.co.hsnc.common.util.*" %>
<%@ page import="kr.co.hsnc.common.config.WAFConfig" %>
<jsp:useBean id="ctx" class="com.udapsoft.waf.system.context.SessionContext" scope="session" />
<%
    ctx.init(request, response);
	ValueObject params = ctx.getParams();

	String PARAMS_STRING = "";
	int pSize = params.getInt("P_SIZE");
	for( int i = 0 ; i < pSize ; i++ ) {
		
		//// 2008.03.31 hsj 수정. 파라미터값 중에서 " 를 포함한 값이 들어있는 경우 \ 추가한다.
		String valParam = params.get("P_" + i );
		int nPos = -1;
		if( (nPos = valParam.indexOf("\"")) >= 0)
		{
			valParam = valParam.replaceAll("\"", "\\\\\"");
		}
		PARAMS_STRING += "[" + valParam + "]";
	}	
%>
<html style="margin:0;height:100%">
	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge"> 
<TITLE><%= params.get("WINDOW_TITLE") %></TITLE>
<HEAD>
<script src="/js/jquery-1.11.0.min.js"></script>
<script src="/js/crownix-viewer.min.js"></script>
<link rel="stylesheet" type="text/css" href="/css/crownix-viewer.min.css">
</HEAD>
<body style="margin:0;height:100%">
		<div id="crownix-viewer" style="position:absolute;width:100%;height:100%"></div>
<SCRIPT language="javascript">
	window.onload = function(){
		var viewer = new m2soft.crownix.Viewer("<%=WAFConfig.get("waf.rd_report.searver")%>", 'crownix-viewer');
		viewer.useAdjustCharacterScale(true);
		viewer.openFile("<%= ctx.getServerDomain() %><%= params.get("REPORT_NAME") %>", '/rf [<%= WAFConfig.get("waf.rd_report.path", "")%>rdagent.jsp] /rsn [<%= WAFConfig.get("waf.rd_report.DataSource", "")%>] /rp <%= PARAMS_STRING %>');
	};
	
</SCRIPT>
</BODY>
</HTML>