developers

    Forum Stats

  • 3,873,629 Users
  • 2,266,619 Discussions
  • 7,911,595 Comments

Discussions

Wrong parameter values while exporting data from jsp to excel

his 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?&nbsp;&nbsp;&nbsp;&nbsp;</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]&nbsp;&nbsp;&nbsp;&nbsp;</label>
</td>
</tr>
<tr>
<td colspan="2"><br><label title="Query Functions">Display Query Only Functions?&nbsp;&nbsp;&nbsp;</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]&nbsp;&nbsp;&nbsp;&nbsp;</label><br>
</td>
</tr>
<tr>
<td colspan="2"><br><label title="Excluded Menus">Display Excluded Menus?&nbsp;&nbsp;&nbsp;</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]&nbsp;&nbsp;&nbsp;&nbsp;</label>


<tr align="right">
<td>
<button onclick="javascript:doSubmit()">
<LABEL>Submit Query</LABEL>
</button>&nbsp;&nbsp;
<button type="reset">
<LABEL>Reset</LABEL>
</button>

Edited by: user10491509 on Mar 15, 2012 7:56 AM

Answers

  • An incomprehensible stream of supposed JSP code, pasted in a forum for Java Errors and Error Handling and it has something to do with HTML readability in Microsoft Excel ?

    Huh ?

    If Excel is giving you an unexpected reaction, then maybe you need to ask Microsoft.


    Moderator Action:
    Locking.
    This post is outside the scope of this forum.
This discussion has been closed.
developers