Esempio n. 1
1
 //[Obsolete]
 //public static void SetBorderBottom(NPOI.SS.UserModel.CellBorderType border, Region region, HSSFSheet sheet,
 //        HSSFWorkbook workbook)
 //{
 //    SetBorderBottom(border, toCRA(region), sheet, workbook);
 //}
 /// <summary>
 /// Sets the borderBottom attribute of the HSSFRegionUtil object
 /// </summary>
 /// <param name="border">The new border</param>
 /// <param name="region">The region that should have the border</param>
 /// <param name="sheet">The sheet that the region is on.</param>
 /// <param name="workbook">The workbook that the region is on.</param>
 public static void SetBorderBottom(NPOI.SS.UserModel.CellBorderType border, CellRangeAddress region, HSSFSheet sheet,
         HSSFWorkbook workbook)
 {
     int colStart = region.FirstColumn;
     int colEnd = region.LastColumn;
     int rowIndex = region.LastRow;
     CellPropertySetter cps = new CellPropertySetter(workbook, HSSFCellUtil.BORDER_BOTTOM, (int)border);
     NPOI.SS.UserModel.Row row = HSSFCellUtil.GetRow(rowIndex, sheet);
     for (int i = colStart; i <= colEnd; i++)
     {
         cps.SetProperty(row, i);
     }
 }
Esempio n. 2
0
        //[Obsolete]
        //public static void SetBorderLeft(Zephyr.Utils.NPOI.SS.UserModel.CellBorderType border, Region region, HSSFSheet sheet,
        //        HSSFWorkbook workbook)
        //{
        //    SetBorderLeft(border, toCRA(region), sheet, workbook);
        //}
        /// <summary>
        /// Sets the left border for a region of cells by manipulating the cell style
        /// of the individual cells on the left
        /// </summary>
        /// <param name="border">The new border</param>
        /// <param name="region">The region that should have the border</param>
        /// <param name="sheet">The sheet that the region is on.</param>
        /// <param name="workbook">The workbook that the region is on.</param>
        public static void SetBorderLeft(Zephyr.Utils.NPOI.SS.UserModel.BorderStyle border, CellRangeAddress region, HSSFSheet sheet,
                HSSFWorkbook workbook)
        {
            int rowStart = region.FirstRow;
            int rowEnd = region.LastRow;
            int column = region.FirstColumn;

            CellPropertySetter cps = new CellPropertySetter(workbook, HSSFCellUtil.BORDER_LEFT, (int)border);
            for (int i = rowStart; i <= rowEnd; i++)
            {
                cps.SetProperty(HSSFCellUtil.GetRow(i, sheet), column);
            }
        }
Esempio n. 3
0
        /**
         * Sets the left border for a region of cells by manipulating the cell style of the individual
         * cells on the left
         *
         * @param border The new border
         * @param region The region that should have the border
         * @param workbook The workbook that the region is on.
         * @param sheet The sheet that the region is on.
         */
        public static void SetBorderLeft(int border, CellRangeAddress region, ISheet sheet,
                IWorkbook workbook)
        {
            int rowStart = region.FirstRow;
            int rowEnd = region.LastRow;
            int column = region.FirstColumn;

            CellPropertySetter cps = new CellPropertySetter(workbook, CellUtil.BORDER_LEFT, border);
            for (int i = rowStart; i <= rowEnd; i++)
            {
                cps.SetProperty(CellUtil.GetRow(i, sheet), column);
            }
        }
Esempio n. 4
0
        /// <summary>
        /// Sets the left border for a region of cells by manipulating the cell style of the individual cells on the left
        /// </summary>
        /// <param name="border">The new border</param>
        /// <param name="region">The region that should have the border</param>
        /// <param name="sheet">The sheet that the region is on.</param>
        public static void SetBorderLeft(int border, CellRangeAddress region, ISheet sheet)
        {
            int rowStart = region.FirstRow;
            int rowEnd   = region.LastRow;
            int column   = region.FirstColumn;

            CellPropertySetter cps = new CellPropertySetter(CellUtil.BORDER_LEFT, border);

            for (int i = rowStart; i <= rowEnd; i++)
            {
                cps.SetProperty(CellUtil.GetRow(i, sheet), column);
            }
        }
Esempio n. 5
0
        /// <summary>
        /// Sets the top border color for a region of cells by manipulating the cell style of the individual cells on the top
        /// </summary>
        /// <param name="color">The color of the border</param>
        /// <param name="region">The region that should have the border</param>
        /// <param name="sheet">The sheet that the region is on.</param>
        public static void SetTopBorderColor(int color, CellRangeAddress region, ISheet sheet)
        {
            int colStart           = region.FirstColumn;
            int colEnd             = region.LastColumn;
            int rowIndex           = region.FirstRow;
            CellPropertySetter cps = new CellPropertySetter(CellUtil.TOP_BORDER_COLOR, color);
            IRow row = CellUtil.GetRow(rowIndex, sheet);

            for (int i = colStart; i <= colEnd; i++)
            {
                cps.SetProperty(row, i);
            }
        }
