Ejemplo n.º 1
0
        private void btExcel_Click(object sender, EventArgs e)
        {
            SaveFileDialog save = new SaveFileDialog();

            save.Filter       = "(*.xlsx)|*.xlsx";
            save.DefaultExt   = ".xlsx";
            save.AddExtension = true;
            if (save.ShowDialog(this) == DialogResult.OK)
            {
                waitForm.ShowWaitForm();
                WorkWithExcel excel = new WorkWithExcel();
                if (State == EnumReportState.RevenueOfMonth)
                {
                    excel.ExportExcelReports(table, 2, "Reprot of Monthly", "Report of Monthly", save.FileName);
                }
                else if (State == EnumReportState.Price)
                {
                    excel.ExportExcelReports(table, 2, "Reprot of Product Price", "Reprot of Product Price", save.FileName);
                }
                else if (State == EnumReportState.Quantiy)
                {
                    excel.ExportExcelReports(table, 2, "Reprot of Product Quantily", "Reprot of Product Quantily", save.FileName);
                }
                else if (State == EnumReportState.ProductTypes)
                {
                    excel.ExportExcelReports(table, 2, "Reprot of Product Types", "Reprot of Product Types", save.FileName);
                }
                else if (State == EnumReportState.RevenueOfDays)
                {
                    excel.ExportExcelReports(table, 2, "Reprot of Days", "Report of Days", save.FileName);
                }
                waitForm.CloseWaitForm();
            }
        }
Ejemplo n.º 2
0
        //
        // Export to Excel
        private void btExcel_Click(object sender, EventArgs e)
        {
            SaveFileDialog save = new SaveFileDialog();

            save.Filter       = "(*.xlsx)|*.xlsx";
            save.DefaultExt   = ".xlsx";
            save.AddExtension = true;
            if (save.ShowDialog(this) == DialogResult.OK)
            {
                waitForm.ShowWaitForm();
                WorkWithExcel excel = new WorkWithExcel();
                get_productsTableAdapter.Fill(computerStoreDataSet.get_products);
                excel.ExportExcelReports(computerStoreDataSet.get_products, 2, "Reprot of Products", "Reprot of Products", save.FileName);
                waitForm.CloseWaitForm();
            }
        }