->getBorders()->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
$objectPHPExcel->getActiveSheet()->getStyle('B3:G3' )
->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
$objectPHPExcel->getActiveSheet()->getStyle('B3:G3' )
->getBorders()->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
$objectPHPExcel->getActiveSheet()->getStyle('B3:G3' )
->getBorders()->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
$objectPHPExcel->getActiveSheet()->getStyle('B3:G3' )
->getBorders()->getVertical()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
//设置颜色
$objectPHPExcel->getActiveSheet()->getStyle('B3:G3')->getFill()
->setFillType(PHPExcel_Style_Fill::FILL_SOLID)->getStartColor()->setARGB('FF66CCCC');
}
//明细的输出
$objectPHPExcel->getActiveSheet()->setCellValue('B'.($n+4) ,$product->id);
$objectPHPExcel->getActiveSheet()->setCellValue('C'.($n+4) ,$product->product_name);
$objectPHPExcel->getActiveSheet()->setCellValue('D'.($n+4) ,$product->product_agent->name);
$objectPHPExcel->getActiveSheet()->setCellValue('E'.($n+4) ,$product->unit);
$objectPHPExcel->getActiveSheet()->setCellValue('F'.($n+4) ,$product->unit_price);
$objectPHPExcel->getActiveSheet()->setCellValue('G'.($n+4) ,$product->library_count);
//设置边框
$currentRowNum = $n+4;
$objectPHPExcel->getActiveSheet()->getStyle('B'.($n+4).':G'.$currentRowNum )
->getBorders()->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
$objectPHPExcel->getActiveSheet()->getStyle('B'.($n+4).':G'.$currentRowNum )
->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
$objectPHPExcel->getActiveSheet()->getStyle('B'.($n+4).':G'.$currentRowNum )
->getBorders()->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
$objectPHPExcel->getActiveSheet()->getStyle('B'.($n+4).':G'.$currentRowNum )