Menu

problem in creating multiple sheets, if row>32767 in sheet, will dump md5 error.

2015-10-23
2015-10-25
  • SunHongliang

    SunHongliang - 2015-10-23

    I tried to run your project using xlslib-testCPP, in vs2008, it is showing error at check_file("./testCPP.xls", md5_checksum), Single sheet is successfully created.
    outmessage is "StandardTest failed: MD5 of generated XLS mismatch or I/O failure."

    I am unable to get the problem .

    the code is :

    define PAGE_RECORD_MAX 50000

    const char StandardTest(const char md5_checksum)
    {
    // Get the workbook handler
    workbook wb;
    char buf[128];
    unsigned int totalRecords = 120000 ;
    unsigned int sheet = 3 ;

    //creat 3 sheets, 50000 row per sheet
    unsigned int rec_idx = 0;
    for(int i = 0 ; i < sheet; i++){
    int records = (totalRecords - rec_idx)>PAGE_RECORD_MAX? PAGE_RECORD_MAX: (totalRecords - rec_idx);
    sprintf(buf, "sheet%d", i+1);
    worksheet* sh = wb.sheet( buf );

    for(int j = 0 ; j <PAGE_RECORD_MAX ;="" j++="" ){="" sh-="">label(j,0, "max row test!" ); //creat 65535 row in col,0
    }
    rec_idx +=PAGE_RECORD_MAX;
    }

    int err = wb.Dump("testCPP.xls");
    const char *checkP = file_err;
    if (err != NO_ERRORS)
    {
    cerr << "StandardTest failed: I/O failure: " << err << std::endl;
    return checkP;
    }
    if ((checkP = check_file("./testCPP.xls", md5_checksum)))
    {
    cerr << "StandardTest failed: MD5 of generated XLS mismatch or I/O failure." << std::endl;
    }
    return checkP;
    }

    Regards,

    kdshl

     
  • David Hoerl

    David Hoerl - 2015-10-25

    This error has been reported before and as far as we know there is not real issue with the code. You can create 1Million cells with 64000 per page and open the file in Excel itself without any reported errors. The error does not happen in most other compilers.

     

Log in to post a comment.