Examples

Help
2011-10-29
2013-04-13
  • Kubilay Kaan

    Kubilay Kaan - 2011-10-29

    Are there any examples for using this lib???

     
  • David Hoerl

    David Hoerl - 2011-10-30

    Yes - look in the test folder. There are several files. The two main files show how use the library for C and C++ users. There is another one that shows formula use.

     
  • Marc Cunning

    Marc Cunning - 2012-01-09

    Greetings, great job with xlslib and libxls.. nice libraries.
    I have one question for you, creating formulas in workseets:
    if i doing:
    cell_t *pCell=ws1->FindCell(0,0);
    cell_t *pCell2=ws1->FindCell(10,0);
    expression_node_t *pExpFormula = maker.f(FUNC_SUM, maker.cell(*pCell, ws1,
    CELL_RELATIVE_A1), maker.cell(*pCell2, ws1, CELL_RELATIVE_A1));
    ws1->formula(5, 5, pExpFormula, true);
    -> i get one formula like:  =SUM(A1;A11), meaning add cells A1 and A11, working ok.
    --
    - > But how i can to get: =SUM(A1:A11), meaning add from cells A1 to A11..?
    --> I didn\'t found any example about this
    Thank you..

     
  • David Hoerl

    David Hoerl - 2012-01-25

    Hmm - I'm pretty sure I replied to this but its not on source forge. There was a bug - a set of methods were not exposed but are in latest release. do it this way:

    expression_node_factory_t& maker = wb.GetFormulaFactory();

    cell_t *c1 = sh->number(0, 0, 1.1);
    sh->number(0, 1, 2.2);
    cell_t *c2 = sh->number(0, 2, 3.3);

    expression_node_t *pExpFormula = maker.f(FUNC_SUM, maker.area(*c1, *c2, CELL_RELATIVE_A1));
    sh->formula(0, 3, pExpFormula, true);

     

Log in to post a comment.