Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -226,6 +226,7 @@ def main():
|
|
| 226 |
time.sleep(0.5)
|
| 227 |
st.session_state.results = results
|
| 228 |
|
|
|
|
| 229 |
# Display Results
|
| 230 |
if 'results' in st.session_state:
|
| 231 |
st.subheader("📊 Analysis Results")
|
|
@@ -254,16 +255,19 @@ def main():
|
|
| 254 |
</div>
|
| 255 |
""", unsafe_allow_html=True)
|
| 256 |
|
| 257 |
-
|
| 258 |
-
|
| 259 |
-
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
|
| 265 |
-
|
| 266 |
-
|
|
|
|
|
|
|
|
|
|
| 267 |
|
| 268 |
st.markdown("---")
|
| 269 |
st.markdown("""
|
|
|
|
| 226 |
time.sleep(0.5)
|
| 227 |
st.session_state.results = results
|
| 228 |
|
| 229 |
+
|
| 230 |
# Display Results
|
| 231 |
if 'results' in st.session_state:
|
| 232 |
st.subheader("📊 Analysis Results")
|
|
|
|
| 255 |
</div>
|
| 256 |
""", unsafe_allow_html=True)
|
| 257 |
|
| 258 |
+
# Display result
|
| 259 |
+
# Generate and download PDF report only if results are present
|
| 260 |
+
if results: # Check if results are not empty
|
| 261 |
+
pdf_report = generate_pdf_report(results)
|
| 262 |
+
with open(pdf_report, "rb") as f:
|
| 263 |
+
st.download_button(
|
| 264 |
+
label="Download PDF Report",
|
| 265 |
+
data=f,
|
| 266 |
+
file_name="requirements_report.pdf",
|
| 267 |
+
mime="application/pdf"
|
| 268 |
+
)
|
| 269 |
+
else:
|
| 270 |
+
st.warning("⚠️ No results to generate a PDF report.")
|
| 271 |
|
| 272 |
st.markdown("---")
|
| 273 |
st.markdown("""
|