public static FileInfo GetHtmlFormattedReport(string sessionId, bool condensed) { IDiskCacheGroup group = GetReportCacheGroup(sessionId); string directory = condensed ? "Condensed" : "Full"; FileInfo htmlReportFile = group.GetFileInfo(Path.Combine(directory, HtmlReportFileName)); if (!htmlReportFile.Exists) { Report report = LoadSerializedReport(sessionId); if (report == null) { return(null); } group.CreateSubdirectory(directory); IReportManager reportManager = RuntimeAccessor.ServiceLocator.Resolve <IReportManager>(); FileSystemReportContainer reportContainer = new FileSystemReportContainer(htmlReportFile.DirectoryName, ReportBaseName); IReportWriter reportWriter = reportManager.CreateReportWriter(report, reportContainer); var reportFormatterOptions = new ReportFormatterOptions(); reportManager.Format(reportWriter, condensed ? "Html-Condensed" : "Html", reportFormatterOptions, NullProgressMonitor.CreateInstance()); } return(htmlReportFile); }
public ReportFilePool(IDiskCacheGroup cacheGroup, int numberOfFiles) { for (var i = 0; i < numberOfFiles; i++) { var uniqueFilename = string.Format("{0}.{1}.html", ReportName, Hash64.CreateUniqueHash()); files.Add(cacheGroup.GetFileInfo(uniqueFilename)); } }
public static bool HasSerializedReport(string sessionId) { IDiskCacheGroup group = GetReportCacheGroup(sessionId); return(group.Exists && group.GetFileInfo(SerializedReportFileName).Exists); }