Everything seems to be working. Selecting the client and hitting the submit button runs the report for the select client and downloads the report as *clientname*+*datetime+report.xlsx.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
from app import app
|
||||
from flask import render_template, request, redirect, url_for
|
||||
from flask import render_template, request, redirect, url_for, send_file
|
||||
from main import *
|
||||
import datetime
|
||||
|
||||
@app.route('/')
|
||||
@app.route('/index')
|
||||
@@ -34,6 +35,16 @@ def runReport():
|
||||
ws = ClientConfig[9]
|
||||
ws2 = ClientConfig[10]
|
||||
|
||||
ticket = Obtain_Ticket(SF_URL, SF_HOST)
|
||||
|
||||
Run_Report(ticket, SF_URL, SF_HOST, REPORT_FIELDS, wb, ws, ws2, DETAIL_REPORT_FIELDS, summary_columnformat, headers[0],
|
||||
detail_columnformat, detail_headers[0])
|
||||
|
||||
return(str(client),SF_URL,SF_HOST,REPORT_FIELDS,DETAIL_REPORT_FIELDS,summary_columnformat,headers,detail_columnformat,detail_headers,wb, ws, ws2 )
|
||||
Release_Ticket(ticket, SF_URL, SF_HOST)
|
||||
|
||||
date = datetime.datetime.now()
|
||||
filename = str(client) + str(date) + "_report.xlsx"
|
||||
|
||||
return send_file('report.xlsx', as_attachment=True, attachment_filename = filename)
|
||||
|
||||
#return(str(client),SF_URL,SF_HOST,REPORT_FIELDS,DETAIL_REPORT_FIELDS,summary_columnformat,headers,detail_columnformat,detail_headers,wb, ws, ws2 )
|
||||
|
||||
Reference in New Issue
Block a user