Summary
I am trying to export my streamlit app to pdf though native print->save as pdf option.
However, this option produce some artifacts as seen below. Any suggestions how to fix it?
I am trying to export my streamlit app to pdf though native print->save as pdf option.
However, this option produce some artifacts as seen below. Any suggestions how to fix it?
Hi @kawanovs
Could you share code snippet for reproducing the issue faced, which would be helpful for the community in seeing the code and help with debugging.
Hi @dataprofessor ,
Please see the code snippet below. I have made a simple case to replicate given behavior. Commenting st.sidebar.success will fix the issue.
class DailyReport:
__version__ = "0.1"
__name__ = "Daily Report"
def __init__(self):
st.set_page_config(page_title=f'{self.__name__} {self.__version__}',
page_icon="📊",
layout="wide",
initial_sidebar_state="collapsed")
allow_scroll = """
<style>
.stApp{ position: relative !important;}
.appview-container{ position: relative !important;}
</style>
"""
st.markdown(allow_scroll, unsafe_allow_html=True)
self.database = DatabaseUtilities()
def header(self):
st.markdown("""
<h1 style='text-align: center; margin-bottom: -35px;'>
Daily reporting
</h1>""", unsafe_allow_html=True)
def run(self):
self.header()
class DatabaseUtilities:
def __init__(self):
self.mode = self.check_connection()
def check_connection(self):
try:
st.sidebar.success("Database connection is active.")
return 'SQL'
except OperationalError:
st.sidebar.error("Database connection is not active.")
return 'Local'
DailyReport().run()
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.