Reformat files......

This commit is contained in:
anjali
2021-05-13 22:13:13 +05:30
parent d02d050152
commit 49ec3a00bd
2 changed files with 138 additions and 144 deletions

View File

@@ -18,47 +18,45 @@ COPYWRITE
INCLUDE_IN_README INCLUDE_IN_README
''' '''
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
import matplotlib as mpl import matplotlib as mpl
import numpy as np import numpy as np
import pandas as pd import pandas as pd
import pdfkit import pdfkit
import math import math
from matplotlib.colors import ListedColormap from matplotlib.colors import ListedColormap
# internal candela references included during intial phases, to be deleted at future date # internal candela references included during intial phases, to be deleted at future date
# graph reporting classes # graph reporting classes
class lf_bar_graph(): class lf_bar_graph():
def __init__(self, def __init__(self, _data_set=[[30, 55, 69, 37], [45, 67, 34, 22], [22, 45, 12, 34]],
_data_set= [[30,55,69,37],[45,67,34,22],[22,45,12,34]], _xaxis_name="x-axis",
_xaxis_name="x-axis", _yaxis_name="y-axis",
_yaxis_name="y-axis", _xaxis_categories=[1, 2, 3, 4],
_xaxis_categories=[1,2,3,4], _graph_image_name="image_name",
_graph_image_name="image_name", _label=["bi-downlink", "bi-uplink", 'uplink'],
_label=["bi-downlink", "bi-uplink",'uplink'], _color=None,
_color=None, _bar_width=0.25,
_bar_width=0.25, _color_edge='grey',
_color_edge='grey', _font_weight='bold',
_font_weight='bold', _color_name=['lightcoral', 'darkgrey', 'r', 'g', 'b', 'y'],
_color_name=['lightcoral','darkgrey','r','g','b','y'], _figsize=(10, 5),
_figsize=(10,5), _dpi=96):
_dpi=96):
self.data_set=_data_set
self.xaxis_name=_xaxis_name
self.yaxis_name=_yaxis_name
self.xaxis_categories=_xaxis_categories
self.graph_image_name=_graph_image_name
self.label=_label
self.color=_color
self.bar_width=_bar_width
self.color_edge=_color_edge
self.font_weight=_font_weight
self.color_name=_color_name
self.figsize=_figsize
self.data_set = _data_set
self.xaxis_name = _xaxis_name
self.yaxis_name = _yaxis_name
self.xaxis_categories = _xaxis_categories
self.graph_image_name = _graph_image_name
self.label = _label
self.color = _color
self.bar_width = _bar_width
self.color_edge = _color_edge
self.font_weight = _font_weight
self.color_name = _color_name
self.figsize = _figsize
def build_bar_graph(self): def build_bar_graph(self):
if self.color is None: if self.color is None:
@@ -66,23 +64,23 @@ class lf_bar_graph():
self.color = [] self.color = []
for col in self.data_set: for col in self.data_set:
self.color.append(self.color_name[i]) self.color.append(self.color_name[i])
i = i+1 i = i + 1
fig = plt.subplots(figsize=self.figsize) fig = plt.subplots(figsize=self.figsize)
i = 0 i = 0
for set in self.data_set: for data in self.data_set:
if i > 0: if i > 0:
br = br1 br = br1
br2 = [x + self.bar_width for x in br] br2 = [x + self.bar_width for x in br]
plt.bar(br2, self.data_set[i], color=self.color[i], width=self.bar_width, plt.bar(br2, self.data_set[i], color=self.color[i], width=self.bar_width,
edgecolor=self.color_edge, label=self.label[i]) edgecolor=self.color_edge, label=self.label[i])
br1 = br2 br1 = br2
i = i+1 i = i + 1
else: else:
br1 = np.arange(len(self.data_set[i])) br1 = np.arange(len(self.data_set[i]))
plt.bar(br1, self.data_set[i], color=self.color[i], width=self.bar_width, plt.bar(br1, self.data_set[i], color=self.color[i], width=self.bar_width,
edgecolor=self.color_edge, label=self.label[i]) edgecolor=self.color_edge, label=self.label[i])
i=i+1 i = i + 1
plt.xlabel(self.xaxis_name, fontweight='bold', fontsize=15) plt.xlabel(self.xaxis_name, fontweight='bold', fontsize=15)
plt.ylabel(self.yaxis_name, fontweight='bold', fontsize=15) plt.ylabel(self.yaxis_name, fontweight='bold', fontsize=15)
plt.xticks([r + self.bar_width for r in range(len(self.data_set[0]))], plt.xticks([r + self.bar_width for r in range(len(self.data_set[0]))],
@@ -90,24 +88,24 @@ class lf_bar_graph():
plt.legend() plt.legend()
fig = plt.gcf() fig = plt.gcf()
plt.savefig("%s.png"% (self.graph_image_name), dpi=96) plt.savefig("%s.png" % self.graph_image_name, dpi=96)
plt.close() plt.close()
print("{}.png".format(self.graph_image_name)) print("{}.png".format(self.graph_image_name))
return "%s.png" % (self.graph_image_name) return "%s.png" % self.graph_image_name
class lf_scatter_graph(): class lf_scatter_graph():
def __init__(self, def __init__(self,
_x_data_set=["sta0 ","sta1","sta2","sta3"], _x_data_set=["sta0 ", "sta1", "sta2", "sta3"],
_y_data_set=[[30,55,69,37]], _y_data_set=[[30, 55, 69, 37]],
_values =None, _values=None,
_xaxis_name="x-axis", _xaxis_name="x-axis",
_yaxis_name="y-axis", _yaxis_name="y-axis",
_label = ["num1", "num2"], _label=["num1", "num2"],
_graph_image_name="image_name", _graph_image_name="image_name",
_color=["r","y"], _color=["r", "y"],
_figsize=(9,4)): _figsize=(9, 4)):
self.x_data_set = _x_data_set self.x_data_set = _x_data_set
self.y_data_set = _y_data_set self.y_data_set = _y_data_set
self.xaxis_name = _xaxis_name self.xaxis_name = _xaxis_name
@@ -125,7 +123,7 @@ class lf_scatter_graph():
if self.values is None: if self.values is None:
plt.scatter(self.x_data_set, self.y_data_set[0], color=self.color[0], label=self.label[0]) plt.scatter(self.x_data_set, self.y_data_set[0], color=self.color[0], label=self.label[0])
if len(self.y_data_set) > 1: if len(self.y_data_set) > 1:
for i in range(1,len(self.y_data_set)): for i in range(1, len(self.y_data_set)):
plt.scatter(self.x_data_set, self.y_data_set[i], color=self.color[i], label=self.label[i]) plt.scatter(self.x_data_set, self.y_data_set[i], color=self.color[i], label=self.label[i])
plt.xlabel(self.xaxis_name, fontweight='bold', fontsize=15) plt.xlabel(self.xaxis_name, fontweight='bold', fontsize=15)
plt.ylabel(self.yaxis_name, fontweight='bold', fontsize=15) plt.ylabel(self.yaxis_name, fontweight='bold', fontsize=15)
@@ -138,21 +136,22 @@ class lf_scatter_graph():
plt.ylabel(self.yaxis_name, fontweight='bold', fontsize=15) plt.ylabel(self.yaxis_name, fontweight='bold', fontsize=15)
plt.gcf().autofmt_xdate() plt.gcf().autofmt_xdate()
plt.legend(handles=scatter.legend_elements()[0], labels=self.label) plt.legend(handles=scatter.legend_elements()[0], labels=self.label)
plt.savefig("%s.png" % (self.graph_image_name), dpi=96) plt.savefig("%s.png" % self.graph_image_name, dpi=96)
plt.close() plt.close()
print("{}.png".format(self.graph_image_name)) print("{}.png".format(self.graph_image_name))
return "%s.png" % (self.graph_image_name) return "%s.png" % self.graph_image_name
class lf_stacked_graph(): class lf_stacked_graph():
def __init__(self, def __init__(self,
_data_set= [[1,2,3,4],[1,1,1,1],[1,1,1,1]], _data_set=[[1, 2, 3, 4], [1, 1, 1, 1], [1, 1, 1, 1]],
_xaxis_name="Stations", _xaxis_name="Stations",
_yaxis_name="Numbers", _yaxis_name="Numbers",
_label = ['Success','Fail'], _label=['Success', 'Fail'],
_graph_image_name="image_name", _graph_image_name="image_name",
_color = ["b","g"], _color=["b", "g"],
_figsize=(9,4)): _figsize=(9, 4)):
self.data_set = _data_set # [x_axis,y1_axis,y2_axis] self.data_set = _data_set # [x_axis,y1_axis,y2_axis]
self.xaxis_name = _xaxis_name self.xaxis_name = _xaxis_name
self.yaxis_name = _yaxis_name self.yaxis_name = _yaxis_name
@@ -161,7 +160,6 @@ class lf_stacked_graph():
self.label = _label self.label = _label
self.color = _color self.color = _color
def build_stacked_graph(self): def build_stacked_graph(self):
fig = plt.subplots(figsize=self.figsize) fig = plt.subplots(figsize=self.figsize)
if self.color is None: if self.color is None:
@@ -170,7 +168,8 @@ class lf_stacked_graph():
plt.bar(self.data_set[0], self.data_set[2], bottom=self.data_set[1], color=self.color[1]) plt.bar(self.data_set[0], self.data_set[2], bottom=self.data_set[1], color=self.color[1])
if len(self.data_set) > 3: if len(self.data_set) > 3:
for i in range(3, len(self.data_set)): for i in range(3, len(self.data_set)):
plt.bar(self.data_set[0], self.data_set[i], bottom=np.array(self.data_set[i-2])+np.array(self.data_set[i-1]), color=self.color[i-1]) plt.bar(self.data_set[0], self.data_set[i],
bottom=np.array(self.data_set[i - 2]) + np.array(self.data_set[i - 1]), color=self.color[i - 1])
plt.xlabel(self.xaxis_name) plt.xlabel(self.xaxis_name)
plt.ylabel(self.yaxis_name) plt.ylabel(self.yaxis_name)
plt.legend(self.label) plt.legend(self.label)
@@ -180,18 +179,19 @@ class lf_stacked_graph():
return "%s.png" % (self.graph_image_name) return "%s.png" % (self.graph_image_name)
class lf_horizontal_stacked_graph(): class lf_horizontal_stacked_graph():
def __init__(self, def __init__(self,
_seg= 2, _seg=2,
_yaxis_set=('A','B'), _yaxis_set=('A', 'B'),
_xaxis_set1=[12, 0, 0, 16, 15], _xaxis_set1=[12, 0, 0, 16, 15],
_xaxis_set2 = [23, 34, 23, 0], _xaxis_set2=[23, 34, 23, 0],
_unit ="%", _unit="%",
_xaxis_name="Stations", _xaxis_name="Stations",
_label=['Success', 'Fail'], _label=['Success', 'Fail'],
_graph_image_name="image_name", _graph_image_name="image_name",
_color=["success", "Fail"], _color=["success", "Fail"],
_figsize=(9,4)): _figsize=(9, 4)):
self.unit = _unit self.unit = _unit
self.seg = _seg self.seg = _seg
self.xaxis_set1 = _xaxis_set1 self.xaxis_set1 = _xaxis_set1
@@ -209,15 +209,15 @@ class lf_horizontal_stacked_graph():
fig, ax = plt.subplots(figsize=self.figsize) fig, ax = plt.subplots(figsize=self.figsize)
N = self.seg n = self.seg
values1 = self.xaxis_set1 values1 = self.xaxis_set1
values2 = self.xaxis_set2 values2 = self.xaxis_set2
ind = np.arange(N) + .15 ind = np.arange(n) + .15
width = 0.3 width = 0.3
rects1 = plt.barh(ind, values1, width, color=self.color[0], label=self.label[0]) rects1 = plt.barh(ind, values1, width, color=self.color[0], label=self.label[0])
rects2 = plt.barh(ind, values2, width, left=sumzip(values1), color=self.color[1],label=self.label[1]) rects2 = plt.barh(ind, values2, width, left=sumzip(values1), color=self.color[1], label=self.label[1])
extra_space = 0.15 extra_space = 0.15
ax.set_yticks(ind + width - extra_space) ax.set_yticks(ind + width - extra_space)
@@ -225,26 +225,28 @@ class lf_horizontal_stacked_graph():
ax.yaxis.set_tick_params(length=0, labelbottom=True) ax.yaxis.set_tick_params(length=0, labelbottom=True)
for i, v in enumerate(values1): for i, v in enumerate(values1):
if v!=0: if v != 0:
plt.text(v * 0.45, i + .145, "%s%s" % (v, self.unit), color='white', fontweight='bold', fontsize=10, plt.text(v * 0.45, i + .145, "%s%s" % (v, self.unit), color='white', fontweight='bold', fontsize=10,
ha='center', va='center') ha='center', va='center')
for i, v in enumerate(values2): for i, v in enumerate(values2):
if v != 0: if v != 0:
plt.text(v * 0.45 + values1[i], i + .145, "%s%s" % (v, self.unit), color='white', fontweight='bold', fontsize=10, plt.text(v * 0.45 + values1[i], i + .145, "%s%s" % (v, self.unit), color='white', fontweight='bold',
fontsize=10,
ha='center', va='center') ha='center', va='center')
ax.spines['right'].set_visible(False) ax.spines['right'].set_visible(False)
ax.spines['top'].set_visible(False) ax.spines['top'].set_visible(False)
ax.legend(loc='upper right') ax.legend(loc='upper right')
plt.savefig("%s.png" % (self.graph_image_name), dpi=96) plt.savefig("%s.png" % self.graph_image_name, dpi=96)
plt.close() plt.close()
print("{}.png".format(self.graph_image_name)) print("{}.png".format(self.graph_image_name))
return "%s.png" % (self.graph_image_name) return "%s.png" % self.graph_image_name
# Unit Test # Unit Test
if __name__ == "__main__": if __name__ == "__main__":
output_html_1 = "graph_1.html" output_html_1 = "graph_1.html"
output_pdf_1 = "graph_1.pdf" output_pdf_1 = "graph_1.pdf"
@@ -263,26 +265,25 @@ if __name__ == "__main__":
# write logic to generate pdf here # write logic to generate pdf here
# wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_amd64.deb # wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_amd64.deb
# sudo apt install ./wkhtmltox_0.12.6-1.focal_amd64.deb # sudo apt install ./wkhtmltox_0.12.6-1.focal_amd64.deb
options = {"enable-local-file-access" : None} # prevent eerror Blocked access to file options = {"enable-local-file-access": None} # prevent eerror Blocked access to file
pdfkit.from_file(output_html_1, output_pdf_1, options=options) pdfkit.from_file(output_html_1, output_pdf_1, options=options)
# test build_bar_graph setting values # test build_bar_graph setting values
dataset = [[45,67,34,22],[22,45,12,34],[30,55,69,37]] dataset = [[45, 67, 34, 22], [22, 45, 12, 34], [30, 55, 69, 37]]
x_axis_values = [1,2,3,4] x_axis_values = [1, 2, 3, 4]
output_html_2 = "graph_2.html" output_html_2 = "graph_2.html"
output_pdf_2 = "graph_2.pdf" output_pdf_2 = "graph_2.pdf"
# test build_bar_graph with defaults # test build_bar_graph with defaults
graph = lf_bar_graph(_data_set=dataset, graph = lf_bar_graph(_data_set=dataset,
_xaxis_name="stations", _xaxis_name="stations",
_yaxis_name="Throughput 2 (Mbps)", _yaxis_name="Throughput 2 (Mbps)",
_xaxis_categories=x_axis_values, _xaxis_categories=x_axis_values,
_graph_image_name="Bi-single_radio_2.4GHz", _graph_image_name="Bi-single_radio_2.4GHz",
_label=["bi-downlink", "bi-uplink",'uplink'], _label=["bi-downlink", "bi-uplink", 'uplink'],
_color=None, _color=None,
_color_edge='red') _color_edge='red')
graph_html_obj = """ graph_html_obj = """
<img align='center' style='padding:15;margin:5;width:1000px;' src=""" + "%s" % (graph.build_bar_graph()) + """ border='1' /> <img align='center' style='padding:15;margin:5;width:1000px;' src=""" + "%s" % (graph.build_bar_graph()) + """ border='1' />
<br><br> <br><br>
@@ -296,8 +297,5 @@ if __name__ == "__main__":
# write logic to generate pdf here # write logic to generate pdf here
# wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_amd64.deb # wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_amd64.deb
# sudo apt install ./wkhtmltox_0.12.6-1.focal_amd64.deb # sudo apt install ./wkhtmltox_0.12.6-1.focal_amd64.deb
options = {"enable-local-file-access" : None} # prevent eerror Blocked access to file options = {"enable-local-file-access": None} # prevent eerror Blocked access to file
pdfkit.from_file(output_html_2, output_pdf_2, options=options) pdfkit.from_file(output_html_2, output_pdf_2, options=options)

View File

@@ -18,36 +18,35 @@ COPYWRITE
INCLUDE_IN_README INCLUDE_IN_README
''' '''
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
import matplotlib as mpl import matplotlib as mpl
import numpy as np import numpy as np
import pandas as pd import pandas as pd
import pdfkit import pdfkit
from lf_report import lf_report from lf_report import lf_report
from lf_graph import lf_bar_graph, lf_scatter_graph , lf_stacked_graph, lf_horizontal_stacked_graph from lf_graph import lf_bar_graph, lf_scatter_graph, lf_stacked_graph, lf_horizontal_stacked_graph
# Unit Test # Unit Test
if __name__ == "__main__": if __name__ == "__main__":
# Testing: generate data frame
# Testing: generate data frame
dataframe = pd.DataFrame({ dataframe = pd.DataFrame({
'product':['CT521a-264-1ac-1n','CT521a-1ac-1ax','CT522-264-1ac2-1n','CT523c-2ac2-db-10g-cu','CT523c-3ac2-db-10g-cu','CT523c-8ax-ac10g-cu','CT523c-192-2ac2-1ac-10g'], 'product': ['CT521a-264-1ac-1n', 'CT521a-1ac-1ax', 'CT522-264-1ac2-1n', 'CT523c-2ac2-db-10g-cu',
'radios':[1,1,2,2,6,9,3], 'CT523c-3ac2-db-10g-cu', 'CT523c-8ax-ac10g-cu', 'CT523c-192-2ac2-1ac-10g'],
'MIMO':['N','N','N','Y','Y','Y','Y'], 'radios': [1, 1, 2, 2, 6, 9, 3],
'stations':[200,64,200,128,384,72,192], 'MIMO': ['N', 'N', 'N', 'Y', 'Y', 'Y', 'Y'],
'mbps':[300,300,300,10000,10000,10000,10000] 'stations': [200, 64, 200, 128, 384, 72, 192],
'mbps': [300, 300, 300, 10000, 10000, 10000, 10000]
}) })
print(dataframe) print(dataframe)
# Testing: generate data frame # Testing: generate data frame
dataframe2 = pd.DataFrame({ dataframe2 = pd.DataFrame({
'station':[1,2,3,4,5,6,7], 'station': [1, 2, 3, 4, 5, 6, 7],
'time_seconds':[23,78,22,19,45,22,25] 'time_seconds': [23, 78, 22, 19, 45, 22, 25]
}) })
# report = lf_report(_dataframe=dataframe)
#report = lf_report(_dataframe=dataframe)
report = lf_report() report = lf_report()
report_path = report.get_path() report_path = report.get_path()
@@ -59,9 +58,8 @@ if __name__ == "__main__":
report.set_title("Banner Title One") report.set_title("Banner Title One")
report.build_banner() report.build_banner()
# report.set_title("Banner Title Two")
#report.set_title("Banner Title Two") # report.build_banner()
#report.build_banner()
report.set_table_title("Title One") report.set_table_title("Title One")
report.build_table_title() report.build_table_title()
@@ -76,21 +74,20 @@ if __name__ == "__main__":
report.build_table() report.build_table()
# test lf_graph in report # test lf_graph in report
dataset = [[45,67,34,22],[22,45,12,34],[30,55,69,37]] dataset = [[45, 67, 34, 22], [22, 45, 12, 34], [30, 55, 69, 37]]
x_axis_values = [1,2,3,4] x_axis_values = [1, 2, 3, 4]
report.set_graph_title("Graph Title") report.set_graph_title("Graph Title")
report.build_graph_title() report.build_graph_title()
graph = lf_bar_graph(_data_set=dataset,
_xaxis_name="stations",
_yaxis_name="Throughput 2 (Mbps)",
_xaxis_categories=x_axis_values,
_graph_image_name="Bi-single_radio_2.4GHz",
_label=["bi-downlink", "bi-uplink",'uplink'],
_color=None,
_color_edge='red')
graph = lf_bar_graph(_data_set=dataset,
_xaxis_name="stations",
_yaxis_name="Throughput 2 (Mbps)",
_xaxis_categories=x_axis_values,
_graph_image_name="Bi-single_radio_2.4GHz",
_label=["bi-downlink", "bi-uplink", 'uplink'],
_color=None,
_color_edge='red')
graph_png = graph.build_bar_graph() graph_png = graph.build_bar_graph()
@@ -103,7 +100,7 @@ if __name__ == "__main__":
report.build_graph() report.build_graph()
set1 = [1, 2, 3, 4] set1 = [1, 2, 3, 4]
set2 = [[45, 67, 45, 34], [34, 56, 45, 34], [45, 78, 23, 45]] set2 = [[45, 67, 45, 34], [34, 56, 45, 34], [45, 78, 23, 45]]
graph2 = lf_scatter_graph(_x_data_set=set1, _y_data_set=set2, _xaxis_name="x-axis", _values = None, graph2 = lf_scatter_graph(_x_data_set=set1, _y_data_set=set2, _xaxis_name="x-axis", _values=None,
_yaxis_name="y-axis", _yaxis_name="y-axis",
_graph_image_name="image_name1", _graph_image_name="image_name1",
_color=None, _color=None,
@@ -117,7 +114,8 @@ if __name__ == "__main__":
report.build_graph() report.build_graph()
# this will generate graph which is independent,we can customize the value with different colors # this will generate graph which is independent,we can customize the value with different colors
graph2 = lf_scatter_graph(_x_data_set=set1, _y_data_set=[45, 67, 45, 34], _values=[0 , 0, 0, 1], _xaxis_name="x-axis", graph2 = lf_scatter_graph(_x_data_set=set1, _y_data_set=[45, 67, 45, 34], _values=[0, 0, 0, 1],
_xaxis_name="x-axis",
_yaxis_name="y-axis", _yaxis_name="y-axis",
_graph_image_name="image_name_map", _graph_image_name="image_name_map",
_color=None, _color=None,
@@ -146,18 +144,16 @@ if __name__ == "__main__":
report.move_graph_image() report.move_graph_image()
report.build_graph() report.build_graph()
graph = lf_horizontal_stacked_graph(_seg=2,
_yaxis_set=('A', 'B'),
graph = lf_horizontal_stacked_graph(_seg= 2, _xaxis_set1=[12, 65],
_yaxis_set=('A','B'), _xaxis_set2=[23, 34],
_xaxis_set1=[12, 65], _unit="",
_xaxis_set2=[23, 34], _xaxis_name="Stations",
_unit="", _label=['Success', 'Fail'],
_xaxis_name="Stations", _graph_image_name="image_name_pass_fail",
_label=['Success', 'Fail'], _color=["r", "g"],
_graph_image_name="image_name_pass_fail", _figsize=(9, 4))
_color=["r", "g"],
_figsize=(9, 4))
graph_png = graph.build_horizontal_stacked_graph() graph_png = graph.build_horizontal_stacked_graph()
@@ -166,17 +162,17 @@ if __name__ == "__main__":
report.set_graph_image(graph_png) report.set_graph_image(graph_png)
report.move_graph_image() report.move_graph_image()
report.build_graph() report.build_graph()
#report.build_all() # report.build_all()
html_file = report.write_html() html_file = report.write_html()
print("returned file {}".format(html_file)) print("returned file {}".format(html_file))
print(html_file) print(html_file)
# try other pdf formats # try other pdf formats
#report.write_pdf() # report.write_pdf()
#report.write_pdf(_page_size = 'A3', _orientation='Landscape') # report.write_pdf(_page_size = 'A3', _orientation='Landscape')
#report.write_pdf(_page_size = 'A4', _orientation='Landscape') # report.write_pdf(_page_size = 'A4', _orientation='Landscape')
report.write_pdf(_page_size = 'Legal', _orientation='Landscape') report.write_pdf(_page_size='Legal', _orientation='Landscape')
#report.write_pdf(_page_size = 'Legal', _orientation='Portrait') # report.write_pdf(_page_size = 'Legal', _orientation='Portrait')
#report.generate_report() # report.generate_report()