当前位置: 首页>>代码示例>>PHP>>正文


PHP PHPExcel_Worksheet_Drawing::setWidthAndHeight方法代码示例

本文整理汇总了PHP中PHPExcel_Worksheet_Drawing::setWidthAndHeight方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPExcel_Worksheet_Drawing::setWidthAndHeight方法的具体用法?PHP PHPExcel_Worksheet_Drawing::setWidthAndHeight怎么用?PHP PHPExcel_Worksheet_Drawing::setWidthAndHeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PHPExcel_Worksheet_Drawing的用法示例。


在下文中一共展示了PHPExcel_Worksheet_Drawing::setWidthAndHeight方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: orderexcel

 function orderexcel($data, $title)
 {
     $phpexcel_root = ROOT . '/extends/PHPExcel';
     include_once $phpexcel_root . '/PHPExcel.php';
     $objPHPExcel = new \PHPExcel();
     foreach ($title as $index => $string) {
         $objPHPExcel->getActiveSheet()->setCellValue(chr(ord('A') + $index) . '1', $string);
     }
     foreach ($data as $line => $value) {
         $objPHPExcel->getActiveSheet()->getRowDimension($line + 4)->setRowHeight(-3);
         $objPHPExcel->getActiveSheet()->getStyle('D' . ($line + 4))->getNumberFormat()->setFormatCode(\PHPExcel_Style_NumberFormat::FORMAT_NUMBER_00);
         $objPHPExcel->getActiveSheet()->getStyle('Q' . ($line + 4))->getNumberFormat()->setFormatCode(\PHPExcel_Style_NumberFormat::FORMAT_NUMBER_00);
         $objPHPExcel->getActiveSheet()->getStyle('R' . ($line + 4))->getNumberFormat()->setFormatCode(\PHPExcel_Style_NumberFormat::FORMAT_NUMBER);
         $objPHPExcel->getActiveSheet()->getStyle('F' . ($line + 4))->getNumberFormat()->setFormatCode(\PHPExcel_Style_NumberFormat::FORMAT_TEXT);
         //$objPHPExcel->getActiveSheet()->getRowDimension($line+4)->setHeight(200);
         $index = 0;
         $objPHPExcel->getActiveSheet()->setCellValue(chr(ord('A') + $index++) . ($line + 4), $value['orderno']);
         $objPHPExcel->getActiveSheet()->setCellValue(chr(ord('A') + $index++) . ($line + 4), $value['paytype']);
         $objPHPExcel->getActiveSheet()->setCellValue(chr(ord('A') + $index++) . ($line + 4), $value['paynumber']);
         $objPHPExcel->getActiveSheet()->setCellValue(chr(ord('A') + $index++) . ($line + 4), $value['ordertotalamount']);
         $objPHPExcel->getActiveSheet()->setCellValue(chr(ord('A') + $index++) . ($line + 4), $value['ordertaxamount']);
         $objPHPExcel->getActiveSheet()->setCellValue(chr(ord('A') + $index++) . ($line + 4), $value['ordergoodsamount']);
         $objPHPExcel->getActiveSheet()->setCellValue(chr(ord('A') + $index++) . ($line + 4), $value['feeamount']);
         $objPHPExcel->getActiveSheet()->setCellValue(chr(ord('A') + $index++) . ($line + 4), $value['tradetime']);
         $objPHPExcel->getActiveSheet()->setCellValue(chr(ord('A') + $index++) . ($line + 4), $value['totalamount']);
         $objPHPExcel->getActiveSheet()->setCellValue(chr(ord('A') + $index++) . ($line + 4), $value['consigneetel']);
         $objPHPExcel->getActiveSheet()->setCellValue(chr(ord('A') + $index++) . ($line + 4), $value['consignee']);
         $objPHPExcel->getActiveSheet()->setCellValue(chr(ord('A') + $index++) . ($line + 4), $value['zipcode']);
         $objPHPExcel->getActiveSheet()->setCellValue(chr(ord('A') + $index++) . ($line + 4), $value['consigneeprovince']);
         $objPHPExcel->getActiveSheet()->setCellValue(chr(ord('A') + $index++) . ($line + 4), $value['consigneecity']);
         $objPHPExcel->getActiveSheet()->setCellValue(chr(ord('A') + $index++) . ($line + 4), $value['consigneecounty']);
         $objPHPExcel->getActiveSheet()->setCellValue(chr(ord('A') + $index++) . ($line + 4), $value['consigneeaddress']);
         $objPHPExcel->getActiveSheet()->setCellValue(chr(ord('A') + $index++) . ($line + 4), $value['postmode']);
         $objPHPExcel->getActiveSheet()->setCellValue(chr(ord('A') + $index++) . ($line + 4), $value['username']);
         $objPHPExcel->getActiveSheet()->setCellValue(chr(ord('A') + $index++) . ($line + 4), $value['sku']);
         $objPHPExcel->getActiveSheet()->setCellValue(chr(ord('A') + $index++) . ($line + 4), $value['productname']);
         $objPHPExcel->getActiveSheet()->setCellValue(chr(ord('A') + $index++) . ($line + 4), $value['unitprice']);
         $objPHPExcel->getActiveSheet()->setCellValue(chr(ord('A') + $index++) . ($line + 4), $value['num']);
         if (!empty($value['img'])) {
             $objDrawing = new \PHPExcel_Worksheet_Drawing();
             $objDrawing->setName($value['productname']);
             $objDrawing->setPath($value['img'][0]['thumbnail_path']);
             $objDrawing->setCoordinates(chr(ord('A') + $index++) . ($line + 4));
             $objDrawing->setResizeProportional(true);
             $objDrawing->setWidthAndHeight(100, 100);
             $objDrawing->setOffsetX(100);
             $objDrawing->setWorksheet($objPHPExcel->getActiveSheet());
         }
     }
     $objWriter = \PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
     $filename = time('Y-m-d H:i:s') . '.xls';
     $objWriter->save($filename);
     return $filename;
 }
