Menu

Append to sheet

James
2021-07-20
2021-07-29
  • James

    James - 2021-07-20

    is it possible to append to an existing sheet in an existing workbook. if not, is there a recommended alternative?

    thanks

     
  • E.Naumovich

    E.Naumovich - 2021-07-22

    Hi all, just in case:
    I made kind of scratch sheet, with matrix-type access to cells. However it exists in context of the workbook only, and is quite a modest in features.

     
    • Alexandr Belyak

      Alexandr Belyak - 2021-07-23

      Please clarify: did you create such a scratch sheet before creating the xlsx-file via SimpleXlsxWriter , or are you filling it out from an existing xlsx-file?

       
  • E.Naumovich

    E.Naumovich - 2021-07-23

    It is for writing only. But it allows to fill sheet in random access mode. I can prepare example tomorrow. Theoretically it can be filled using lib xlsx i/o https://github.com/brechtsanders/xlsxio and later updated. But this scratch sheet has to be bind to worksheet context (styles, fonts, etc.). And, as far as I understood, xlsx i/o does not read anything except data.

     
    • Alexandr Belyak

      Alexandr Belyak - 2021-07-23

      Thanks for the clarification. It will be great if you can find the time for such an example. Then your example and this explanation might help many library users.

       
  • E.Naumovich

    E.Naumovich - 2021-07-24

    This is quite simple and modest solution, but looks like it works.

     
    • Alexandr Belyak

      Alexandr Belyak - 2021-07-29

      Thanks for your solution and an example of using it.
      Would you mind if I tweak your code a bit to be usable on Linux?

      Let me ask a few questions:
      1) Perhaps in the "template <...> clsCell::Set" function need to pass the value of the "_v" by a constant reference? This can be useful when passing std::string or std::wstring.
      2) Perhaps the clsCell::SetLongIntT function was not finished and the clsCell::SetLongUIntT function was also planned?
      3) Perhaps the "if (Style! = 0)" checks should be removed in the clsCell::InsertTo function, since these checks are already present in the CWorksheet::AddCell functions?

      I am ready to make changes by myself if you approve.
      Thanks again for your help.

       
  • E.Naumovich

    E.Naumovich - 2021-07-29

    Hi,
    please fill free to make any updates/corrections/optimizations. I was in urgent need to make source of the report generator more flexible and readable when I wrote it. This code was made in hurry and obviously it is not on the production level yet.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.