Cadence Skill 论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 36697|回复: 50

Allegro 16.6 支持处理Excel表格,範例代碼

[复制链接]
发表于 2013-8-13 10:16:18 | 显示全部楼层 |阅读模式
本帖最后由 XYX365 于 2013-8-13 10:20 编辑

Allegro 16.6 支持处理Excel表格,範例代碼
  1. procedure( spreadsheetExample()
  2.     ; Initialize an empty spreadsheet.
  3.     ; Note that you do not need to provide a name until you
  4.     ; wish to write the spreadsheet to disk.
  5.     axlSpreadsheetInit()

  6.     ; Define inital, default style.
  7.     ; Styles may be defined at any point during the spreadsheet's
  8.     ; construction, but must be defined before they are referenced
  9.     ; by any row, column, or cell.
  10.     axlSpreadsheetSetStyle("Default" nil)
  11.     axlSpreadsheetSetStyleProp("Alignment" "Vertical" "Top")
  12.     axlSpreadsheetSetStyleProp("Alignment" "Horizontal" "Left")
  13.     axlSpreadsheetSetStyleProp("Alignment" "WrapText" "1")

  14.     ; Define a second style, derived from the Default style, which
  15.     ; will include a thin border outline and specifies a red
  16.     ; background fill.
  17.     axlSpreadsheetSetStyle("Red" "Red Cell")
  18.     axlSpreadsheetSetStyleParent("Default")
  19.     axlSpreadsheetSetStyleBorder("Left" nil "Continuous" "2")
  20.     axlSpreadsheetSetStyleBorder("Right" nil "Continuous" "2")
  21.     axlSpreadsheetSetStyleBorder("Top" nil "Continuous" "2")
  22.     axlSpreadsheetSetStyleBorder("Bottom" nil "Continuous" "2")
  23.     axlSpreadsheetSetStyleProp("Fill" "Color"
  24.     axlSpreadsheetGetRGBColorString(255 0 0))
  25.     axlSpreadsheetSetStyleProp("Fill" "Pattern" "Solid")

  26.     ; Define the first worksheet in the spreadsheet.
  27.     axlSpreadsheetSetWorksheet("First")

  28.     ; With a wider first column
  29.     axlSpreadsheetSetColumnProp(1 "Width" "500")
  30.     axlSpreadsheetDefineCell(1 1 "Default" "String" "Default formatted cell")
  31.     axlSpreadsheetDefineCell(1 2 "Red" "String" "Red background cell")

  32.     ; Write the compiled spreadsheet to XML file on disk.
  33.     axlSpreadsheetWrite("spreadsheet.xml")

  34.     ; Close and release the compiled spreadsheet's data.
  35.     axlSpreadsheetClose()
  36. )
复制代码
1.jpg

评分

参与人数 1SKILL币 +1 收起 理由
鎏星吻 + 1 很给力!

查看全部评分

发表于 2013-8-13 17:03:51 | 显示全部楼层
这个太好了,不用依赖html了。
发表于 2013-9-5 08:24:32 | 显示全部楼层
study..., thanks
发表于 2013-9-9 15:06:23 | 显示全部楼层
它好像是.xml的格式, 16.6可以处理.xls的文件吗
 楼主| 发表于 2013-9-9 16:18:15 | 显示全部楼层
l888888h 发表于 2013-9-9 15:06
它好像是.xml的格式, 16.6可以处理.xls的文件吗

xml的格式,不能處理xls
发表于 2013-10-9 15:18:34 | 显示全部楼层
学习了, 谢谢...
发表于 2013-10-9 20:40:26 | 显示全部楼层
不错,学习了。。。。
发表于 2014-1-2 21:08:06 | 显示全部楼层
謝謝分享喔   學習了
发表于 2014-4-2 09:08:17 | 显示全部楼层
这个太好了,不用依赖html了
发表于 2014-4-2 17:59:06 | 显示全部楼层
很强大 支持;
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|网站地图|Cadence Skill 论坛 ( 蜀ICP备13024417号 )

GMT+8, 2024-4-25 15:09 , Processed in 0.152734 second(s), 20 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表