<!-- saved from url=(0022)http://internet.e-mail -->
<%@ page import="jet.cs.util.*, jet.server.api.http.*, jet.web.dhtml.*,
 jet.server.api.*, jet.server.jrc.*, jet.server.jrserver.*, java.util.*, java.lang.*, java.io.*, jet.server.util.ServerUtil" %>
<%@ page errorPage="errorpage.jsp" %>
<%@ include file="AuthCheck.jsp" %>
<html>
<%
	String translate, query;
	PrintWriter pout;
	ServletOutputStream sout;
	HttpRptServer server;
	if (System.getProperty(APIConst.REMOTE_DISPATCHER) == null) {
		server = HttpUtil.getHttpRptServer(); 
	} else {
		server = RemoteDispatcherFactory.getInstance().getDispatchedServer(request);
	}
	SimpleDHtmlAPI service = server.getSimpleDHtmlService();
	HttpUserSessionManager umg = server.getHttpUserSessionManager();
	UserSession us = umg.getUserSession(request);
	
	Hashtable param = HttpUtil.getParameters(request);

	String reportidPrefix= (String)param.get("jrs.report_id_prefix");
	String numOfOpenRptID= (String)param.get("jrs.num_of_opening_rpt");
	try{
	
		//java.util.List rptidList =  service.getReportsId(us.getID());
		//for (int i = 0; i < rptidList.size(); i++){
  	     //System.out.println("reportid:"+(String)rptidList.get(i));
  	//}
  	int numOfOpenRpt = Integer.parseInt( numOfOpenRptID);
  	
  	for( int i = 1; i <= numOfOpenRpt; i++){
  	  
  	  //System.out.println("Remove report id..."+(reportidPrefix+"-"+i));
  	  service.closeDHTMLReport(us.getID(), ""+reportidPrefix+"-"+i);
  	}
  }catch(Exception e){
    e.printStackTrace();
  }
%>

<SCRIPT TYPE="TEXT/JAVASCRIPT" LANGUAGE="JAVASCRIPT">
  window.opener = window;
  window.close();
</SCRIPT>
</html>
