• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1760
  • Last Modified:

how to set the number of rows in worksheet book using jxl.jar in jsp

HI,

As I have to show 97,000 rows in excel sheet, have created an excel file with data using jxl.jar file in jsp page  but when downloading this file, am getting the following error: The maximum number of rows permitted on a worksheet been exceeded.

Kindly advice me to solve this issue.
0
czutshi
Asked:
czutshi
  • 5
  • 3
1 Solution
 
ghoshsaikat83Commented:
You have to use Excel 2007
0
 
czutshiAuthor Commented:
Yes. I have installed Excel 2007 but still getting the same error when downloading the excel file .
0
 
ghoshsaikat83Commented:
What is the default save version....
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
czutshiAuthor Commented:
Sorry. I dont know to check it.

Better tell me, how to check the default save version?
0
 
czutshiAuthor Commented:
FYI. Have pasted the download coding here:

<%
String filepath = request.getParameter("filepath");

File myfile = new File(filepath);
if (myfile.exists() && myfile.canRead())
{
String filename = myfile.getName();

int l = myfile.getName().lastIndexOf(".");


if (l >= 0){
    String ext = myfile.getName().substring(l).toLowerCase();
    if (ext.equals(".jpg")||ext.equals(".jpeg")||ext.equals(".jpe"))
      response.setContentType("image/jpeg");
    else if (ext.equals(".gif")) response.setContentType("image/gif");
    else if (ext.equals(".pdf")) response.setContentType("application/pdf");
    else if (ext.equals(".htm")||ext.equals(".html")||ext.equals(".shtml")) response.setContentType("text/html");
    else if (ext.equals(".avi")) response.setContentType("video/x-msvideo");
    else if (ext.equals(".mov")||ext.equals(".qt")) response.setContentType("video/quicktime");
    else if (ext.equals(".mpg")||ext.equals(".mpeg")||ext.equals(".mpe"))
      response.setContentType("video/mpeg");
    else if (ext.equals(".zip")) response.setContentType("application/zip");
    else if (ext.equals(".tiff")||ext.equals(".tif")) response.setContentType("image/tiff");
    else if (ext.equals(".rtf")) response.setContentType("application/rtf");
    else if (ext.equals(".mid")||ext.equals(".midi")) response.setContentType("audio/x-midi");
    else if (ext.equals(".xl")||ext.equals(".xls")||ext.equals(".csv")||ext.equals(".xlv")||ext.equals(".xla")
            ||ext.equals(".xlb")||ext.equals(".xlt")||ext.equals(".xlm")||ext.equals(".xlk"))
      response.setContentType("application/excel");
    else if (ext.equals(".doc")||ext.equals(".dot")) response.setContentType("application/msword");
    else if (ext.equals(".png")) response.setContentType("image/png");
    else if (ext.equals(".xml")) response.setContentType("text/xml");
    else if (ext.equals(".svg")) response.setContentType("image/svg+xml");
      else if (ext.equals(".dwg")) response.setContentType("application/dwg");
    else response.setContentType("text/html");
      if(ext.equals(".gif") || ext.equals(".jpe") ||ext.equals(".jpg")||ext.equals(".jpeg"))
      {
      }
      else
      {
      response.setHeader ("Content-disposition", "attachment;filename=\""+myfile.getName()+"\"");
      }
  }
       response.setContentLength((int) myfile.length());
       BufferedInputStream fileInputStream = new BufferedInputStream(new FileInputStream(myfile));
       int i;
       out.clearBuffer();
       while ((i = fileInputStream.read()) != -1) out.write(i);
       fileInputStream.close();
       out.flush();
%>
<script language ="javascript">
window.close();
</script>
<%
}
%>
0
 
czutshiAuthor Commented:
Here is the coding for creating a excel file based on my requirement

String filename="Project.xls";
            filepath="/home/webdocs/deltekexceldatatransfer/project/"+filename;
            File newfile=new File(filepath);
            WritableWorkbook workbook = Workbook.createWorkbook(newfile);
            WritableSheet sheet = workbook.createSheet("First Sheet",0); // sheet name
            String columnname1[]={"Label","Project","Project Descr","Cpnyid ","PO Nbr","Project Mgr","Customer","Allocation Method","Rate Table ID","Gl Sub Account"};
            String columnname2[]={"Label","Task","Task Description"};


            WritableFont writlefontcolor = new WritableFont(WritableFont.ARIAL);
            WritableCellFormat cellformatdataBlue = new WritableCellFormat(writlefontcolor);      
            cellformatdataBlue.setBackground(Colour.BLUE2);
0
 
ghoshsaikat83Commented:
To check the default save version go to Office Buttion (the one in the top left corner of excel) > Excel Options> Save and then see what version is selected in the 'Save files in this format' drop down list. Turn it to Excel Workbook (*.xlsx) if not already selected.

Joydip
0
 
czutshiAuthor Commented:
HI,
Excel Workbook has been set in the drop down list of 'Save files in this format' in MS Excel2007.
please advcie.
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now