Esempio n. 6
0
        /**
         * Sets the borderBottom attribute of the RegionUtil object
         *
         * @param border The new border
         * @param region The region that should have the border
         * @param workbook The workbook that the region is on.
         * @param sheet The sheet that the region is on.
         */
        public static void SetBorderTop(int border, CellRangeAddress region, ISheet sheet,
                                        IWorkbook workbook)
        {
            int colStart           = region.FirstColumn;
            int colEnd             = region.LastColumn;
            int rowIndex           = region.FirstRow;
            CellPropertySetter cps = new CellPropertySetter(workbook, CellUtil.BORDER_TOP, border);
            IRow row = CellUtil.GetRow(rowIndex, sheet);

            for (int i = colStart; i <= colEnd; i++)
            {
                cps.SetProperty(row, i);
            }
        }
Esempio n. 7
0
        //[Obsolete]
        //public static void SetBorderLeft(Zephyr.Utils.NPOI.SS.UserModel.CellBorderType border, Region region, HSSFSheet sheet,
        //        HSSFWorkbook workbook)
        //{
        //    SetBorderLeft(border, toCRA(region), sheet, workbook);
        //}
        /// <summary>
        /// Sets the left border for a region of cells by manipulating the cell style
        /// of the individual cells on the left
        /// </summary>
        /// <param name="border">The new border</param>
        /// <param name="region">The region that should have the border</param>
        /// <param name="sheet">The sheet that the region is on.</param>
        /// <param name="workbook">The workbook that the region is on.</param>
        public static void SetBorderLeft(Fruit.Utils.NPOI.SS.UserModel.BorderStyle border, CellRangeAddress region, HSSFSheet sheet,
                                         HSSFWorkbook workbook)
        {
            int rowStart = region.FirstRow;
            int rowEnd   = region.LastRow;
            int column   = region.FirstColumn;

            CellPropertySetter cps = new CellPropertySetter(workbook, HSSFCellUtil.BORDER_LEFT, (int)border);

            for (int i = rowStart; i <= rowEnd; i++)
            {
                cps.SetProperty(HSSFCellUtil.GetRow(i, sheet), column);
            }
        }
Esempio n. 8
0
        /// <summary>
        /// Sets the topBorderColor attribute of the HSSFRegionUtil object
        /// </summary>
        /// <param name="color">The color of the border</param>
        /// <param name="region">The region that should have the border</param>
        /// <param name="sheet">The sheet that the region is on.</param>
        /// <param name="workbook">The workbook that the region is on.</param>
        public static void SetTopBorderColor(int color, CellRangeAddress region, HSSFSheet sheet,
                                             HSSFWorkbook workbook)
        {
            int colStart           = region.FirstColumn;
            int colEnd             = region.LastColumn;
            int rowIndex           = region.FirstRow;
            CellPropertySetter cps = new CellPropertySetter(workbook, HSSFCellUtil.TOP_BORDER_COLOR, color);

            Fruit.Utils.NPOI.SS.UserModel.IRow row = HSSFCellUtil.GetRow(rowIndex, sheet);
            for (int i = colStart; i <= colEnd; i++)
            {
                cps.SetProperty(row, i);
            }
        }
Esempio n. 9
0
        //[Obsolete]
        //public static void SetRightBorderColor(short color, Region region, HSSFSheet sheet,
        //        HSSFWorkbook workbook)
        //{
        //    SetRightBorderColor(color, toCRA(region), sheet, workbook);
        //}
        /// <summary>
        /// Sets the rightBorderColor attribute of the HSSFRegionUtil object
        /// </summary>
        /// <param name="color">The color of the border</param>
        /// <param name="region">The region that should have the border</param>
        /// <param name="sheet">The workbook that the region is on.</param>
        /// <param name="workbook">The sheet that the region is on.</param>
        public static void SetRightBorderColor(int color, CellRangeAddress region, HSSFSheet sheet,
                                               HSSFWorkbook workbook)
        {
            int rowStart = region.FirstRow;
            int rowEnd   = region.LastRow;
            int column   = region.LastColumn;

            CellPropertySetter cps = new CellPropertySetter(workbook, HSSFCellUtil.RIGHT_BORDER_COLOR, color);

            for (int i = rowStart; i <= rowEnd; i++)
            {
                cps.SetProperty(HSSFCellUtil.GetRow(i, sheet), column);
            }
        }
