XYX365 发表于 2013-8-13 10:16:18

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()
)

chuankay 发表于 2013-8-13 17:03:51

这个太好了,不用依赖html了。

l888888h 发表于 2013-9-5 08:24:32

study..., thanks :)

l888888h 发表于 2013-9-9 15:06:23

它好像是.xml的格式, 16.6可以处理.xls的文件吗

XYX365 发表于 2013-9-9 16:18:15

l888888h 发表于 2013-9-9 15:06 static/image/common/back.gif
它好像是.xml的格式, 16.6可以处理.xls的文件吗

xml的格式,不能處理xls

l888888h 发表于 2013-10-9 15:18:34

学习了, 谢谢...

winter_liu 发表于 2013-10-9 20:40:26

不错,学习了。。。。

sisic 发表于 2014-1-2 21:08:06

謝謝分享喔   學習了

bingshuihuo 发表于 2014-4-2 09:08:17

这个太好了,不用依赖html了

srqrs 发表于 2014-4-2 17:59:06

很强大 支持;
页: [1] 2 3 4 5 6
查看完整版本: Allegro 16.6 支持处理Excel表格,範例代碼