static int Main(string[] args) { if (args.Length < 1) { Console.WriteLine("Usage: ExcelReport.exe <outputfilename.xlsx>"); return(1); } string targetFileName = args[0]; if (File.Exists(targetFileName)) { File.Delete(targetFileName); } using (UsageDataAnalysisEntities context = new UsageDataAnalysisEntities()) { ReportRepository r = new ReportRepository(context); r.MinimumDate = new DateTime(2009, 11, 1); r.MinimumVersion = new Version(4, 0, 0, 1); Console.WriteLine("Loading excel..."); using (ExcelWorkbook workbook = new ExcelWorkbook()) { CreateExceptionDetails(workbook, r); CreateExceptionList(workbook, r); CreateEnvironment(workbook, r); CreateUsageSheet(workbook, r); workbook.Save(targetFileName); } } return(0); }
public ReportRepository(UsageDataAnalysisEntities context) { if (context == null) { throw new ArgumentNullException("context"); } this.context = context; }
public ReportRepository() { this.context = new UsageDataAnalysisEntities(); }