pageOfficeLink在actionk动态打开一个excel


一、判断浏览器,决定是否启用pageOfficeLink

function fillOut()
	{
		var row = dataGrid.datagrid('getSelected');
        if (row) { 
        	if((row.reportStatus !=-4) && (row.reportStatus !=-5))
       		{
        		parent.$.messager.alert("提醒", "请选择未上报的报表!", "info");
       		}
        	else
       		{
        		var url =  "/report/fillOut?reportId=" + row.reportCode + "&taskId=" + row.taskId + "&period=" + row.reportPeriods;
        		var mb = myBrowser(); // 	判断浏览器
        		alert(mb);
        		if(mb != "IE")
        			url =  "/report/pageOfficeLink?reportId=" + row.reportCode + "&taskId=" + row.taskId + "&period=" + row.reportPeriods;
        		$(window.parent.addTab({
					url : url,
					title : "填报报表",
					iconCls : "icon-folder"
				}));
       		}
        }
        else
       	{
        	parent.$.messager.alert("提醒", "您未选择一个报表,请选择!", "info");
       	}
	}

二、写pageOfficeLink action

@RequestMapping("/pageOfficeLink")
	public String pageOfficeLink(HttpSession session,HttpServletRequest request)
	{
		String reportId = request.getParameter("reportId");
		String reportPeriods = request.getParameter("period");
		String taskId = request.getParameter("taskId");
		
		String actionUrl = "/report/fillOut?reportId=" + reportId + "&period=" + reportPeriods + "&taskId=" + taskId;
		String openWindow = null;
		openWindow = PageOfficeLink.openWindow(request,actionUrl,"width=1300px;height=730px;");	
		request.setAttribute("openWindow", openWindow);		
		return "/report/pageOfficeLink";
	}

三、在pgeOfficeLink.jsp写onload函数






新的IE打开后,会跳转到pageOfficeLink action中设置的下一个action



你可能感兴趣的:(java)