Exemple #1
0
 public Cell(string Value, Cell.Style style)
 {
     workbook     = NPOIPrinter.workbook;
     fontDynamic  = workbook.CreateFont();
     styleDynamic = workbook.CreateCellStyle();
     styleDynamic = ToStyle(style);
     this.Value   = Value;
 }
Exemple #2
0
        private void SetStyle(Cell.Style style)
        {
            fontM  = NPOIPrinter.fontM;
            styleM = NPOIPrinter.styleM;
            switch (style)
            {
            case Cell.Style.normal:
                fontDynamic  = fontM[0];
                styleDynamic = styleM[0];
                Type         = CellType.String;
                break;

            case Cell.Style.bold:
                fontDynamic  = fontM[1];
                styleDynamic = styleM[1];
                Type         = CellType.String;
                break;

            case Cell.Style.summ:
                fontDynamic  = fontM[2];
                styleDynamic = styleM[2];
                Type         = CellType.Numeric;
                break;

            case Cell.Style.clientCame:
                fontDynamic  = fontM[3];
                styleDynamic = styleM[3];
                Type         = CellType.String;
                break;

            case Cell.Style.clientOut:
                fontDynamic  = fontM[4];
                styleDynamic = styleM[4];
                Type         = CellType.String;
                break;

            case Cell.Style.colorPink:
                fontDynamic  = fontM[5];
                styleDynamic = styleM[5];
                Type         = CellType.String;
                break;

            case Cell.Style.noBorder:
                fontDynamic  = fontM[6];
                styleDynamic = styleM[6];
                Type         = CellType.String;
                break;
            }
        }
Exemple #3
0
 public ICellStyle ToStyle(Cell.Style style)
 {
     SetStyle(style);
     return(styleDynamic);
 }