Exemplo n.º 1
0
 private static void GenerateBackgroundColor(XlWorksheet ws, DataTable t)
 {
     for (int ri = 0; ri < t.Rows.Count; ri++)
     {
         DataRow dr      = t.Rows[ri];
         String  bgColor = dr["bg_color"] as String;
         if (!String.IsNullOrWhiteSpace(bgColor))
         {
             int ci = 0;
             foreach (Md.TableColumn col in Md.Table1Columns)
             {
                 ws.SetCellBackgroundColor((ri + 1), ci, bgColor); // !!! 1 - количество строк в шапке
                 ci++;
             }
         }
     }
 }