- 1、本文档共7页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 5、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 6、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 7、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 8、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
myxls导入导出到excel(Myxls import export to excel)
使用系统;
使用系统配置;
使用系统数据;
使用系统;
使用system.web.security;
使用system.web.ui;
使用system.web.ui.htmlcontrols;
使用system.web.ui.webcontrols;
使用system.web.ui.webcontrols.webparts;
使用System.IO;
利用组织in2bits。MyXls;/ /首先导入命名空间
公共部分类_default:system.web.ui.page
{
摘要
/ / /使用Myxls DLL组件操作EXCLE服务器不需要装办公室。
//
/ / / 参数名=“发件人” /参数
/ / / 参数名=“E” /参数
protected void page_load(object sender,EventArgs e)
{
如果(!这IsPostBack)。
{
}
}
protected void button1_click(object sender,EventArgs e)
{
/ /生成Excel开始
xlsdocument XLS =新xlsdocument();/ /创建空XLS文档
xls.filename =服务器。MapPath(“~ /演示。XLS”);/ /保存路径,如果直接发送到客户端的话只需要名称生成名称
表表= XLS工作簿,工作表。addnamed(“演示”);/ /创建一个工作页为圆顶
/ /设置文档列属性
columninfo CInfo =新columninfo(xls表);/ /设置XLS文档的指定工作页的列属性
CINFO倒塌=真;
/ /设置列的范围如0列- 10列
cinfo.columnindexstart = 0;//列开始
cinfo.columnindexend = 10;//列结束
CINFO倒塌=真;
CInfo。宽度= 90 * 60 /列宽度;
表。AddColumnInfo(CINFO);
/ /设置文档列属性结束
/ /设置指定工作页跨行跨列
mergearea马=新mergearea(1, 1, 1,5);//从第1行跨到第二行,从第一列跨到第5列
表addmergearea(MA);
/ /设置指定工作页跨行跨列结束
/ /创建列样式创建列时引用
XF cellxf = newxf() XLS;
cellxf.verticalalignment = verticalalignments。中心;
cellxf.horizontalalignment = horizontalalignments。中心;
cellxf.font.height = 24 * 12;
cellxf.font.bold =真;
cellxf模式= 1;
/ / set the cell filling style. If set to 0, a solid color is filled
CellXF.PatternBackgroundColor = Colors.Red; / / filled background
CellXF.PatternColor = Colors.Red; / / set the fill color of the line
/ / create style end
/ / create columns
Cells cells = sheet.Cells; / / get the specified page collection work
The basic / column operation
Cell cell=cells.Add (1, 1, Myxls Dome, cellXF module test procedures); / / add title column returns a column name parameter: ranks style object
/ / set the XY Center
Cell.HorizontalAlignment = HorizontalAlignments.Centered;
Cell.VerticalAlignment = VerticalAlignments.Centered;
/ / font
Cell.Font.Bold = true; / / set in bold
Cell.Font.ColorIndex = 0; / / set the color code
Cell.Font.FontFamily = FontFamilies.Roman; / / set the
您可能关注的文档
- 320首好听粤语歌(320 good Cantonese songs).doc
- 320首超级好听的粤语歌,大家可以听听(320 super good Cantonese songs, we can listen to).doc
- 347_attach_附件1注册电气工程师(发输变电、供配电)、公用设备工程(347_attach_ Appendix 1 Registered Electrical Engineer (power generation and transmission, power supply and distribution), utility equipment engineering).doc
- 465-职业生涯规划设计书(465- career planning and design book).doc
- 502胶水配方(502 glue formula).doc
- 560个常考易错成语(5)(560 (5) test often error prone idioms).doc
- 665a全不锈钢多功能洗菜盆(665a all stainless steel multifunctional washing basin).doc
- 2011电视复习(2011 TV Review).doc
- 2011定额装饰专业学习资料(2011 quota decoration professional learning materials).doc
- 2011赴意大利留学前后注意事项(2011, before going abroad to study in Italy matters needing attention).doc
最近下载
- 约翰迪尔5085E_5100E拖拉机维修技术手册 英文.pdf VIP
- 2025年天津市中考数学真题试卷及答案解析 .pdf VIP
- 赣州市城市总体规划项目建议书.pdf VIP
- 2024年中考自招物理选择题精选.docx VIP
- 2025届吉林省育才中学中考生物模拟试卷含解析.doc VIP
- 项目建议书介绍.pptx VIP
- 2025年中考考前押题最后一卷:地理(吉林省卷)(考试版).docx VIP
- 2024年福建省福州一中自主招生考试数学试卷.docx VIP
- 【2025年中考真题系列】2025年天津市中考语文真题试卷含答案(解析版精品.pdf VIP
- 高碳钢连铸小方坯消除中心偏析的最佳对策.pdf VIP
文档评论(0)