Пример #1
0
        private void DownloadBanks(string strFileName, string User)
        {
            try
            {
                Reports.Excel.CreateExcelDoc excell_app = new Reports.Excel.CreateExcelDoc();

                //creates the main header
                //createHeaders(int row, int col, string htext, string cell1, string cell2, int mergeColumns, string color, bool font, int size, string fcolor)
                excell_app.createHeaders(1, 1, "BankCode", "A1", "A1", 0, "WHITE", true, 10, "n");
                //creates subheaders
                excell_app.createHeaders(1, 2, "BankName", "A2", "A2", 0, "WHITE", true, 10, "n");


                int row = 2;
                foreach (var rec in de.GetBanks())
                {
                    //add Data to to cells
                    int    col  = 1;
                    string addr = excell_app.IntAlpha(col) + row;
                    //excell_app.addData(row, col, rec.BankCode.ToString(), addr, addr, "#,##0");
                    excell_app.createHeaders(row, col, rec.BankCode.ToString(), addr, addr, 0, "WHITE", true, 10, "n");

                    col++;
                    addr = excell_app.IntAlpha(col) + row;
                    //excell_app.addData(row, col, rec.BankName.ToString(), addr, addr, "#,##0");
                    excell_app.createHeaders(row, col, rec.BankName.ToString(), addr, addr, 0, "WHITE", true, 10, "n");

                    row++;
                }
            }
            catch (Exception ex)
            {
                Utils.ShowError(ex);
            }
        }
Пример #2
0
        private void Download(string strFileName, string User)
        {
            Reports.Excel.CreateExcelDoc excell_app = new Reports.Excel.CreateExcelDoc();

            //creates the main header
            //createHeaders(int row, int col, string htext, string cell1, string cell2, int mergeColumns, string b, bool font, int size, string fcolor)
            excell_app.createHeaders(1, 1, "Id", "A1", "A1", 0, "WHITE", true, 10, "n");
            //creates subheaders
            excell_app.createHeaders(1, 2, "FromAmt", "A2", "A2", 0, "WHITE", true, 10, "n");
            excell_app.createHeaders(1, 3, "ToAmt", "A3", "A3", 0, "WHITE", true, 10, "n");
            excell_app.createHeaders(1, 4, "Rate", "A4", "A4", 0, "WHITE", true, 10, "n");

            int row = 2;

            foreach (var rec in de.NHIFTable())
            {
                //add Data to to cells
                int    col  = 1;
                string addr = excell_app.IntAlpha(col) + row;
                //excell_app.addData(row, col, rec.Id.ToString(), addr, addr, "#,##0");
                excell_app.createHeaders(row, col, rec.Id.ToString(), addr, addr, 0, "WHITE", true, 10, "n");

                col++;
                addr = excell_app.IntAlpha(col) + row;
                //excell_app.addData(row, col, rec.FromAmt.ToString(), addr, addr, "#,##0");
                excell_app.createHeaders(row, col, rec.FromAmt.ToString(), addr, addr, 0, "WHITE", true, 10, "n");

                col++;
                addr = excell_app.IntAlpha(col) + row;
                //excell_app.addData(row, col, rec.ToAmt.ToString(), addr, addr, "#,##0");
                excell_app.createHeaders(row, col, rec.ToAmt.ToString(), addr, addr, 0, "WHITE", true, 10, "n");

                col++;
                addr = excell_app.IntAlpha(col) + row;
                //excell_app.addData(row, col, rec.Rate.ToString(), addr, addr, "#,##0");
                excell_app.createHeaders(row, col, rec.Rate.ToString(), addr, addr, 0, "WHITE", true, 10, "n");

                row++;
            }
        }