0
votes

Good Day! is there a way to create a customized Excel File Export without Jasper, Aeroo reporting in Odoo8, I think the XLWT library can be used but I dont have any idea, is there someone who encounter this problem Thanks

1

1 Answers

0
votes

You need to use xlwt module. It works fine for our need. Only caveat is for now it only export to Excel 97 format (xls extention). Maybe it can export in Excel 2003 or later (xlxs extention), but we never tried. import xlwt

    ezxf = xlwt.easyxf
    styles = self.get_easyxf_styles()

    book = xlwt.Workbook(encoding='utf8')
    sheet = book.add_sheet('Generic Journal Ledger')
    sheet.portrait = False
    sheet.write_merge(rowx, rowx + 2, 0, 0, u'Number', styles['heading_xf'])
    sheet.write_merge(rowx, rowx + 2, 1, 1, u'Journal', styles['heading_xf'])
    sheet.write_merge(rowx, rowx + 2, 2, 2, u'Period', styles['heading_xf'])
    sheet.write_merge(rowx, rowx + 2, 3, 3, u'Date', styles['heading_xf'])
    return {'data':book, 'directory_name':u'General ledger',
            'attache_name':u'General ledger'}