|
本帖最后由 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()
- )
复制代码
|
评分
-
查看全部评分
|