Allegro 16.6 支持处理Excel表格,範例代碼
本帖最后由 XYX365 于 2013-8-13 10:20 编辑Allegro 16.6 支持处理Excel表格,範例代碼procedure( spreadsheetExample()
; Initialize an empty spreadsheet.
; Note that you do not need to provide a name until you
; wish to write the spreadsheet to disk.
axlSpreadsheetInit()
; Define inital, default style.
; Styles may be defined at any point during the spreadsheet's
; construction, but must be defined before they are referenced
; by any row, column, or cell.
axlSpreadsheetSetStyle("Default" nil)
axlSpreadsheetSetStyleProp("Alignment" "Vertical" "Top")
axlSpreadsheetSetStyleProp("Alignment" "Horizontal" "Left")
axlSpreadsheetSetStyleProp("Alignment" "WrapText" "1")
; Define a second style, derived from the Default style, which
; will include a thin border outline and specifies a red
; background fill.
axlSpreadsheetSetStyle("Red" "Red Cell")
axlSpreadsheetSetStyleParent("Default")
axlSpreadsheetSetStyleBorder("Left" nil "Continuous" "2")
axlSpreadsheetSetStyleBorder("Right" nil "Continuous" "2")
axlSpreadsheetSetStyleBorder("Top" nil "Continuous" "2")
axlSpreadsheetSetStyleBorder("Bottom" nil "Continuous" "2")
axlSpreadsheetSetStyleProp("Fill" "Color"
axlSpreadsheetGetRGBColorString(255 0 0))
axlSpreadsheetSetStyleProp("Fill" "Pattern" "Solid")
; Define the first worksheet in the spreadsheet.
axlSpreadsheetSetWorksheet("First")
; With a wider first column
axlSpreadsheetSetColumnProp(1 "Width" "500")
axlSpreadsheetDefineCell(1 1 "Default" "String" "Default formatted cell")
axlSpreadsheetDefineCell(1 2 "Red" "String" "Red background cell")
; Write the compiled spreadsheet to XML file on disk.
axlSpreadsheetWrite("spreadsheet.xml")
; Close and release the compiled spreadsheet's data.
axlSpreadsheetClose()
)
这个太好了,不用依赖html了。 study..., thanks :) 它好像是.xml的格式, 16.6可以处理.xls的文件吗 l888888h 发表于 2013-9-9 15:06 static/image/common/back.gif
它好像是.xml的格式, 16.6可以处理.xls的文件吗
xml的格式,不能處理xls 学习了, 谢谢... 不错,学习了。。。。 謝謝分享喔 學習了 这个太好了,不用依赖html了 很强大 支持;