public virtual FileContentResult DownloadPDF(Guid id) { var flightLog = Repository.Get<FlightLog>(id); var reportGenerator = new PdfReportGenerator(new FlightTimeSummaryReport(flightLog)); var bytes = reportGenerator.GenerateReport(); return File(bytes, "application/pdf", "FlightTimeSummary(" + flightLog.LogDate.ToString("MM-dd-yy") + ").pdf"); }
public void Should_Generate_XSLFO() { var xslfo = new PdfReportGenerator(new FlightTimeSummaryReport(CreateFlightLog())).GenerateXslFo(); Console.Out.WriteLine(xslfo.ToString()); }
public void Should_Generate_PDF() { var bytes = new PdfReportGenerator(new FlightTimeSummaryReport(CreateFlightLog())).GenerateReport(); var fileName = Path.GetTempFileName() + ".pdf"; File.WriteAllBytes(fileName, bytes); Process.Start(fileName); }
public void Should_Generate_XML() { var xml = new PdfReportGenerator(new FlightTimeSummaryReport(CreateFlightLog())).GenerateXml(); Console.Out.WriteLine(xml.ToString()); }