Esempio n. 10
0
        //[Obsolete]
        //public static void SetBorderTop(NPOI.SS.UserModel.CellBorderType border, Region region, HSSFSheet sheet,
        //        HSSFWorkbook workbook)
        //{
        //    SetBorderTop(border, toCRA(region), sheet, workbook);
        //}
        /// <summary>
        /// Sets the borderBottom attribute of the HSSFRegionUtil object
        /// </summary>
        /// <param name="border">The new border</param>
        /// <param name="region">The region that should have the border</param>
        /// <param name="sheet">The sheet that the region is on.</param>
        /// <param name="workbook">The workbook that the region is on.</param>
        public static void SetBorderTop(NPOI.SS.UserModel.BorderStyle border, CellRangeAddress region, HSSFSheet sheet,
                                        HSSFWorkbook workbook)
        {
            int colStart           = region.FirstColumn;
            int colEnd             = region.LastColumn;
            int rowIndex           = region.FirstRow;
            CellPropertySetter cps = new CellPropertySetter(workbook, HSSFCellUtil.BORDER_TOP, (int)border);

            NPOI.SS.UserModel.IRow row = HSSFCellUtil.GetRow(rowIndex, sheet);
            for (int i = colStart; i <= colEnd; i++)
            {
                cps.SetProperty(row, i);
            }
        }
Esempio n. 11
0
 /// <summary>
 /// Sets the topBorderColor attribute of the HSSFRegionUtil object
 /// </summary>
 /// <param name="color">The color of the border</param>
 /// <param name="region">The region that should have the border</param>
 /// <param name="sheet">The sheet that the region is on.</param>
 /// <param name="workbook">The workbook that the region is on.</param>
 public static void SetTopBorderColor(int color, CellRangeAddress region, HSSFSheet sheet,
         HSSFWorkbook workbook)
 {
     int colStart = region.FirstColumn;
     int colEnd = region.LastColumn;
     int rowIndex = region.FirstRow;
     CellPropertySetter cps = new CellPropertySetter(workbook, HSSFCellUtil.TOP_BORDER_COLOR, color);
     NPOI.SS.UserModel.Row row = HSSFCellUtil.GetRow(rowIndex, sheet);
     for (int i = colStart; i <= colEnd; i++)
     {
         cps.SetProperty(row, i);
     }
 }
Esempio n. 12
0
        //[Obsolete]
        //public static void SetRightBorderColor(short color, Region region, HSSFSheet sheet,
        //        HSSFWorkbook workbook)
        //{
        //    SetRightBorderColor(color, toCRA(region), sheet, workbook);
        //}
        /// <summary>
        /// Sets the rightBorderColor attribute of the HSSFRegionUtil object
        /// </summary>
        /// <param name="color">The color of the border</param>
        /// <param name="region">The region that should have the border</param>
        /// <param name="sheet">The workbook that the region is on.</param>
        /// <param name="workbook">The sheet that the region is on.</param>
        public static void SetRightBorderColor(int color, CellRangeAddress region, HSSFSheet sheet,
                HSSFWorkbook workbook)
        {
            int rowStart = region.FirstRow;
            int rowEnd = region.LastRow;
            int column = region.LastColumn;

            CellPropertySetter cps = new CellPropertySetter(workbook, HSSFCellUtil.RIGHT_BORDER_COLOR, color);
            for (int i = rowStart; i <= rowEnd; i++)
            {
                cps.SetProperty(HSSFCellUtil.GetRow(i, sheet), column);
            }
        }
Esempio n. 13
0
 /**
  * Sets the borderBottom attribute of the RegionUtil object
  *
  * @param border The new border
  * @param region The region that should have the border
  * @param workbook The workbook that the region is on.
  * @param sheet The sheet that the region is on.
  */
 public static void SetBorderTop(int border, CellRangeAddress region, ISheet sheet,
         IWorkbook workbook)
 {
     int colStart = region.FirstColumn;
     int colEnd = region.LastColumn;
     int rowIndex = region.FirstRow;
     CellPropertySetter cps = new CellPropertySetter(workbook, CellUtil.BORDER_TOP, border);
     IRow row = CellUtil.GetRow(rowIndex, sheet);
     for (int i = colStart; i <= colEnd; i++)
     {
         cps.SetProperty(row, i);
     }
 }
Esempio n. 14
0
 //[Obsolete]
 //public static void SetBorderTop(Zephyr.Utils.NPOI.SS.UserModel.CellBorderType border, Region region, HSSFSheet sheet,
 //        HSSFWorkbook workbook)
 //{
 //    SetBorderTop(border, toCRA(region), sheet, workbook);
 //}
 /// <summary>
 /// Sets the borderBottom attribute of the HSSFRegionUtil object
 /// </summary>
 /// <param name="border">The new border</param>
 /// <param name="region">The region that should have the border</param>
 /// <param name="sheet">The sheet that the region is on.</param>
 /// <param name="workbook">The workbook that the region is on.</param>
 public static void SetBorderTop(Zephyr.Utils.NPOI.SS.UserModel.BorderStyle border, CellRangeAddress region, HSSFSheet sheet,
         HSSFWorkbook workbook)
 {
     int colStart = region.FirstColumn;
     int colEnd = region.LastColumn;
     int rowIndex = region.FirstRow;
     CellPropertySetter cps = new CellPropertySetter(workbook, HSSFCellUtil.BORDER_TOP, (int)border);
     Zephyr.Utils.NPOI.SS.UserModel.IRow row = HSSFCellUtil.GetRow(rowIndex, sheet);
     for (int i = colStart; i <= colEnd; i++)
     {
         cps.SetProperty(row, i);
     }
 }