Broke report appending into a separate function/file. Started working on Column Format Checking Function
This commit is contained in:
31
WriteReport.py
Normal file
31
WriteReport.py
Normal file
@@ -0,0 +1,31 @@
|
||||
def Write_Report(y, ws, columnFormat, SSheader):
|
||||
results = []
|
||||
|
||||
count = 0
|
||||
for child in y.report:
|
||||
for childs in child:
|
||||
print(columnFormat[SSheader[count]])
|
||||
count = count + 1
|
||||
if '$' in childs.text:
|
||||
convert = childs.text
|
||||
apply = convert[1:]
|
||||
results.append(float(apply.replace(',', '')))
|
||||
else:
|
||||
results.append(childs.text)
|
||||
ws.append(results)
|
||||
results = []
|
||||
count = 0
|
||||
|
||||
def Detail_Write_Report(y, ws):
|
||||
results = []
|
||||
|
||||
for child in y.report:
|
||||
for childs in child:
|
||||
if '$' in childs.text:
|
||||
convert = childs.text
|
||||
apply = convert[1:]
|
||||
results.append(float(apply.replace(',', '')))
|
||||
else:
|
||||
results.append(childs.text)
|
||||
ws.append(results)
|
||||
results = []
|
||||
Reference in New Issue
Block a user