How to show excel workbook in the django web application before downloading?

I want to display excel sheet in web application (in the same format like pdf or any other format) before downloading.AS per my current code, excel sheet is downloading to my system.


from io import BytesIO as IO
import xlsxwriter
from django.http import HttpResponse

def export_page(request):
    excel_file = IO()
    workbook = xlsxwriter.Workbook(excel_file, {'in_memory': True})
    worksheet = workbook.add_worksheet()
    worksheet.write('A1', 'Some Data')
    response = HttpResponse(,
    response['Content-Disposition'] = 'attachment; filename="Report.xlsx"'
    return response

Can anyone suggest a solution to show the excel sheet in web page using Django?

Back to Top