开发者ID:jin123456bat,项目名称:home,代码行数:54,代码来源:excel.php

示例2: getTeaserImage

 private function getTeaserImage(Teasers $teaser)
 {
     $objDrawing = new PHPExcel_Worksheet_Drawing();
     $objDrawing->setName($teaser->title);
     $path = Yii::app()->params->imageBasePath . DIRECTORY_SEPARATOR . $teaser->picture;
     if (!file_exists($path)) {
         $path = $path = Yii::app()->params->imageBasePath . DIRECTORY_SEPARATOR . 'notfound.png';
     }
     $objDrawing->setPath($path);
     $objDrawing->setWidthAndHeight(95, 95);
     $objDrawing->setOffsetX(10);
     $objDrawing->setOffsetY(2);
     return $objDrawing;
 }
开发者ID:kbudylov,项目名称:ttarget,代码行数:14,代码来源:ExcelReportFull.php

示例3: postAction


//.........这里部分代码省略.........
                 $objPHPExcel->getActiveSheet()->getStyle('A' . $i)->getAlignment()->setIndent(9);
                 $objPHPExcel->getActiveSheet()->getStyle('A' . $i)->getFont()->setName('Arial')->setSize(10)->getColor()->setRGB('000000');
                 $objPHPExcel->getActiveSheet()->getStyle('A' . $i)->getFont()->setBold(true);
                 $objPHPExcel->getActiveSheet()->getStyle('A' . $i . ':G' . $i)->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID);
                 $objPHPExcel->getActiveSheet()->getStyle('A' . $i . ':G' . $i)->getFill()->getStartColor()->setARGB('FFFFFF');
                 $objPHPExcel->getActiveSheet()->getStyle('A' . $i)->applyFromArray($styleThinBlackBorderOutline);
                 //Extra Block
                 $objPHPExcel->getActiveSheet()->getStyle('D' . $i)->applyFromArray($styleThinBlackBorderOutline);
                 $objPHPExcel->getActiveSheet()->getStyle('E' . $i)->applyFromArray($styleThinBlackBorderOutline);
                 $objPHPExcel->getActiveSheet()->getStyle('F' . $i)->applyFromArray($styleThinBlackBorderOutline);
                 $objPHPExcel->getActiveSheet()->getStyle('G' . $i)->applyFromArray($styleThinBlackBorderOutline);
                 //2
                 $objPHPExcel->getActiveSheet()->getStyle('B' . $i)->applyFromArray($styleThinBlackBorderOutline);
                 $objDrawing = new PHPExcel_Worksheet_Drawing();
                 if (file_exists('./media/catalog/product' . $image_link)) {
                     if ($product->getImage() == 'no_selection') {
                         $objDrawing->setPath('./images/logo.png');
                         $objDrawing->setOffsetX(5);
                         $objDrawing->setOffsetY(50);
                     } else {
                         $objDrawing->setPath('./media/catalog/product' . $image_link);
                         $objDrawing->setOffsetX(5);
                         $objDrawing->setOffsetY(5);
                     }
                 } else {
                     $objDrawing->setPath('./images/logo.png');
                     $objDrawing->setOffsetX(5);
                     $objDrawing->setOffsetY(50);
                 }
                 $objDrawing->setCoordinates('B' . $i);
                 //$objDrawing->setHeight(190);
                 //$objDrawing->setWidth(340);
                 $objDrawing->setResizeProportional(true);
                 $objDrawing->setWidthAndHeight(340, 210);
                 $objDrawing->setWorksheet($objPHPExcel->getActiveSheet());
                 //3 Cell
                 $objPHPExcel->getActiveSheet()->getStyle('C' . $i)->applyFromArray($styleThinBlackBorderOutline);
                 $objPHPExcel->getActiveSheet()->setCellValue('C' . $i, $description);
                 $objPHPExcel->getActiveSheet()->getStyle('C' . $i)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
                 $objPHPExcel->getActiveSheet()->getStyle('C' . $i)->getFont()->setName('Arial')->setSize(10)->getColor()->setRGB('000000');
                 $objPHPExcel->getActiveSheet()->getStyle('C' . $i)->getFont()->setBold(true);
                 //4 Cell
                 $objPHPExcel->getActiveSheet()->getStyle('D' . $i)->applyFromArray($styleThinBlackBorderOutline);
                 if ($price_temp == '0') {
                     $objPHPExcel->getActiveSheet()->setCellValue('D' . $i, '');
                 } else {
                     $objPHPExcel->getActiveSheet()->getStyle('D' . $i)->getNumberFormat()->applyFromArray(array('code' => PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_USD));
                     $objPHPExcel->getActiveSheet()->setCellValue('D' . $i, $price_temp);
                 }
                 $objPHPExcel->getActiveSheet()->getStyle('D' . $i)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
                 $objPHPExcel->getActiveSheet()->getStyle('D' . $i)->getAlignment()->setIndent(9);
                 $objPHPExcel->getActiveSheet()->getStyle('D' . $i)->getFont()->setName('Arial')->setSize(10)->getColor()->setRGB('000000');
                 $objPHPExcel->getActiveSheet()->getStyle('D' . $i)->getFont()->setBold(true);
                 //5 Cell
                 $objPHPExcel->getActiveSheet()->getStyle('E' . $i)->applyFromArray($styleThinBlackBorderOutline);
                 if ($wholesale == $price_temp) {
                     $objPHPExcel->getActiveSheet()->setCellValue('E' . $i, '');
                 } else {
                     $objPHPExcel->getActiveSheet()->getStyle('E' . $i)->getNumberFormat()->applyFromArray(array('code' => PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_USD));
                     $objPHPExcel->getActiveSheet()->setCellValue('E' . $i, $wholesale);
                 }
                 $objPHPExcel->getActiveSheet()->getStyle('E' . $i)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
                 $objPHPExcel->getActiveSheet()->getStyle('E' . $i)->getAlignment()->setIndent(9);
                 $objPHPExcel->getActiveSheet()->getStyle('E' . $i)->getFont()->setName('Arial')->setSize(10)->getColor()->setRGB('000000');
                 $objPHPExcel->getActiveSheet()->getStyle('E' . $i)->getFont()->setBold(true);
                 //6 Cell
