示例#1
0
        private float GetColumnWidthInPixels(int columnIndex)
        {
            XSSFSheet sheet = (XSSFSheet)GetDrawing().GetParent();

            CT_Col col      = sheet.GetColumnHelper().GetColumn(columnIndex, false);
            double numChars = col == null || !col.IsSetWidth() ? DEFAULT_COLUMN_WIDTH : col.width;

            return((float)numChars * XSSFWorkbook.DEFAULT_CHARACTER_WIDTH);
        }
示例#2
0
        public void SetColumnAttributes(CT_Col fromCol, CT_Col toCol)
        {

            if (fromCol.IsSetBestFit())
            {
                toCol.bestFit = (fromCol.bestFit);
            }
            if (fromCol.IsSetCustomWidth())
            {
                toCol.customWidth = (fromCol.customWidth);
            }
            if (fromCol.IsSetHidden()) 
            {
                toCol.hidden = (fromCol.hidden);
            }
            if (fromCol.IsSetStyle())
            {
                toCol.style = (fromCol.style);
                toCol.styleSpecified = fromCol.styleSpecified;
            }
            if (fromCol.IsSetWidth())
            {
                toCol.width = (fromCol.width);
                toCol.widthSpecified = fromCol.widthSpecified;
            }
            if (fromCol.IsSetCollapsed())
            {
                toCol.collapsed = (fromCol.collapsed);
                toCol.collapsedSpecified = fromCol.collapsedSpecified;
            }
            if (fromCol.IsSetPhonetic())
            {
                toCol.phonetic = (fromCol.phonetic);
            }
            if (fromCol.IsSetOutlineLevel())
            {
                toCol.outlineLevel = (fromCol.outlineLevel);
            }
            if (fromCol.IsSetCollapsed())
            {
                toCol.collapsed = fromCol.collapsed;
            }
        }
示例#3
0
 public void SetColumnAttributes(CT_Col fromCol, CT_Col toCol)
 {
     if (fromCol.IsSetBestFit())
     {
         toCol.bestFit = fromCol.bestFit;
     }
     if (fromCol.IsSetCustomWidth())
     {
         toCol.customWidth = fromCol.customWidth;
     }
     if (fromCol.IsSetHidden())
     {
         toCol.hidden = fromCol.hidden;
     }
     if (fromCol.IsSetStyle())
     {
         toCol.style          = fromCol.style;
         toCol.styleSpecified = true;
     }
     if (fromCol.IsSetWidth())
     {
         toCol.width = fromCol.width;
     }
     if (fromCol.IsSetCollapsed())
     {
         toCol.collapsed = fromCol.collapsed;
     }
     if (fromCol.IsSetPhonetic())
     {
         toCol.phonetic = fromCol.phonetic;
     }
     if (fromCol.IsSetOutlineLevel())
     {
         toCol.outlineLevel = fromCol.outlineLevel;
     }
     if (!fromCol.IsSetCollapsed())
     {
         return;
     }
     toCol.collapsed = fromCol.collapsed;
 }
示例#4
0
        private float GetColumnWidthInPixels(int columnIndex)
        {
            CT_Col column = ((XSSFSheet)this.GetDrawing().GetParent()).GetColumnHelper().GetColumn((long)columnIndex, false);

            return((column == null || !column.IsSetWidth() ? XSSFPicture.DEFAULT_COLUMN_WIDTH : (float)column.width) * XSSFWorkbook.DEFAULT_CHARACTER_WIDTH);
        }