Пример #1
0
        public bool Export(TaskList tasks, string destFilePath, bool silent, Preferences prefs, string sKey)
        {
            if (!InitConsts(tasks, destFilePath, silent, prefs, sKey))
            {
                return(false);
            }

            try
            {
                using (var file = new System.IO.StreamWriter(destFilePath))
                {
                    using (var html = new HtmlTextWriter(file))
                    {
                        var report = new HtmlReportBuilder(tasks, m_Template, prefs, false);

                        return(report.BuildReport(html));
                    }
                }
            }
            catch (Exception /*e*/)
            {
            }

            return(false);
        }
        public bool Export(TaskList tasks, string destFilePath, bool silent, Preferences prefs, string sKey)
        {
            if (!InitConsts(tasks, destFilePath, silent, prefs, sKey))
            {
                return(false);
            }

            var report = new HtmlReportBuilder(m_Trans, tasks, prefs, m_Template, false);

            return(report.BuildReport(destFilePath));
        }
        private void RefreshPreview()
        {
            try
            {
                String previewPath = Path.Combine(Path.GetTempPath(), "HtmlReporterPreview.html");

                using (var file = new StreamWriter(previewPath))
                {
                    using (var html = new HtmlTextWriter(file))
                    {
                        var report = new HtmlReportBuilder(m_Tasklist, m_Template, m_Prefs, true);

                        report.BuildReport(html);
                    }
                }

                browserPreview.Navigate(new System.Uri(previewPath));
            }
            catch (Exception /*e*/)
            {
            }
        }
Пример #4
0
        private String BuildPreviewPage()
        {
            try
            {
                String previewPath = Path.Combine(Path.GetTempPath(), PreviewPageName);

                using (var file = new StreamWriter(previewPath))
                {
                    using (var html = new HtmlTextWriter(file))
                    {
                        var report = new HtmlReportBuilder(m_Trans, m_Tasklist, m_Prefs, m_Template, true);

                        report.BuildReport(html);
                    }
                }

                return(previewPath);
            }
            catch (Exception /*e*/)
            {
            }

            return(String.Empty);
        }
        private bool BuildPreviewPage()
        {
            var report = new HtmlReportBuilder(m_Trans, m_Tasklist, m_Prefs, m_Template, true);

            return(report.BuildReport(PreviewPageName));
        }