Exemplo n.º 1
0
        private void XuatExcel()
        {
            DataTable Final = new DataTable();
            int       total = 0;

            Final = supBLL.SearchIngredient(supSea, 1, out total);
            double RecordPerPage = 20;
            double tem           = (total / RecordPerPage);

            totalPage = Math.Ceiling(tem);

            for (int i = 2; i <= totalPage; i++) // duyet tat ca cac trang
            {
                DataTable dt = supBLL.SearchIngredient(supSea, i, out total);
                int       j  = Final.Rows.Count;
                foreach (DataRow dr in dt.Rows)
                {
                    Final.Rows.Add();
                    for (int k = 0; k < dt.Columns.Count; k++)
                    {
                        Final.Rows[j][k] = dr[k];
                    }
                    j++;
                }
            }

            //ExportExcelAlgorithms epex = new ExportExcelAlgorithms();

            //epex.ExportFileFromDataTable(Final, "Products_" + supBLL.GetDMY() + "_" + supBLL.GetHMS());

            string[] prm = { "3" };
            ExportExcelAlgorithms epex = new ExportExcelAlgorithms();

            epex.ExportFileFromDataTable_Dung(Final, "Ingreadient_" + DateTime.Now.ToString("ddMMyy_HHmmss"),
                                              "List of " + "Suppliers_" + DateTime.Now.ToString("ddMMyy_HHmmss"), prm);
        }