public void GenerateReport(string path) { string tableName = "reports"; string sheetName = "Sheet1"; var data = this.mySqlHandler.ReadTable(tableName); excelHandler.TransferToExcel(data, path, sheetName); }
public static void TransferSQLiteData() { string path = @"..\..\..\Excel-Reports\{0}.xlsx"; string dbPath = @"..\..\..\..\SQLiteDB\ComputersFactory.db"; var excelHandler = new ExcelHandler(); excelHandler.TransferToExcel(ReadTable(dbPath, "Computers"), string.Format(path, "Computers"), "Sheet1"); excelHandler.TransferToExcel(ReadTable(dbPath, "Manufacturers"), string.Format(path, "Manufacturers"), "Sheet1"); excelHandler.TransferToExcel(ReadTable(dbPath, "ComputerTypes"), string.Format(path, "ComputerTypes"), "Sheet1"); excelHandler.TransferToExcel(ReadTable(dbPath, "Memories"), string.Format(path, "Memories"), "Sheet1"); excelHandler.TransferToExcel(ReadTable(dbPath, "Processors"), string.Format(path, "Processors"), "Sheet1"); excelHandler.TransferToExcel(ReadTable(dbPath, "VideoCards"), string.Format(path, "VideoCards"), "Sheet1"); }