Update app.py
Browse files
app.py
CHANGED
|
@@ -288,20 +288,11 @@ def main():
|
|
| 288 |
report = response.text
|
| 289 |
|
| 290 |
try:
|
| 291 |
-
|
| 292 |
-
pdf.meta["title"] = 'Surburb Business Report'
|
| 293 |
-
pdf.add_section(Section(Report, toc=False))
|
| 294 |
-
pdf.save('report.pdf')
|
| 295 |
-
st.download_button(
|
| 296 |
-
label="Download Report as PDF",
|
| 297 |
-
data=pdf_bytes,
|
| 298 |
-
file_name="report.pdf",
|
| 299 |
-
mime="application/pdf"
|
| 300 |
-
)
|
| 301 |
st.markdown(report) # Display the report below the download button
|
| 302 |
except Exception as e:
|
| 303 |
-
st.error(f"Error generating
|
| 304 |
-
|
| 305 |
else:
|
| 306 |
st.error("No data available for reports.")
|
| 307 |
|
|
|
|
| 288 |
report = response.text
|
| 289 |
|
| 290 |
try:
|
| 291 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 292 |
st.markdown(report) # Display the report below the download button
|
| 293 |
except Exception as e:
|
| 294 |
+
st.error(f"Error generating report {e}")
|
| 295 |
+
# Fallback to displaying report in markdown if PDF fails
|
| 296 |
else:
|
| 297 |
st.error("No data available for reports.")
|
| 298 |
|