diff --git a/src/vuegen/streamlit_reportview.py b/src/vuegen/streamlit_reportview.py index 69ce63a..22da703 100644 --- a/src/vuegen/streamlit_reportview.py +++ b/src/vuegen/streamlit_reportview.py @@ -755,14 +755,14 @@ def _generate_dataframe_content(self, dataframe) -> List[str]: r.DataFrameFormat.XLSX.value_with_dot, ]: dataframe_content.append("selected_sheet = 0") - sheet_names = table_utils.get_sheet_names(dataframe.file_path) + sheet_names = table_utils.get_sheet_names(df_file_path.as_posix()) if len(sheet_names) > 1: # If there are multiple sheets, ask the user to select one dataframe_content.append( textwrap.dedent( f"""\ - sheet_names = table_utils.get_sheet_names("{dataframe.file_path}") + sheet_names = table_utils.get_sheet_names("{df_file_path.as_posix()}") selected_sheet = st.selectbox("Select a sheet to display", options=sheet_names) """ ) @@ -775,7 +775,7 @@ def _generate_dataframe_content(self, dataframe) -> List[str]: r.DataFrameFormat.XLSX.value_with_dot, ]: dataframe_content.append( - f"""df = pd.{read_function.__name__}('{dataframe.file_path}', sheet_name=selected_sheet)\n""" + f"""df = pd.{read_function.__name__}('{df_file_path.as_posix()}', sheet_name=selected_sheet)\n""" ) else: dataframe_content.append( diff --git a/tests/report_examples/Basic_example_vuegen_demo_notebook/streamlit_report/sections/Dataframes/All_Formats.py b/tests/report_examples/Basic_example_vuegen_demo_notebook/streamlit_report/sections/Dataframes/All_Formats.py index a26eb0a..5d60849 100644 --- a/tests/report_examples/Basic_example_vuegen_demo_notebook/streamlit_report/sections/Dataframes/All_Formats.py +++ b/tests/report_examples/Basic_example_vuegen_demo_notebook/streamlit_report/sections/Dataframes/All_Formats.py @@ -30,10 +30,10 @@ df_index += 1 st.markdown('''