Beispiel #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            // A path to export a report.
            string reportPath = "c:\\Test.mht";

            // Create a report instance.
            XtraReport1 report = new XtraReport1();

            // Get its MHT export options.
            MhtExportOptions mhtOptions = report.ExportOptions.Mht;

            // Set MHT-specific export options.
            mhtOptions.CharacterSet           = "UTF-8";
            mhtOptions.RemoveSecondarySymbols = false;
            mhtOptions.Title = "Test Title";

            // Set the pages to be exported, and page-by-page options.
            mhtOptions.ExportMode      = HtmlExportMode.SingleFilePageByPage;
            mhtOptions.PageRange       = "1, 3-5";
            mhtOptions.PageBorderColor = Color.Blue;
            mhtOptions.PageBorderWidth = 3;

            // Export the report to MHT.
            report.ExportToMht(reportPath);

            // Show the result.
            StartProcess(reportPath);
        }
Beispiel #2
0
        private void ExportChartToMHT(ChartControl chart)
        {
            // Create an object containing MHT export options.
            MhtExportOptions mhtOptions = new MhtExportOptions();

            // Specify print size mode.
            PrintSizeMode sizeMode = PrintSizeMode.ProportionalZoom;

            // Export a chart to a stream as MHT.
            FileStream mhtStream = new FileStream("OutputDefault.mht", FileMode.Create);

            chart.ExportToMht(mhtStream, mhtOptions, sizeMode);
            Process.Start("OutputDefault.mht");
        }
Beispiel #3
0
 public void ExportToMht(Stream stream, MhtExportOptions options)
 {
     report.ExportToMht(stream, options);
 }