Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions SNPedia/SnpApi.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,12 @@ def create_file():
bytesIO.write(filecontents)
bytesIO.seek(0)

return send_file(bytesIO,
attachment_filename=filename,
as_attachment=True)
return send_file(
bytesIO,
download_name=filename,
as_attachment=True,
mimetype="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
)


@app.route('/images/<path:path>')
Expand Down
21 changes: 10 additions & 11 deletions SNPedia/templates/snp_resource.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@
var grid1 = $("#grid").data("kendoGrid");
oldPageSize = grid1.dataSource.pageSize();
grid1.dataSource.pageSize(grid1.dataSource.data().length);
grid1.saveAsExcel()
grid1.saveAsExcel();
grid1.dataSource.pageSize(oldPageSize);
};

$(window).resize(function () {
Expand All @@ -86,19 +87,17 @@
$(document).ready(function () {

$("#grid").kendoGrid({
toolbar: [{
name: 'exportExcel1',
template: '#= exportExcel()#',
},
{
name: 'lookupsnp',
template: '#= snplookup()#'
}
toolbar: [
{ name: 'excel', text: 'Export to Excel' },
{
name: 'lookupsnp',
template: '#= snplookup()#'
}
],
excel: {
fileName: "SNP Report.xlsx",
fileName: "SNP_Report.xlsx",
proxyURL: "/excel",
filterable: true
forceProxy: true
},

dataSource: {
Expand Down