private void monthly_equipment_allocation_report_menu_Click(object sender, RoutedEventArgs e) { try { //string filePath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop); //if (DBManager.ExportToPdf(DBManager.SelectForMonthlyEquipmentAllocationReport(), filePath + "\\Monthly Allocation report.pdf")) //{ // MessageBox.Show("Succefully written to " + filePath + "\\Monthly Allocation report.pdf", "Success", MessageBoxButton.OK, MessageBoxImage.Information); //} //else //{ // MessageBox.Show("Error Occured when Creating the pdf", "Error", MessageBoxButton.OK, MessageBoxImage.Error); //} if (Home.printDatatableToExcel("Monthly Equipment Allocation", "allocated_items", DBManager.SelectForMonthlyEquipmentAllocationReport())) { myMessageBox mm = new myMessageBox("Exported to Excel Successfully", "Success", "Ok", 0); mm.ShowDialog(); } else { myMessageBox mm = new myMessageBox("Error Occured", "Error", "Ok", 1); mm.ShowDialog(); } } catch { } }