Hi,

I have written coding for coverting jsp page to excel.It is working in IE browser after downloading file is saved with .xls extension .But in firefox browser i am trying to download then it saves with .jsp extension.any one pls help me how to solve this issue?

here is my jsp code------>

exportUser.jsp
<%@page contentType="application/vnd.ms-excel" pageEncoding="UTF-8"%>

<%@ page import="com.zyom.webclient.util.MozartCostUtils,java.util.*,com.zyom.struts.form.AtsRegionsForm,com.zyom.struts.form.MapCustomerForm,com.zyom.reuse.util.DateHandler,com.zyom.webclient.util.MozartConstants"%><%
%><%
%><%@ taglib uri="http://jakarta.apache.org/struts/tags-bean"
    prefix="bean"%><%
 %><%@ taglib uri="http://jakarta.apache.org/struts/tags-html"
    prefix="html"%><%
    %><%@ page buffer="1000kb" autoFlush="false" %>


<html:form action="regionCustUserMap.do">
<div class="autoHeight" style="width:900px;height:1515px;margin-top:10px; margin-bottom:10px;">
<table style="margin-top:0px;"  class="tablesorter" border="0" cellpadding="0" cellspacing="1"> <%-- class="tablesorter" --%>
<thead class="ls">

        <th nowrap="nowrap">Sales Region</th>
        <th width="250">ROLES MAPPED AT REGION LEVEL (ALL EXCEPT SALES ID)</th>
        <th nowrap="nowrap" >Customer</th>
        <th nowrap="nowrap" >Country</th>
        <th nowrap="nowrap" >Sales ID</th>

    </thead>

    <tbody class="ls1">
    <%ArrayList cust_list=(ArrayList)session.getAttribute("cust_list"); 
    for (int i = 0; i < cust_list.size(); i++) {
    MapCustomerForm mcf=(MapCustomerForm)cust_list.get(i);%>
    <TR class="<% if(i%2==0){%><%=""%><%}else{%><%="odd"%><%}%>">
                                <td width="148" nowrap="nowrap">
                                <%=mcf.getRegion()%>
                            </td>



                                <td width="408"  width="40">

                            <%=mcf.getUser_names() %>                    
                            </td>
                            <td width="188" nowrap="nowrap">
                                <%=mcf.getCustomer()%>
                            </td>
                            <td width="148" nowrap="nowrap">
                                <%=mcf.getLocation()%>
                            </td>
                            <td width="98" nowrap="nowrap">
                                <%=mcf.getSalesid()%>
                            </td>
    </tr>
    <%} %>
    </tbody>
</table></div>

        </html:form>
    </body>
</html>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.