Пример #1
0
 protected void AddAdditionalColumnsWhenEnabled(SheetInfo sheet)
 {
     if (myParsedArgs.WithFileInfo)
     {
         sheet.Columns.AddRange(Columns);
     }
 }
Пример #2
0
        protected void SetHeaderFont(SheetInfo header)
        {
            Range r = GetRange(myCurrentSheet, 0, header.HeaderRow, header.Columns.Count - 1, header.HeaderRow);

            r.Interior.ColorIndex = 0x2d; // orange
            r.Interior.Pattern    = XlPattern.xlPatternSolid;
            r.WrapText            = true;
            r.Font.Size           = 14;
            r.Font.Bold           = true;
        }
Пример #3
0
 public void SetCurrentSheet(SheetInfo header)
 {
     lock (this)
     {
         StringBuilder headerline = new StringBuilder();
         foreach (var col in header.Columns)
         {
             headerline.Append(col.Name);
             headerline.Append("; ");
         }
         string line = headerline.ToString().TrimEnd(new char[] { ' ', ';' });
         myCmd.Out.WriteLine(line);
     }
 }
Пример #4
0
        public void SetCurrentSheet(SheetInfo header)
        {
            using (Tracer t = new Tracer(myType, "SetCurrentSheet"))
            {
                using (new USCulture())
                {
                    if (myCurrentSheet != null)
                    {
                        t.Info("Wait until previous sheet data has been written");
                        myWriter.Close();
                        t.Info("Wait finished");
                        myWriter = new AsyncWriter <List <string> >(this.WriteLine);
                    }

                    lock (this)
                    {
                        if (myCurrentSheet != null)
                        {
                            EnableAutoFilter();
                        }
                        myCurrentSheetInfo = header;
                        myCurrentSheet     = AddSheet(header.SheetName);
                        myRowIndex         = 1;

                        for (int i = 0; i < header.Columns.Count; i++)
                        {
                            var   colum = header.Columns[i];
                            Range r     = GetCell(myCurrentSheet, i, header.HeaderRow);
                            r.Value2      = colum.Name;
                            r.ColumnWidth = colum.Width;
                        }

                        SetHeaderFont(header);
                    }
                }
            }
        }