WorkbookDesigner类
WorkbookDesigner类
封装代表设计器电子表格的对象。
WorkbookDesigner 类型公开以下成员:
构造函数
属性
方法
方法 | 描述 |
---|
set_data_source(self, data_source, cells_data_table) | |
set_data_source(self, variable, data) | 将数据绑定设置为变量。 |
process(self, range, is_preserved) | 处理智能标记并填充数据源值。 |
process(self) | 处理智能标记并填充数据源值。 |
process(self, is_preserved) | 处理智能标记并填充数据源值。 |
process(self, sheet_index, is_preserved) | 处理智能标记并填充数据源值。 |
clear_data_source(self) | 清除所有数据源。 |
set_json_data_source(self, variable, data) | |
get_smart_markers(self) | 返回电子表格中的智能标记集合。 |
例子
from aspose.cells import Workbook, WorkbookDesigner
# Create WorkbookDesigner object.
wd = WorkbookDesigner()
# Open the template file (which contains smart markers).
wd.workbook = Workbook("SmartMarker_Designer.xls")
# Initialize your data from data source
# DataSet ds = new DataSet();
# ...
# Set the datatable as the data source.
# wd.SetDataSource(dt);
# Process the smart markers to fill the data into the worksheets.
wd.process(True)
# Save the excel file.
wd.workbook.save("outSmartMarker_Designer.xls")
也可以看看