开发者ID:planetwebsolution,项目名称:Magento-Sample-Code,代码行数:67,代码来源:MyformController.php

示例4: addLogo

 /**
  * Добавляет лого на страницу
  *
  * @param PHPExcel_Worksheet $activeSheet
  * @param string|null $rightColumn
  */
 protected function addLogo(PHPExcel_Worksheet $activeSheet, $rightColumn = null)
 {
     $logo_path = dirname(Yii::app()->basePath) . DIRECTORY_SEPARATOR . 'htdocs/images' . DIRECTORY_SEPARATOR . 'logo2.png';
     $objDrawing = new PHPExcel_Worksheet_Drawing();
     $objDrawing->setWorksheet($activeSheet);
     $objDrawing->setName("Лого");
     $objDrawing->setPath($logo_path);
     $objDrawing->setCoordinates('A1');
     $objDrawing->setWidthAndHeight(308.3, 75.90000000000001);
     if (null === $rightColumn) {
         $rightColumn = $activeSheet->getHighestDataColumn();
     }
     $activeSheet->mergeCells('A5:' . $rightColumn . '5');
     $activeSheet->setCellValue('A5', $this->title);
     $activeSheet->getStyle('A5')->applyFromArray(array('font' => array('color' => array('rgb' => '376091'), 'bold' => true), 'alignment' => array('indent' => 10)));
     $activeSheet->getStyle('A1:' . $rightColumn . '6')->applyFromArray(array('borders' => array('allborders' => array('style' => PHPExcel_Style_Border::BORDER_NONE)), 'fill' => array('type' => PHPExcel_Style_Fill::FILL_SOLID, 'color' => array('rgb' => 'FFFFFF'))));
     $activeSheet->getStyle('A6:' . $rightColumn . '6')->applyFromArray(array('borders' => array('bottom' => array('style' => PHPExcel_Style_Border::BORDER_MEDIUM, 'color' => array('rgb' => '316194')))));
 }
