本文整理汇总了Python中reportlab.graphics.shapes.Drawing.wrapOn方法的典型用法代码示例。如果您正苦于以下问题:Python Drawing.wrapOn方法的具体用法?Python Drawing.wrapOn怎么用?Python Drawing.wrapOn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类reportlab.graphics.shapes.Drawing
的用法示例。
在下文中一共展示了Drawing.wrapOn方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: body
# 需要导入模块: from reportlab.graphics.shapes import Drawing [as 别名]
# 或者: from reportlab.graphics.shapes.Drawing import wrapOn [as 别名]
def body():
# Body
size_y = 0.62
data = [["Sold", "Cash", "Card", "Contingent", "Reserved", "Expected", "Unsold Reserv."]]
for cat, value in report_result_dict.iteritems():
size_y = size_y + 1.86
"""
if cat == 'all':
report_cat_name = 'All'
else:
report_cat_name = self.report_cat_list[event_id][cat]
"""
if cat == "all":
categorie_name = "All"
else:
categorie_name = cat_name[cat]
p = Paragraph('<para alignment="center"><b>' + categorie_name + "</b></para>", styles["Normal"])
data.append([p, "", "", "", "", "", ""])
if cat == "all":
data_for_pie = [
value["a_total_sold"],
value["a_sold_cash"],
value["a_sold_card"],
value["a_sold_conti"],
value["a_reserved"],
value["a_not_visited"],
]
data.append(
[
value["a_total_sold"],
value["a_sold_cash"],
value["a_sold_card"],
value["a_sold_conti"],
value["a_reserved"],
value["a_total_pre"],
value["a_not_visited"],
]
)
data.append(
[
str(value["m_total_sold"]) + unichr(8364),
str(value["m_sold_cash"]) + unichr(8364),
str(value["m_sold_card"]) + unichr(8364),
"-",
str(value["m_reserved"]) + unichr(8364),
str(value["m_total_pre"]) + unichr(8364),
str(value["m_not_visited"]) + unichr(8364),
]
)
tstyle = [
("INNERGRID", (0, 0), (-1, -1), 0.25, colors.grey),
("BOX", (0, 0), (-1, -1), 0.25, colors.black),
("ALIGN", (0, 1), (-1, -1), "RIGHT"),
(
"COLBACKGROUNDS",
(0, 0),
(-1, -1),
[
colors.lightpink,
colors.lightpink,
colors.lightpink,
colors.lightpink,
colors.lightyellow,
colors.lightgrey,
colors.lightyellow,
],
),
("ROWBACKGROUNDS", (0, 1), (-1, -1), [colors.lightslategray, None, None]),
]
t = Table(data)
t.setStyle(TableStyle(tstyle))
t.wrapOn(c, 19 * cm, 0 * cm)
pos_y = 26.5 - size_y
t.drawOn(c, 1 * cm, pos_y * cm)
# Price Details
# size_y = 0.62
pdata = []
for cat, value in report_result_dict.iteritems():
size_y = size_y + 1.86
if cat == "all":
pass
else:
categorie_name = cat_name[cat]
p = Paragraph('<para alignment="center"><b>' + categorie_name + "</b></para>", styles["Normal"])
pdata.append([p])
data_price_titles = []
data_price_amount = []
data_price_total = []
for prow in p_result:
#.........这里部分代码省略.........