proprietary file format, why not and why....

Want to talk about something that isn't covered by another category?

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Zryip TheSlug
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 159
Joined: Tue Jan 26, 2010 10:15 pm

Re: proprietary file format, why not and why....

Post by Zryip TheSlug » Fri Nov 18, 2016 2:03 pm

You might be interested by the XSLX Library I'm working on.

So far the Lib is capable to create, read or update native Excel xlsx files. Sheet creation, data export/import (values or formulas) and styles (font format, alignment, background, borders and number format) are supported.

Here is a code example for creating a new workbook file with some data and styles:

Code: Select all

on mouseUp
   local tArchivePath, tFirstLine, tFontStyleArray, tAlignmentStyleArray, tFillStyleArray, tBorderArray, tFormatArray

   put pathToFile("myworkbook.xlsx") into tArchivePath
   XLSX_Workbook_NewFile "myworkbook", "mac"
   put "value1,value2,10,20,30,other string,4,5,6,7,8,9,10,12/31/2016" into tFirstLine
   replace comma with tab in tFirstLine
   XLSX_Range_Values_Set "myworkbook", 1, "A1", tFirstLine, ""
   put "0.00" into tFormatArray["format string"]
   put "bold,italic" into tFontStyleArray["style"]
   put "green" into tFontStyleArray["color"]
   put "center" into tAlignmentStyleArray["HAlignment"]
   put "left,right,bottom,top" into tBorderArray["types list"]
   put "thin" into tBorderArray["line style"]
   put "blue" into tBorderArray["color"]
   put "red" into tFillStyleArray["interior color"]
   put "solid" into tFillStyleArray["type"]
   XLSX_Range_Styles_Set "myworkbook", 1, "C1:E1,M1", tFontStyleArray, tAlignmentStyleArray, tFillStyleArray, tBorderArray, tFormatArray
   XLSX_Sheet_New "myworkbook", "test2"
   XLSX_Range_Values_Set "myworkbook", 2, "A2", tFirstLine, ""
   put empty into tFontStyleArray
   put "double Accounting" into tFontStyleArray["underline"]
   XLSX_Range_Styles_Set "myworkbook", 2, "A2", tFontStyleArray, "", "", "", ""
   XLSX_Workbook_SaveFile "myworkbook", tArchivePath
   XLSX_Workbook_CloseFile "myworkbook"
end mouseUp
You can follow my work progress on my website:

This will be a commercial product.
TheSlug - Tutorials, demo stacks and plugins for LiveCode
Data Grid Helper - An intuitive interface for building LiveCode's Data Grids
Excel Library- Extends the LiveCode language for controlling MS Excel

Posts: 1063
Joined: Sat Sep 27, 2014 10:32 am
Location: Earth, Except when i Jump

Re: proprietary file format, why not and why....

Post by sphere » Fri Nov 18, 2016 11:08 pm

Great work!
Love it.

Post Reply

Return to “Off-Topic”