开发者ID:kbudylov,项目名称:ttarget,代码行数:24,代码来源:ExcelReport.php

示例5: actionExcelDDC

 public function actionExcelDDC()
 {
     date_default_timezone_set('America/Tegucigalpa');
     if (isset($_GET['Estudiante'], $_GET['Practica'])) {
         $IdEstudiante = $_GET['Estudiante'];
         $IdPractica = $_GET['Practica'];
         $Estudiante = UsuarioEstudiante::model()->findByPk($IdEstudiante);
         $PracticaProfesional = PracticaProfesional::model()->findByPk($IdPractica);
         Yii::import('ext.phpexcel.XPHPExcel');
         $objPHPExcel = XPHPExcel::createPHPExcel();
         $objPHPExcel->getProperties()->setCreator("Henry Arévalo")->setLastModifiedBy("Henry Arévalo")->setTitle("Sistema de Gestión de Prácticas Profesionales")->setSubject("UNITEC")->setDescription("SGPP")->setKeywords("HAF")->setCategory("SGPP");
         $objPHPExcel->getActiveSheet()->getPageMargins()->setTop(0.5)->setRight(0.25)->setLeft(0.25)->setBottom(0.5);
         // Bordes
         $BordesEncabezado = array('borders' => array('outline' => array('style' => PHPExcel_Style_Border::BORDER_THIN)));
         // Agregando imagen
         $objDrawingPType = new PHPExcel_Worksheet_Drawing();
         $objDrawingPType->setWorksheet($objPHPExcel->setActiveSheetIndex(0));
         $objDrawingPType->setName("Pareto By Type");
         $objDrawingPType->setPath(Yii::app()->basePath . DIRECTORY_SEPARATOR . "../assets/img/logounitec.png");
         $objDrawingPType->setCoordinates('H1');
         $objDrawingPType->setOffsetX(3);
         $objDrawingPType->setOffsetY(0);
         $objDrawingPType->setWidthAndHeight(180, 90);
         $objDrawingPType->setResizeProportional(true);
         // Rename worksheet
         $objPHPExcel->getActiveSheet()->setTitle('Lista de Estudiantes');
         // COMBINANDO CELDAS
         $objPHPExcel->setActiveSheetIndex(0)->mergeCells('C1:H1');
         $objPHPExcel->setActiveSheetIndex(0)->mergeCells('C2:H2');
         $objPHPExcel->setActiveSheetIndex(0)->mergeCells('B5:D5');
         $objPHPExcel->setActiveSheetIndex(0)->mergeCells('B6:D6');
         $objPHPExcel->setActiveSheetIndex(0)->mergeCells('E6:G6');
         $objPHPExcel->setActiveSheetIndex(0)->mergeCells('H6:J6');
         $objPHPExcel->setActiveSheetIndex(0)->mergeCells('B7:D7');
         $objPHPExcel->setActiveSheetIndex(0)->mergeCells('E7:G7');
         $objPHPExcel->setActiveSheetIndex(0)->mergeCells('H7:J7');
         $objPHPExcel->setActiveSheetIndex(0)->mergeCells('B8:D8');
         $objPHPExcel->setActiveSheetIndex(0)->mergeCells('E8:J8');
         $objPHPExcel->setActiveSheetIndex(0)->mergeCells('B9:D9');
         $objPHPExcel->setActiveSheetIndex(0)->mergeCells('F9:G9');
         $objPHPExcel->setActiveSheetIndex(0)->mergeCells('I9:J9');
         $objPHPExcel->setActiveSheetIndex(0)->mergeCells('B10:J10');
         $objPHPExcel->setActiveSheetIndex(0)->mergeCells('B12:J12');
         // EMPIEZA EMPRESA INSTITUCIÓN
         $objPHPExcel->setActiveSheetIndex(0)->mergeCells('B13:J13');
         $objPHPExcel->setActiveSheetIndex(0)->mergeCells('B14:G14');
         $objPHPExcel->setActiveSheetIndex(0)->mergeCells('H14:J14');
         $objPHPExcel->setActiveSheetIndex(0)->mergeCells('B15:G15');
         $objPHPExcel->setActiveSheetIndex(0)->mergeCells('H15:J15');
         $objPHPExcel->setActiveSheetIndex(0)->mergeCells('B16:D16');
         $objPHPExcel->setActiveSheetIndex(0)->mergeCells('E16:G16');
         $objPHPExcel->setActiveSheetIndex(0)->mergeCells('H16:J16');
         $objPHPExcel->setActiveSheetIndex(0)->mergeCells('B17:D17');
         $objPHPExcel->setActiveSheetIndex(0)->mergeCells('E17:G17');
         $objPHPExcel->setActiveSheetIndex(0)->mergeCells('H17:J17');
         $objPHPExcel->setActiveSheetIndex(0)->mergeCells('B18:D18');
         $objPHPExcel->setActiveSheetIndex(0)->mergeCells('E18:G18');
         $objPHPExcel->setActiveSheetIndex(0)->mergeCells('H18:J18');
         $objPHPExcel->setActiveSheetIndex(0)->mergeCells('B19:D19');
         $objPHPExcel->setActiveSheetIndex(0)->mergeCells('E19:G19');
         $objPHPExcel->setActiveSheetIndex(0)->mergeCells('H19:J19');
         $objPHPExcel->setActiveSheetIndex(0)->mergeCells('B20:J20');
         $objPHPExcel->setActiveSheetIndex(0)->mergeCells('B22:J28');
         $objPHPExcel->setActiveSheetIndex(0)->mergeCells('B29:J29');
         $objPHPExcel->setActiveSheetIndex(0)->mergeCells('B29:J29');
         $objPHPExcel->setActiveSheetIndex(0)->mergeCells('B31:J42');
         $objPHPExcel->setActiveSheetIndex(0)->mergeCells('B43:J43');
         $objPHPExcel->setActiveSheetIndex(0)->mergeCells('B45:J46');
         $objPHPExcel->setActiveSheetIndex(0)->mergeCells('B49:F49');
         $objPHPExcel->setActiveSheetIndex(0)->mergeCells('B50:F50');
         $objPHPExcel->setActiveSheetIndex(0)->mergeCells('G49:J49');
         $objPHPExcel->setActiveSheetIndex(0)->mergeCells('G50:J50');
         // APLICANDO BORDES
         $objPHPExcel->getActiveSheet()->getStyle('B6:D7')->applyFromArray($BordesEncabezado);
         $objPHPExcel->getActiveSheet()->getStyle('E6:G7')->applyFromArray($BordesEncabezado);
         $objPHPExcel->getActiveSheet()->getStyle('H6:J7')->applyFromArray($BordesEncabezado);
         $objPHPExcel->getActiveSheet()->getStyle('B8:D9')->applyFromArray($BordesEncabezado);
         $objPHPExcel->getActiveSheet()->getStyle('E8:J9')->applyFromArray($BordesEncabezado);
         $objPHPExcel->getActiveSheet()->getStyle('B12:J13')->applyFromArray($BordesEncabezado);
         $objPHPExcel->getActiveSheet()->getStyle('B14:G15')->applyFromArray($BordesEncabezado);
         $objPHPExcel->getActiveSheet()->getStyle('H14:J15')->applyFromArray($BordesEncabezado);
         $objPHPExcel->getActiveSheet()->getStyle('B16:D17')->applyFromArray($BordesEncabezado);
         $objPHPExcel->getActiveSheet()->getStyle('B18:D19')->applyFromArray($BordesEncabezado);
         $objPHPExcel->getActiveSheet()->getStyle('E16:G17')->applyFromArray($BordesEncabezado);
         $objPHPExcel->getActiveSheet()->getStyle('E18:G19')->applyFromArray($BordesEncabezado);
         $objPHPExcel->getActiveSheet()->getStyle('H16:J17')->applyFromArray($BordesEncabezado);
         $objPHPExcel->getActiveSheet()->getStyle('H18:J19')->applyFromArray($BordesEncabezado);
         $objPHPExcel->getActiveSheet()->getStyle('B22:J28')->applyFromArray($BordesEncabezado);
         $objPHPExcel->getActiveSheet()->getStyle('B31:J42')->applyFromArray($BordesEncabezado);
         $objPHPExcel->getActiveSheet()->getStyle('B45:J46')->applyFromArray($BordesEncabezado);
         $objPHPExcel->getActiveSheet()->getStyle('B49:F50')->applyFromArray($BordesEncabezado);
         $objPHPExcel->getActiveSheet()->getStyle('G49:J50')->applyFromArray($BordesEncabezado);
         // FORMATOS DE TEXTO ( SIZE, FONT , BOLD)
         $NegritaTamanioCatorce = array('font' => array('bold' => true, 'size' => 14), 'alignment' => array('horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER));
         // Negrita tamaño 14
         $NormalTamanioDoce = array('font' => array('bold' => true, 'size' => 12), 'alignment' => array('horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER));
         // Negrita tamaño 12
         $NormalTamanioOnce = array('font' => array('bold' => true, 'size' => 11), 'alignment' => array('horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_RIGHT));
         // Negrita tamaño 12
         $NormalTamanioDiez = array('font' => array('bold' => true, 'size' => 10), 'alignment' => array('horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_LEFT));
//.........这里部分代码省略.........
开发者ID:efgm1024,项目名称:ProyectoPracticas,代码行数:101,代码来源:UsuarioUnitecController.php

示例6: checkoutCpi


//.........这里部分代码省略.........
     $lastRow = $startRow;
     foreach ($array1 as $value) {
         if (isset($data[$value])) {
             $startRow++;
             $lastRow = $startRow;
             $objActSheet->setCellValue('B' . $startRow, $data[$value]['chs_name']);
             $this->position($objActSheet, 'B' . $startRow);
             $objActSheet->setCellValue('C' . $startRow, ucwords($value));
             $this->position($objActSheet, 'C' . $startRow);
             $objActSheet->setCellValue('D' . $startRow, $data[$value]['score']);
             $this->position($objActSheet, 'D' . $startRow);
             $objActSheet->setCellValue('E' . $startRow, $data[$value]['std_score']);
             $this->position($objActSheet, 'E' . $startRow);
         }
     }
     $objActSheet->getStyle('A7:F' . $lastRow)->applyFromArray($styleArray);
     $startRow++;
     $firstRow = $startRow;
     $lastRow = $startRow;
     $objActSheet->mergeCells('A' . $startRow . ':F' . $startRow);
     $objActSheet->setCellValue('A' . $startRow, '第二类  社会化、成熟度、责任心及价值观念的测验');
     $objActSheet->getStyle('A' . $startRow)->getFont()->setBold(true);
     $this->position($objActSheet, 'A' . $startRow, 'left');
     foreach ($array2 as $value) {
         if (isset($data[$value])) {
             $startRow++;
             $lastRow = $startRow;
             $objActSheet->setCellValue('B' . $startRow, $data[$value]['chs_name']);
             $this->position($objActSheet, 'B' . $startRow);
             $objActSheet->setCellValue('C' . $startRow, ucwords($value));
             $this->position($objActSheet, 'C' . $startRow);
             $objActSheet->setCellValue('D' . $startRow, $data[$value]['score']);
             $this->position($objActSheet, 'D' . $startRow);
             $objActSheet->setCellValue('E' . $startRow, $data[$value]['std_score']);
             $this->position($objActSheet, 'E' . $startRow);
         }
     }
     $objActSheet->getStyle('A' . $firstRow . ':F' . $lastRow)->applyFromArray($styleArray);
     $startRow++;
     $firstRow = $startRow;
     $lastRow = $startRow;
     $objActSheet->mergeCells("A" . $startRow . ":F" . $startRow);
     $objActSheet->setCellValue('A' . $startRow, '第三类  成就能力与智能效率的测验');
     $objActSheet->getStyle('A' . $startRow)->getFont()->setBold(true);
     $this->position($objActSheet, 'A' . $startRow, 'left');
     foreach ($array3 as $value) {
         if (isset($data[$value])) {
             $startRow++;
             $lastRow = $startRow;
             $objActSheet->setCellValue('B' . $startRow, $data[$value]['chs_name']);
             $this->position($objActSheet, 'B' . $startRow);
             $objActSheet->setCellValue('C' . $startRow, ucwords($value));
             $this->position($objActSheet, 'C' . $startRow);
             $objActSheet->setCellValue('D' . $startRow, $data[$value]['score']);
             $this->position($objActSheet, 'D' . $startRow);
             $objActSheet->setCellValue('E' . $startRow, $data[$value]['std_score']);
             $this->position($objActSheet, 'E' . $startRow);
         }
     }
     $objActSheet->getStyle('A' . $firstRow . ':F' . $lastRow)->applyFromArray($styleArray);
     $startRow++;
     $firstRow = $startRow;
     $lastRow = $startRow;
     $objActSheet->mergeCells("A" . $startRow . ":F" . $startRow);
     $objActSheet->setCellValue('A' . $startRow, '第四类  个人的生活态度与倾向的测验');
     $objActSheet->getStyle('A' . $startRow)->getFont()->setBold(true);
     $this->position($objActSheet, 'A' . $startRow, 'left');
     foreach ($array4 as $value) {
         if (isset($data[$value])) {
             $startRow++;
             $lastRow = $startRow;
             $objActSheet->setCellValue('B' . $startRow, $data[$value]['chs_name']);
             $this->position($objActSheet, 'B' . $startRow);
             $objActSheet->setCellValue('C' . $startRow, ucwords($value));
             $this->position($objActSheet, 'C' . $startRow);
             $objActSheet->setCellValue('D' . $startRow, $data[$value]['score']);
             $this->position($objActSheet, 'D' . $startRow);
             $objActSheet->setCellValue('E' . $startRow, $data[$value]['std_score']);
             $this->position($objActSheet, 'E' . $startRow);
         }
     }
     $objActSheet->getStyle('A' . $firstRow . ':F' . $lastRow)->applyFromArray($styleArray);
     $startRow++;
     $startRow++;
     //edit bruce_w 2015-12-9 分页打印
     $startRow += 20;
     $objActSheet->mergeCells("A" . $startRow . ":F" . $startRow);
     $objActSheet->setCellValue('A' . $startRow, '青年性格问卷测试(CPI)剖析图');
     $this->position($objActSheet, 'A' . $startRow);
     $objActSheet->getStyle('A' . $startRow)->getFont()->setBold(true);
     $startRow++;
     $filePath = WordChart::scatter_horiz_Graph_cpi($data, $examinee);
     $objDrawing = new PHPExcel_Worksheet_Drawing();
     $objDrawing->setPath($filePath);
     $width = 15 * 39;
     $height = 20 * 39;
     $objDrawing->setWidthAndHeight($width, $height);
     $objDrawing->setCoordinates("A" . $startRow);
     $objDrawing->setWorksheet($objActSheet);
 }
开发者ID:sunxfancy,项目名称:Questionnaire,代码行数:101,代码来源:CheckoutExcel.php

示例7: PHPExcel

// Create new PHPExcel object
$objPHPExcel = new PHPExcel();
// Set document propertiesz
$objPHPExcel->getProperties()->setCreator("Maarten Balliauw")
    ->setLastModifiedBy("Maarten Balliauw")
    ->setTitle("Office 2007 XLSX Test Document")
    ->setSubject("Office 2007 XLSX Test Document")
    ->setDescription("Test document for Office 2007 XLSX, generated using PHP classes.")
    ->setKeywords("office 2007 openxml php")
    ->setCategory("Test result file");
// for exl logo
$objDrawing = new PHPExcel_Worksheet_Drawing();
$objDrawing->setName('PHPExcel logo');
$objDrawing->setDescription('PHPExcel logo');
$objDrawing->setPath('../image/LOGO.png');
$objDrawing->setWidthAndHeight(200,100);
$objDrawing->setResizeProportional(true);
$objDrawing->setCoordinates('E1');
$objDrawing->setOffsetX(6);
$objDrawing->setOffsetY(8);
$objDrawing->setWorksheet($objPHPExcel->getActiveSheet());
/** Create a new PHPExcel object 1.0 */
$activeempname=mysqli_query($con,"SELECT ULD_ID,ULD_WORKER_NAME FROM LMC_USER_LOGIN_DETAILS  WHERE ULD_USERNAME='$UserStamp'");
if($row=mysqli_fetch_array($activeempname))
{
    $activeemp=$row["ULD_ID"];
}
// COMMOM DATA
if($_REQUEST['option']=='COMMON_DATA')
{
//MEETING TOPIC
开发者ID:Rajagunasekaran,项目名称:lmc,代码行数:31,代码来源:DB_PERMITS_ENTRY.php


注:本文中的PHPExcel_Worksheet_Drawing::setWidthAndHeight方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。