Пример #1
0
 private void btnCSV_Click(object sender, EventArgs e)
 {
     try
     {
         MyExcelExport.GenericFormattedExcel2003Export gExp =
             new MyExcelExport.GenericFormattedExcel2003Export("CSV",
                                                               dataGridView1, MyExcelExport.Theme.CSV, null, null, null);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Пример #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            string mode = rCsv.Checked ? "CSV" : "XLS";
            List <MyExcelExport.ColumnConditions> conds =
                new List <MyExcelExport.ColumnConditions>();

            MyExcelExport.ColumnConditions curr = null;

            //no need to specify alignment
            //only if you wish/needed. It defaults to MyExcelExport.Align.None
            curr        = new MyExcelExport.ColumnConditions();
            curr.Column = 2;
            curr.Cond   = MyExcelExport.Conditon.CurrencyEuro;
            conds.Add(curr);

            //specify Alignment
            curr           = new MyExcelExport.ColumnConditions();
            curr.Column    = 3;
            curr.Cond      = MyExcelExport.Conditon.Percentage;
            curr.Alignment = MyExcelExport.Align.Right;
            conds.Add(curr);

            List <MyExcelExport.ColumnRowConditon> rowConds = new List <MyExcelExport.ColumnRowConditon>();

            MyExcelExport.ColumnRowConditon row = new MyExcelExport.ColumnRowConditon();
            row.Column         = 1;
            row.ConditionValue = "Total";
            rowConds.Add(row);

            try
            {
                MyExcelExport.GenericFormattedExcel2003Export gExp =
                    new MyExcelExport.GenericFormattedExcel2003Export(mode, dataGridView1,
                                                                      MyExcelExport.Theme.SweetPink, conds, rowConds, null);
            }
            catch (COMException ex)
            {
                MessageBox.Show(ex.Message);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Пример #3
0
        private void btnBluCondition_Click(object sender, EventArgs e)
        {
            string mode = rCsv.Checked ? "CSV" : "XLS";
            List <MyExcelExport.ColumnConditions> conds =
                new List <MyExcelExport.ColumnConditions>();

            MyExcelExport.ColumnConditions curr = null;

            curr        = new MyExcelExport.ColumnConditions();
            curr.Column = 2;
            curr.Cond   = MyExcelExport.Conditon.CurrencyEuro;
            conds.Add(curr);

            curr        = new MyExcelExport.ColumnConditions();
            curr.Column = 3;
            curr.Cond   = MyExcelExport.Conditon.Percentage;
            conds.Add(curr);

            List <MyExcelExport.ColumnRowConditon> rowConds = new List <MyExcelExport.ColumnRowConditon>();

            MyExcelExport.ColumnRowConditon row = new MyExcelExport.ColumnRowConditon();
            row.Column         = 1;
            row.ConditionValue = "Total";
            rowConds.Add(row);

            try
            {
                MyExcelExport.GenericFormattedExcel2003Export gExp =
                    new MyExcelExport.GenericFormattedExcel2003Export(mode, dataGridView1,
                                                                      MyExcelExport.Theme.ClassicGray, conds, rowConds, null);
            }
            catch (COMException ex)
            {
                MessageBox.Show(ex.Message);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }