WorkbookDesigner类

WorkbookDesigner类

封装代表设计器电子表格的对象。

WorkbookDesigner 类型公开以下成员:

构造函数

构造函数描述
__init__(self)初始化 WorkbookDesigner 类的新实例。
__init__(self, workbook)初始化 WorkbookDesigner 类的新实例。

属性

属性描述
workbook获取并设置 WorkbookDesigner.workbook 对象。
repeat_formulas_with_subtotal指示是否重复带有小计行的公式。
update_empty_string_as_null如果为 TRUE,则当值为“”时插入 Null;
update_reference指示其他工作表中的引用是否会更新。
calculate_formula指示是否应计算公式。
line_by_line指示是否逐行处理智能标记。
contains_variables指示第一个工作表是否包含自定义变量。

方法

方法描述
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")

也可以看看