コード例 #1
0
        public void TestLibraryReport()
        {
            XmlProvider xmlHelper = new XmlProvider();
            Library lib = xmlHelper.Load(MakePathUIContent("Libraries\\Sasquatch.ssx"));

            LibraryReport rpt = new LibraryReport(lib, new StaticImage(ResourceController.Singleton.GetInstance("default"), new VectorInt(16,16)),@".");
            rpt.BuildReport();
            rpt.Save(@"library.html");
        }
コード例 #2
0
        /// <summary>
        /// Do the work.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void buttonOk_Click(object sender, EventArgs e)
        {
            // Anything to do?
            if (string.IsNullOrEmpty(tbFileName.Text)) return;

            // Build the HTML
            LibraryReport rpt = new LibraryReport(library, DrawingHelper.Images, Path.GetDirectoryName(tbFileName.Text));
            rpt.OptionImages = GetImageOptions();
            rpt.OptionCSS = GetCSSOptions();

            // Set inline CSS?
            if (rbCSSInline.Checked)
            {
                rpt.SetCSSInline(FileManager.GetContent("$html\\reportstyle.css"));
            }

            // Create and write to disk
            rpt.BuildReport();
            rpt.Save(tbFileName.Text);

            // Copy inline images
            if (rbImageTableCell.Checked && cbCopyStatic.Checked)
            {
                FileHelper.CopyDirectory(FileManager.GetContent("$Graphics\\ReportImages"), Path.GetDirectoryName(tbFileName.Text) + "\\images\\");
            }

            // Copy style.css file to destination
            if (rbCSSCopy.Checked)
            {
                string destCSS = Path.GetDirectoryName(tbFileName.Text) + "\\style.css";
                if (!File.Exists(destCSS))
                {
                    File.Copy(FileManager.GetContent("$html\\reportstyle.css"), destCSS);
                }
            }

            // Show the results in browser
            if (cbShowInBrowser.Checked)
            {
                Process.Start(tbFileName.Text);
            }
        }