Append to sheet
C++ library for creating XLSX files for MS Excel 2007 and above.
Brought to you by:
oxod,
programmeralex
is it possible to append to an existing sheet in an existing workbook. if not, is there a recommended alternative?
thanks
Hi,
No, it’s impossible.
For an alternative, please see these topics:
https://sourceforge.net/p/simplexlsx/discussion/general/thread/d6605d2b6c/
https://sourceforge.net/p/simplexlsx/discussion/general/thread/8e8c670b/
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.
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?
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.
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.
This is quite simple and modest solution, but looks like it works.
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.
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.