Aspose.Cells 基础用法
最近使用Aspose.Cells做Excel,在怎么添加批注和添加内部导航链接上耗费了一些时间,最后在官网上找到相关用法,记录一下。
代码不用过多介绍,看看即可明白。
Workbook workbook = new Workbook();
Worksheet sheet = workbook.Worksheets[]; //工作表
sheet.Name = "表1";
Cells cells = sheet.Cells;//单元格
//写值
cells[, ].PutValue("用户名");
cells[, ].PutValue("密码");
cells[, ].PutValue("admin");
cells[, ].PutValue("admin");
cells[, ].PutValue("test");
cells[, ].PutValue("test");
//添加超链接
sheet.Hyperlinks.Add(, , , , "http://www.baidu.com");
sheet.Hyperlinks.Add(, , , , "表1!A20");
//设置样式
Style style = workbook.Styles[workbook.Styles.Add()];//新增样式
style.HorizontalAlignment = Aspose.Cells.TextAlignmentType.Center; //设置居中
style.ForegroundColor = Color.Green; //设置背景颜色
style.Pattern = BackgroundType.Solid;
cells[, ].SetStyle(style);
//添加批注(必须以xlsx格式保存才有效)
var comIndex = sheet.Comments.Add(, );
sheet.Comments[comIndex].Note = "这里是批注";
//保存
workbook.Save(@".\结果.xlsx");
Aspose.Cells 基础用法的更多相关文章
- Aspose.Cells基础使用方法整理
Aspose.Cells 插件,将web端数据以excel形式导出到客户端. 相关文档: https://blog.csdn.net/djk8888/article/details/53065416 ...
- Aspose.cells常用用法1
代码: var execl_path = @"G:\zhyue\backup\项目修改-工作日常\2018-11-12 区域楼盘中心点和放大比例计算\a.xlsx"; Workbo ...
- Aspose.Cells.dll的用法
public void OutExcel() { #region WorkbookDesigner designer = new WorkbookDesigner(); Worksheet sheet ...
- C#使用Aspose.Cells导出Excel简单实现
首先,需要添加引用Aspose.Cells.dll,官网下载地址:http://downloads.aspose.com/cells/net 将DataTable导出Xlsx格式的文件下载(网页输出) ...
- PropertyGrid控件由浅入深(二):基础用法
目录 PropertyGrid控件由浅入深(一):文章大纲 PropertyGrid控件由浅入深(二):基础用法 控件的外观构成 控件的外观构成如下图所示: PropertyGrid控件包含以下几个要 ...
- Aspose.Cells导出Excel(2)
DataTable dtTitle = ds.Tables[]; DataTable dtDetail = ds.Tables[]; int columns = dtTitle.Columns.Cou ...
- Aspose.Cells导出Excel(1)
利用Aspose.Cells导出excel 注意的问题 1.DataTable的处理 2.进行编码,便于中文名文件下载 3.别忘了Aspose.Cells.dll(可以自己在网上搜索) public ...
- 使用Aspose.Cells读取Excel
最新更新请访问: http://denghejun.github.io Aspose.Cells读取Excel非常方便,以下是一个简单的实现读取和导出Excel的操作类: 以下是Aspose.Ce ...
- C# WinForm 导出导入Excel/Doc 完整实例教程[使用Aspose.Cells.dll]
[csharp] view plain copy 1.添加引用: Aspose.Cells.dll(我们就叫工具包吧,可以从网上下载.关于它的操作我在“Aspose.Cells操作说明 中文版 下载 ...
随机推荐
- 图解HTTP总结(1)——了解Web及网络基础
Web页面不能凭空显示出来.根据Web浏览器地址栏指定的URL,Web浏览器从Web服务器端获取文件资源等信息,从而显示出Web页面. Web使用一种名为HTTP(HyperText Transfe ...
- selenium库:自动化测试工具
爬虫中主要用来解决Javascript渲染问题 1.声明浏览器对象: from selenium import webdriver browser = webdriver.浏览器名() 2.访问页面: ...
- 删除警告的方法 python
import warningswarnings.filterwarnings('ignore')
- android stadio 快捷键最好的材料 android stadio大全 最牛逼的android stadio快捷键
一: .nn .if .for .toast .instanceof .switch 这些都是可以直接点的,一个变量然后.for ,如果这个这个变量是个集合,都可以.for 二: 关闭所有窗口 ctr ...
- Web安全2--XSS&CSRF
1.XSS(跨站脚本攻击) 跨站脚本攻击(Cross Site Scripting),为不和层叠样式表(Cascading Style Sheets, CSS)的缩写混淆,故将跨站脚本攻击缩写为XSS ...
- python开发记录第一篇
1. 安装pyCharm,下载地址https://www.jetbrains.com/pycharm/ 2. 注册license,修改windwos系统hosts,文件路径为:C:\Windows\S ...
- QQ空间相册展示特效
<!doctype html> <html lang="en"> <head> <title>QQ空间相册展示特效<title ...
- C语言库函数实现 【微软面试100题 第八十三题】
题目要求 1.strcpy/memcpy/memmove: 2.memset函数: 3.字符串处理函数. 题目分析 1.接口定义: char * strcpy(char * dest, const c ...
- 【Pascal's Triangle II 】cpp
题目: Given an index k, return the kth row of the Pascal's triangle. For example, given k = 3,Return [ ...
- 【Minimum Window】cpp
题目: Given a string S and a string T, find the minimum window in S which will contain all the charact ...