How to create an Excel sheet using xlwt in django

118 views Asked by At

enter image description hereI want to create an excel file like below.But I do not know , how to implement it.Excel sheet contains headers,sub headers and sub-sub headers.

Actually the excel sheet is generated based on the from date and to date.If there is three months between from date and to date,these three months should be shown as columns in the excel sheet.

        from_date = request.POST.get('f_date')
        to_date = request.POST.get('t_date')
        file_name = "Report"
        content_disposition = 'attachment; filename="' + file_name + '.xlsx"'
        title = str(file_name) + " {} TO {}".format(from_date, to_date)

        header = ['Plant Locality', 'Plant', 'Product', 'UOM', 'Previous Year FTP', 'Previous Year YTP']

Can anyone suggest a solution to create this excel sheet using xlwt?

0

There are 0 answers