Wrong parameter values while exporting data from jsp to excel
718851Mar 15 2012 — edited Mar 15 2012his is a jsp report. When i export the report data to an excel, the parameter values on the html report do not match those in the downloaded spreadsheet, specifically, if the parameter value is “All”, it gets translated to “No” in excel.
This is the my jsp code -
<%@ page contentType="text/html;charset=windows-1252"%> <%@ page errorPage="errorPage.jsp" %> <%@ page import="com.dab.dabuilderConstants"%> <% dabuilderConstants cConstants = new dabuilderConstants(); %>
<title><%=cConstants.sHrrchyReport%></title>
<script language="javascript">
errorMessages = new Array();
visibleFlag=false;
i=0;
function doSubmit(){
document.forms[0].submit();
}
function addError(erMsg){
errorMessages[i++] = erMsg;
}
function displayErrors(){
var allMsgs = '';
for(var j=0; j<errorMessages.length; j++){
allMsgs += errorMessages[j];
}
document.getElementById("errorBody").style.visibility = 'visible';
visibleFlag=true;
document.getElementById("msgs").innerHTML=allMsgs;
}
function clearErrors(){
if(visibleFlag==false){
document.getElementById("errorBody").style.visibility='hidden';
}
}
</script>
<% if(paramForm.getErrorMessage()!=null){ String errs=paramForm.getErrorMessage(); %> <% } paramForm.setErrorMessage(null); %> <% String permission=null; String path=session.getServletContext().getRealPath("/"); if(request.getSession().getAttribute("eUserName")!=null){ permission=request.getSession().getAttribute("eUserName")+""; paramForm.test(request.getSession().getAttribute("eUserName")+"",request.getSession().getAttribute("ePassword")+""); paramForm.loadObjects(request.getParameter("reportName")+"",path); }else{ response.sendRedirect("check.jsp"); } %>
<tr>
<td colspan="2"><br><label title="Granted Functions">Display Granted Functions? </label>
<select id="gfns" tabindex="3" property="grantedFns" name="grantedFns">
<option value="All" selected="selected">All</option>
<option value="Yes">Yes</option>
<option value="No">No</option>
</select>
<label title="Granted Menu">[Yes = Display only form functions granted to menus] </label>
</td>
</tr>
<tr>
<td colspan="2"><br><label title="Query Functions">Display Query Only Functions? </label>
<select id="qfns" tabindex="3" property="QueryFns" name="QueryFns">
<option value="All" selected="selected">All</option>
<option value="Yes">Yes</option>
<option value="No">No</option>
</select>
<label title="Query Function"> [Yes = Display only "Query Only" form functions] </label><br>
</td>
</tr>
<tr>
<td colspan="2"><br><label title="Excluded Menus">Display Excluded Menus? </label>
<select id="exmns" tabindex="3" property="exMenus" name="exMenus">
<option value="Yes">Yes</option>
<option value="No">No</option>
<option value="All" selected="selected">All</option>
</select>
<label title="Excluded Menus"> [Yes = Display only excluded menus and functions] </label>
<tr align="right">
<td>
<button onclick="javascript:doSubmit()">
<LABEL>Submit Query</LABEL>
</button>
<button type="reset">
<LABEL>Reset</LABEL>
</button>
Edited by: user10491509 on Mar 15, 2012 7:56 AM