Skip to content

Commit 766fa52

Browse files
committed
Merge pull request #2 from prajul07/master
Fix to generate report with that 2000 Records
2 parents b969ac1 + 6f55b30 commit 766fa52

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

web_printscreen_zb/__openerp__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
{
2424
'name': 'Web Printscreen ZB',
25-
'version': '1.3',
25+
'version': '1.4',
2626
'category': 'Web',
2727
'description': """
2828
Module to export current active tree view in to excel report

web_printscreen_zb/controllers.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,22 +59,25 @@ def from_data(self, fields, rows):
5959
else:
6060
count += 1
6161
ignore_index.append(i)
62+
style = xlwt.easyxf('align: wrap yes')
63+
bold_style = xlwt.easyxf('align: wrap yes')
64+
font = xlwt.Font()
65+
font.bold = True
66+
bold_style.font = font
6267
for row_index, row in enumerate(rows):
6368
count = 0
6469
for cell_index, cell_value in enumerate(row):
6570
if cell_index not in ignore_index:
66-
style = xlwt.easyxf('align: wrap yes')
71+
cell_style = style
6772
if cell_value.get('bold', False):
68-
font = xlwt.Font()
69-
font.bold = True
70-
style.font = font
73+
cell_style = bold_style
7174
cellvalue = cell_value.get('data', '')
7275
if isinstance(cellvalue, basestring):
7376
cellvalue = re.sub("\r", " ", cellvalue)
7477
if cell_value.get('number', False) and cellvalue:
7578
cellvalue = float(cellvalue)
7679
if cellvalue is False: cellvalue = None
77-
worksheet.write(row_index + 1, cell_index - count, cellvalue, style)
80+
worksheet.write(row_index + 1, cell_index - count, cellvalue, cell_style)
7881
else:
7982
count += 1
8083
fp = StringIO()

0 commit comments

Comments
 (0)