Ejemplo n.º 1
0
        /// <inheritdoc />
        public override void Format(IReportWriter reportWriter, ReportFormatterOptions formatterOptions, IProgressMonitor progressMonitor)
        {
            using (progressMonitor.BeginTask("Formatting report.", 10))
            {
                using (MultipartMimeReportContainer archiveContainer = new MultipartMimeReportContainer(reportWriter.ReportContainer))
                {
                    string archivePath = archiveContainer.ReportName + ".mht";
                    reportWriter.AddReportDocumentPath(archivePath);

                    archiveContainer.OpenArchive(archivePath);
                    progressMonitor.Worked(0.5);

                    DefaultReportWriter archiveWriter = new DefaultReportWriter(reportWriter.Report, archiveContainer);
                    using (IProgressMonitor subProgressMonitor = progressMonitor.CreateSubProgressMonitor(9))
                        htmlReportFormatter.Format(archiveWriter, formatterOptions, subProgressMonitor);

                    archiveContainer.CloseArchive();
                    progressMonitor.Worked(0.5);
                }
            }
        }
Ejemplo n.º 2
0
        /// <inheritdoc />
        public override void Format(IReportWriter reportWriter, ReportFormatterOptions formatterOptions, IProgressMonitor progressMonitor)
        {
            using (progressMonitor.BeginTask("Formatting report.", 10))
            {
                using (MultipartMimeReportContainer archiveContainer = new MultipartMimeReportContainer(reportWriter.ReportContainer))
                {
                    string archivePath = archiveContainer.ReportName + ".mht";
                    reportWriter.AddReportDocumentPath(archivePath);

                    archiveContainer.OpenArchive(archivePath);
                    progressMonitor.Worked(0.5);

                    DefaultReportWriter archiveWriter = new DefaultReportWriter(reportWriter.Report, archiveContainer);
                    using (IProgressMonitor subProgressMonitor = progressMonitor.CreateSubProgressMonitor(9))
                        htmlReportFormatter.Format(archiveWriter, formatterOptions, subProgressMonitor);

                    archiveContainer.CloseArchive();
                    progressMonitor.Worked(0.5);
                }
            }
        }