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

Posted on 2009-12-17
Last Modified: 2012-08-13

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.
Question by:czutshi
    LVL 5

    Expert Comment

    You have to use Excel 2007

    Author Comment

    Yes. I have installed Excel 2007 but still getting the same error when downloading the excel file .
    LVL 5

    Expert Comment

    What is the default save version....

    Author Comment

    Sorry. I dont know to check it.

    Better tell me, how to check the default save version?

    Author Comment

    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"))
        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"))
        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")
        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"))
          response.setHeader ("Content-disposition", "attachment;filename=\""+myfile.getName()+"\"");
           response.setContentLength((int) myfile.length());
           BufferedInputStream fileInputStream = new BufferedInputStream(new FileInputStream(myfile));
           int i;
           while ((i = != -1) out.write(i);
    <script language ="javascript">

    Author Comment

    Here is the coding for creating a excel file based on my requirement

    String filename="Project.xls";
                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);      
    LVL 5

    Accepted Solution

    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.


    Author Comment

    Excel Workbook has been set in the drop down list of 'Save files in this format' in MS Excel2007.
    please advcie.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    A2 = A1 That kind of cell reference is relative.  If you copy it from A2 to B2, then B2 will get this: B2 = B1 That's all fine and good, but if you then insert a new row above row 2, you'll find: A3 = A1 B3 = B1 This is intentional. …
    Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
    The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
    This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now