在GridDesktop中加载工作簿时过滤对象
Contents
[
Hide
]
可能的使用场景
在从工作簿筛选数据时,请使用GridDesktop.LoadDataFilter属性。
GridLoadDataFilterOptions枚举具有以下值。
- 所有
- 文档设置
- 单元格空白
- 单元格布尔
- 单元格数据
- 单元格错误
- 单元格数值
- 单元格字符串
- 单元格值
- Chart
- 条件格式
- 数据验证
- 定义名称
- 文档属性
- 公式
- 超链接
- 合并区域
- 数据透视表
- 设置
- 形状
- 表单数据
- 表格设置
- 结构
- 样式
- 表
- VBA
- Xml映射
在加载工作簿时过滤数据
以下示例代码说明了如何过滤工作薄中的图纸。请查看 示例 excel 文件。如您所见,工作簿中的所有图表/形状/图像都已被过滤掉。
示例代码
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Filter all drawing objects(including Chart, Picture, OleObject and all other drawing objects) from the workbook. | |
gridDesktop1.LoadDataFilter = GridLoadDataFilterOptions.All&~GridLoadDataFilterOptions.Drawing; | |
//here is another example ,if we want to filter to show styles and values only, we can use the below code ,notice here we use | | |
// gridDesktop1.LoadDataFilter = GridLoadDataFilterOptions.CellValue | GridLoadDataFilterOptions.Style; | |
gridDesktop1.ImportExcelFile("5472489.xlsx"); | |