public void ExportDailyData(Statement statement) { foreach (DailyExpense dailyExpense in statement.MonthlyExpense.DailyExpenseList) { int sheetname = dailyExpense.Day; WorkBook.AddWorksheet(sheetname.ToString()); WorkSheet = WorkBook.Worksheet(sheetname.ToString()); int row = 1; foreach (ItemExpense itemExpense in dailyExpense.ItemExpenses) { WorkSheet.Cell("A" + row).Value = itemExpense.ItemName; WorkSheet.Cell("B" + row).Value = (int)itemExpense.Cost; row++; } WorkSheet.Cell("A" + row).Value = "Total="; WorkSheet.Cell("B" + row).Value = (int)dailyExpense.Total; } Save(); }