php - Set cell background using column and row index -
i setting cell value in phpexcel using below method setcellvaluebycolumnandrow()
$objphpexcel->getactivesheet()->setcellvaluebycolumnandrow($col,$xlsrow,$plan);
now requirment set background color this.
i not able use below method aligned rows , columns numbers.
$objphpexcel->getactivesheet()->getstyle("a1")->getfill() ->setfilltype(phpexcel_style_fill::fill_solid) ->getstartcolor()->setrgb($color);
i searching way provide cols , rows (2,3) not ('a1:e1')
please suggest alternative way set background color using column , row numbers.
you cannot style row in phpexcel, cell or range of cells
$objphpexcel->getactivesheet() ->getstyle('a1:e1') ->getfill() ->setfilltype(phpexcel_style_fill::fill_solid) ->getstartcolor() ->setargb('ff808080');
or
$objphpexcel->getactivesheet() ->getstyle('a1:e1') ->applyfromarray( array( 'fill' => array( 'type' => phpexcel_style_fill::fill_solid, 'color' => array('rgb' => 'e05cc2') ) ) );
will set background fill style cells a1 e1
Comments
Post a Comment