print_band
- print_band(self, band, dic=None)
使用范围: client
编程语言: python
父类: Report 类
描述说明
使用 print_band 方法设置在报表 template 中定义的区域中的可编程单元格的值,并将该区域添加到报表的内容中。
它有下列参数:
band - 指定要打印的区域的名称
dic - 字典, 包含要分配给区域中的可编程单元格的值。
示例
以下代码生成演示应用程序的 客户列表(Customer list) 报表的内容:
def on_generate(report):
cust = report.task.customers.copy()
cust.open()
report.print_band('title')
for c in cust:
firstname = c.firstname.display_text
lastname = c.lastname.display_text
company = c.company.display_text
country = c.country.display_text
address = c.address.display_text
phone = c.phone.display_text
email = c.email.display_text
report.print_band('detail', locals())