Menu

Errors with borders

2008-12-08
2013-04-13
  • Ion Gaztañaga

    Ion Gaztañaga - 2008-12-08

    Hi,

    First of all, congratulations for reactivating the project. I think xlslib is a unique library that fills a very needed gap. I've successfully created some xls files, but I've found some problems with the last release (1.2.0):

    The first problem is similar to ravikant dubey's report: Multiple sheets:

       workbook wb;
       worksheet* sh = wb.sheet("sheet");
       worksheet* sh2 = wb.sheet("sheet2");
       wb.Dump("file.xls");

    My Excel says it's corrupt, tries to repair it and the report is empty. However, two sheets are created. The second problem is with borders:

       workbook wb;
       worksheet* sh = wb.sheet("sheet");
       xf_t* fmt = wb.xformat(wb.font("Arial"));
       fmt->SetBorderStyle(BORDER_LEFT, BORDER_THIN, COLOR_BLACK);
       fmt->SetBorderStyle(BORDER_TOP, BORDER_THIN, COLOR_BLACK);
       sh->label(2,1,"test2", fmt);
       wb.Dump("file.xls");

    No borders appear in the xls file. For more complex excels, I've found that left-right borders appear but not top-bottom ones. Other advanced features (shink to fit, alignment...) seem to work ok.

    If more help is needed, I would be glad to help to solve these issues.

    Thanks again for the library!

    Ion

     
    • Ion Gaztañaga

      Ion Gaztañaga - 2008-12-08

      Hi,

      I've tried again with the latest CVS (December 6).

      ->Two-sheet workbooks seem fine. No errors when opening it with excel.

      -> Column width scale was changed. Now we need to multiply old values with 256 to get the previous width. I suppose this last behaviour is the good one, since comments inside the function suggest the passed width is the 1/256 part of the width.

      -> Borders still missing.

      Regards,

      Ion

       
    • David Hoerl

      David Hoerl - 2008-12-19

      The whole xf-format was just filled with bugs - so many it makes my head spin. The bit get/set functions were broken, etc.

      MS changed almost everything in the extended format record when they moved to BIFF8.

      David

       

Log in to post a comment.