public void GenerateReport(string reportPath) { IDataProvider <User> provider = MockStaticProvider.GetUserDataProvider(); DataTable table = SetColumns(); IEnumerable <User> usersInReport = GetData(provider); ProcessData(table, usersInReport); XLWorkbook reportWorkBook = new XLWorkbook(); reportWorkBook.AddWorksheet(table); reportWorkBook.SaveAs(reportPath); DataSet resultSet = new DataSet(); resultSet.Tables.Add(table); resultSet.WriteXml("report.xml"); System.IO.File.WriteAllText("report.json", JsonConvert.SerializeObject(resultSet, Formatting.Indented)); }
public virtual void GetData() { IDataProvider <User> provider = MockStaticProvider.GetUserDataProvider(); RawData = provider.GetData(user => user.Id > 0); }