Menu

How can I write 1 millions rows data to an excel book ?

Help
linbren
2013-11-07
2016-01-15
  • linbren

    linbren - 2013-11-07

    How can I write 1 millions rows data to an excel book ?
    every sheet was limited to 65535 rows . if write more than 65535 to a sheet , other will be lost.
    Is there any solution?

     
    • David Hoerl

      David Hoerl - 2013-11-07

      Use the new xml format I imagine. The older format supported by this library has a limit of 64K rows - there is nothing to be done about it.

       
    • David Hoerl

      David Hoerl - 2013-11-07

      Use the new xml format I imagine. The older format supported by this library has a limit of 64K rows - there is nothing to be done about it.

       
  • linbren

    linbren - 2013-11-07

    One book multi sheets accept. how to do this ?

     
    • David Hoerl

      David Hoerl - 2013-11-07

      So that would be approximately 20 sheets. Should work but we've never tried to create such a big file. Its easy to create a new sheet - just look at the header files.

       
  • linbren

    linbren - 2013-11-08

    wb = xlsNewWorkbook();
    ws = xlsWorkbookSheet(wb, "sheet1");
    ww = xlsWorkbookSheet(wb, "sheet2");
    for(i=0; i < 65500;i++)
    {
    for(j =0;j<10;j++ )
    {
    if(i < 50000)
    xlsWorksheetLabel(ws,i,j,"0001234",NULL);
    else
    xlsWorksheetLabel(ww,(i-50000),j,"4321",NULL);
    }
    }
    strcpy(str,"test.xls");
    xlsWorkbookDump(wb, str);
    xlsDeleteWorkbook(wb);


    while I use this code dump 65500 to file test.xls .
    we got 50000 rows in sheet1, no data found in sheet2.
    Is there any problem in this code ?

     
  • linbren

    linbren - 2013-11-08

    the attachment is the file generated.

     
  • linbren

    linbren - 2013-11-08

    platform information

    LSB Version: :core-3.0-ia32:core-3.0-noarch:graphics-3.0-ia32:graphics-3.0-noarch
    Distributor ID: CentOS
    Description: CentOS release 4.4 (Final)
    Release: 4.4
    Codename: Final

     
  • David Hoerl

    David Hoerl - 2013-11-08

    You are going to need to spend some of your own time on this - really, you haven't shown that there is any bug, its just that the goal you have of pushing the envelope to the edge of space is not working out of the box.

    So try to create three sheets with three cells in each. Then try more cells. Then try 1000 in each of three sheets. Check any return codes that you find. Once you get three sheets working with some relatively small number of cells, try maxing the first and adding 100 cells to the next. At some point you are going to (I suppose) find a problem. Once you have nailed down a simple to reproduce problem then tell us about it.

    Yes, I know - this takes time. Well, we who support this library spend huge amounts of time fixing bugs and adding features, and we don't get paid for it.

     
  • linbren

    linbren - 2013-11-12

    well , you people are great! thanks for your selfless dedication.

    we tested, it is support maximum 2^15 rows in a sheet.

    there was more than 1 millions rows dump to a book , 30000 in each sheet ,we got more then 30 sheets.

     
  • linbren

    linbren - 2013-11-13

    50 columns available.

     
  • Snailman

    Snailman - 2016-01-15

    I have got the same problem!

     

Log in to post a comment.