using AsbCloudApp.Data.DailyReport; using ClosedXML.Excel; using System; using System.IO; namespace ConsoleApp1 { class Program { // use ServiceFactory to make services static void Main(/*string[] args*/) { var block = new DailyReportHeadDto() { AzimuthAngle = 12, WellName = "WellName", ClusterName = "clusterName", Customer = "customer", Contractor = "Contractor", ReportDate = DateTime.Now, WellDepthIntervalFinishDate = 27.5, WellDepthIntervalStartDate = 26.5, BottomholeDepth = 66.6 }; var block2 = new DailyReportBhaDto() { BHADescription = "sadasdasdasdasdasdjlaskjdaksjdlasdlalskdklj" }; var block3 = new DailyReportTimeBalanceDto(); /* var service = new DailyReportMakerExcel(); var stream = service.MakeReportFromBlocks(block, block2, block3,null, null, null); var filename = "____.xlsx"; if (File.Exists(filename)) File.Delete(filename); using var fileStream = File.OpenWrite(filename); stream.CopyTo(fileStream); return; */ //var ms = MakeReportFromBlocks(block,block3); ////File.Create("", MakeReportFromBlocks(block)); //using var file = new FileStream("file.xlsx", FileMode.Create, System.IO.FileAccess.Write); //byte[] bytes = new byte[ms.Length]; //ms.Read(bytes, 0, (int)ms.Length); //file.Write(bytes, 0, bytes.Length); //ms.Close(); } } }