Beispiel #1
0
 def create_report_and_update_filename(self, event=None):
     try:
         MIS_Database_Functions.generate_csv_report()
         self.filename = (
             str(os.getcwd())
             + "\\Reports\\"
             + MIS_Database_Functions.get_most_recent_event_date()
             + "_Attendance_Report.csv"
         )
         self.feedback_label.config(style="SuccessLabel.TLabel")
         self.feedback_label["text"] = "Report File Created Successfully.\nReview for accuracy."
     except PermissionError:
         self.feedback_label.config(style="ErrorLabel.TLabel")
         self.feedback_label["text"] = (
             "There is an issue with file permissions.\n"
             "Make sure the file is not open.\n"
             "If the problem persistsContact the Tech Director."
         )
     except OSError:
         self.feedback_label.config(style="ErrorLabel.TLabel")
         self.feedback_label["text"] = (
             "There was an issue with the operating system call.\n" "Try again or contact the Technical Director."
         )
     except TypeError:
         self.feedback_label.config(style="ErrorLabel.TLabel")
         self.feedback_label["text"] = (
             "The file was not created, likely because there was\n" "no data to put into the report."
         )