Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
A LibreOffice Calc function to return a basic table editor script from a range of cells
I have developed a simple workaround for those who would like to embed spreadsheet ranges in Zim as an editable table rather than as an image (with or without a link to an external spreadsheet). It involves Zim's Table Editor plugin, and defining a LibreOffice function via Tools/Macros/Edit Macros:
Function RangeToZim(pArray()) as String Dim i as Long Dim j as Long Dim rText as String rText = "" For i = Lbound(pArray()) to Ubound(pArray()) rText = rText +"|" For j = Lbound(pArray(),2) to Ubound(pArray(),2) rText = rText & pArray(i,j) & "|" Next j rText = rText + chr(10) Next i rText = rText + chr(10) RangeToZim = rText End Function REM RangeToZim
Then a simple formula like *=RANGETOZIM(A1:C4)*returns a result like:
|column1|column2|count| |value1|value2|2| |value3|value4|2| |value5|value6|2|
Which should be copied and Paste Only as Text for embedding in Zim. Don't forget to CTRL+R to render the Table Editor widget.