Skip to content

Question: how to change file name and sheet name? #5

@furins

Description

@furins

hello, I'm giving a try to the library but I can't find any hint on how to change

  1. the response filename (in chrome the file is named download with no extension)
  2. the sheet name (it's pyexcel_sheet1)

how can I customize these two aspects?
thanks in advance!


here is my view's code:

def exportExcel(request):
    qs = MyModel.objects.all()
    column_names = ['a', 'b']
    sheet = excel.pe.get_sheet(query_sets=qs, column_names=column_names)
    sheet.row[0] = ["a", "b"]
    return excel.make_response(sheet, 'xls')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions