Exemplo n.º 1
0
 // show cool print preview
 void button2_Click(object sender, EventArgs e)
 {
     using (var dlg = new CoolPrintPreviewDialog())
     {
         dlg.Document = this.printDocument1;
         dlg.ShowDialog(this);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Print
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void menuItem1_Click(object sender, EventArgs e)
        {
            object misValue = System.Reflection.Missing.Value;
            Microsoft.Office.Interop.Excel.Chart chart1 = excelWrapper1.Workbook.ActiveSheet.ChartObjects("Chart 2").Chart;
            //chart1.ChartType = Microsoft.Office.Interop.Excel.XlChartType.xlXYScatterLines;

            chart1.Export(LocationImage, "BMP", misValue);

            using (var dlg = new CoolPrintPreviewDialog())
            {
                dlg.Document = this.printDocument1;
                dlg.ShowDialog(this);
            }
        }