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


PHP PHPExcel_Worksheet_Drawing::setResizeProportional方法代码示例

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


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

示例1: load


//.........这里部分代码省略.........
										}

										if ($vmlRelationship != '') {
											// Fetch linked images
											$relsVML = simplexml_load_string($this->_getFromZipArchive($zip,  dirname($vmlRelationship) . '/_rels/' . basename($vmlRelationship) . '.rels' )); //~ http://schemas.openxmlformats.org/package/2006/relationships");
											$drawings = array();
											foreach ($relsVML->Relationship as $ele) {
												if ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image") {
													$drawings[(string) $ele["Id"]] = self::dir_add($vmlRelationship, $ele["Target"]);
												}
											}

											// Fetch VML document
											$vmlDrawing = simplexml_load_string($this->_getFromZipArchive($zip, $vmlRelationship));
											$vmlDrawing->registerXPathNamespace('v', 'urn:schemas-microsoft-com:vml');

											$hfImages = array();

											$shapes = $vmlDrawing->xpath('//v:shape');
											foreach ($shapes as $shape) {
												$shape->registerXPathNamespace('v', 'urn:schemas-microsoft-com:vml');
												$imageData = $shape->xpath('//v:imagedata');
												$imageData = $imageData[0];

												$imageData = $imageData->attributes('urn:schemas-microsoft-com:office:office');
												$style = self::toCSSArray( (string)$shape['style'] );

												$hfImages[ (string)$shape['id'] ] = new PHPExcel_Worksheet_HeaderFooterDrawing();
												if (isset($imageData['title'])) {
													$hfImages[ (string)$shape['id'] ]->setName( (string)$imageData['title'] );
												}

												$hfImages[ (string)$shape['id'] ]->setPath("zip://$pFilename#" . $drawings[(string)$imageData['relid']], false);
												$hfImages[ (string)$shape['id'] ]->setResizeProportional(false);
												$hfImages[ (string)$shape['id'] ]->setWidth($style['width']);
												$hfImages[ (string)$shape['id'] ]->setHeight($style['height']);
												$hfImages[ (string)$shape['id'] ]->setOffsetX($style['margin-left']);
												$hfImages[ (string)$shape['id'] ]->setOffsetY($style['margin-top']);
												$hfImages[ (string)$shape['id'] ]->setResizeProportional(true);
											}

											$docSheet->getHeaderFooter()->setImages($hfImages);
										}
									}
								}

							}

	// ----: Make sure drawings and graph are loaded differently!
							if ($zip->locateName(dirname("$dir/$fileWorksheet") . "/_rels/" . basename($fileWorksheet) . ".rels")) {
								$relsWorksheet = simplexml_load_string($this->_getFromZipArchive($zip,  dirname("$dir/$fileWorksheet") . "/_rels/" . basename($fileWorksheet) . ".rels") ); //~ http://schemas.openxmlformats.org/package/2006/relationships");
								$drawings = array();
								foreach ($relsWorksheet->Relationship as $ele) {
									if ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing") {
										$drawings[(string) $ele["Id"]] = self::dir_add("$dir/$fileWorksheet", $ele["Target"]);
									}
								}
								if ($xmlSheet->drawing && !$this->_readDataOnly) {
									foreach ($xmlSheet->drawing as $drawing) {
										$fileDrawing = $drawings[(string) self::array_item($drawing->attributes("http://schemas.openxmlformats.org/officeDocument/2006/relationships"), "id")];
										$relsDrawing = simplexml_load_string($this->_getFromZipArchive($zip,  dirname($fileDrawing) . "/_rels/" . basename($fileDrawing) . ".rels") ); //~ http://schemas.openxmlformats.org/package/2006/relationships");
										$images = array();

										if ($relsDrawing && $relsDrawing->Relationship) {
											foreach ($relsDrawing->Relationship as $ele) {
												if ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image") {
开发者ID:Opmantek,项目名称:open-audit,代码行数:67,代码来源:Excel2007.php

示例2: 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

示例3: load


//.........这里部分代码省略.........
                                     //~ http://schemas.openxmlformats.org/package/2006/relationships");
                                     $vmlRelationship = '';
                                     foreach ($relsWorksheet->Relationship as $ele) {
                                         if ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing") {
                                             $vmlRelationship = self::dir_add("{$dir}/{$fileWorksheet}", $ele["Target"]);
                                         }
                                     }
                                     if ($vmlRelationship != '') {
                                         // Fetch linked images
                                         $relsVML = simplexml_load_string($this->_getFromZipArchive($zip, dirname($vmlRelationship) . '/_rels/' . basename($vmlRelationship) . '.rels'));
                                         //~ http://schemas.openxmlformats.org/package/2006/relationships");
                                         $drawings = array();
                                         foreach ($relsVML->Relationship as $ele) {
                                             if ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image") {
                                                 $drawings[(string) $ele["Id"]] = self::dir_add($vmlRelationship, $ele["Target"]);
                                             }
                                         }
                                         // Fetch VML document
                                         $vmlDrawing = simplexml_load_string($this->_getFromZipArchive($zip, $vmlRelationship));
                                         $vmlDrawing->registerXPathNamespace('v', 'urn:schemas-microsoft-com:vml');
                                         $hfImages = array();
                                         $shapes = $vmlDrawing->xpath('//v:shape');
                                         foreach ($shapes as $shape) {
                                             $shape->registerXPathNamespace('v', 'urn:schemas-microsoft-com:vml');
                                             $imageData = $shape->xpath('//v:imagedata');
                                             $imageData = $imageData[0];
                                             $imageData = $imageData->attributes('urn:schemas-microsoft-com:office:office');
                                             $style = self::toCSSArray((string) $shape['style']);
                                             $hfImages[(string) $shape['id']] = new PHPExcel_Worksheet_HeaderFooterDrawing();
                                             if (isset($imageData['title'])) {
                                                 $hfImages[(string) $shape['id']]->setName((string) $imageData['title']);
                                             }
                                             $hfImages[(string) $shape['id']]->setPath("zip://" . PHPExcel_Shared_File::realpath($pFilename) . "#" . $drawings[(string) $imageData['relid']], false);
                                             $hfImages[(string) $shape['id']]->setResizeProportional(false);
                                             $hfImages[(string) $shape['id']]->setWidth($style['width']);
                                             $hfImages[(string) $shape['id']]->setHeight($style['height']);
                                             $hfImages[(string) $shape['id']]->setOffsetX($style['margin-left']);
                                             $hfImages[(string) $shape['id']]->setOffsetY($style['margin-top']);
                                             $hfImages[(string) $shape['id']]->setResizeProportional(true);
                                         }
                                         $docSheet->getHeaderFooter()->setImages($hfImages);
                                     }
                                 }
                             }
                         }
                         // TODO: Autoshapes from twoCellAnchors!
                         if ($zip->locateName(dirname("{$dir}/{$fileWorksheet}") . "/_rels/" . basename($fileWorksheet) . ".rels")) {
                             $relsWorksheet = simplexml_load_string($this->_getFromZipArchive($zip, dirname("{$dir}/{$fileWorksheet}") . "/_rels/" . basename($fileWorksheet) . ".rels"));
                             //~ http://schemas.openxmlformats.org/package/2006/relationships");
                             $drawings = array();
                             foreach ($relsWorksheet->Relationship as $ele) {
                                 if ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing") {
                                     $drawings[(string) $ele["Id"]] = self::dir_add("{$dir}/{$fileWorksheet}", $ele["Target"]);
                                 }
                             }
                             if ($xmlSheet->drawing && !$this->_readDataOnly) {
                                 foreach ($xmlSheet->drawing as $drawing) {
                                     $fileDrawing = $drawings[(string) self::array_item($drawing->attributes("http://schemas.openxmlformats.org/officeDocument/2006/relationships"), "id")];
                                     $relsDrawing = simplexml_load_string($this->_getFromZipArchive($zip, dirname($fileDrawing) . "/_rels/" . basename($fileDrawing) . ".rels"));
                                     //~ http://schemas.openxmlformats.org/package/2006/relationships");
                                     $images = array();
                                     if ($relsDrawing && $relsDrawing->Relationship) {
                                         foreach ($relsDrawing->Relationship as $ele) {
                                             if ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image") {
                                                 $images[(string) $ele["Id"]] = self::dir_add($fileDrawing, $ele["Target"]);
                                             } elseif ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart") {
开发者ID:jimlongo56,项目名称:bhouse,代码行数:67,代码来源:Excel2007.php

示例4: postAction


//.........这里部分代码省略.........
                 $objPHPExcel->getActiveSheet()->getStyle('A' . $i)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
                 $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);
开发者ID:planetwebsolution,项目名称:Magento-Sample-Code,代码行数:67,代码来源:MyformController.php

示例5: insert_bitmap

 /**
  * Insert an image in a worksheet.
  *
  * @param integer $row     The row we are going to insert the bitmap into
  * @param integer $col     The column we are going to insert the bitmap into
  * @param string  $bitmap  The bitmap filename
  * @param integer $x       The horizontal position (offset) of the image inside the cell.
  * @param integer $y       The vertical position (offset) of the image inside the cell.
  * @param integer $scale_x The horizontal scale
  * @param integer $scale_y The vertical scale
  */
 public function insert_bitmap($row, $col, $bitmap, $x = 0, $y = 0, $scale_x = 1, $scale_y = 1)
 {
     $objDrawing = new PHPExcel_Worksheet_Drawing();
     $objDrawing->setPath($bitmap);
     $objDrawing->setCoordinates(PHPExcel_Cell::stringFromColumnIndex($col) . ($row + 1));
     $objDrawing->setOffsetX($x);
     $objDrawing->setOffsetY($y);
     $objDrawing->setWorksheet($this->worksheet);
     if ($scale_x != 1) {
         $objDrawing->setResizeProportional(false);
         $objDrawing->getWidth($objDrawing->getWidth() * $scale_x);
     }
     if ($scale_y != 1) {
         $objDrawing->setResizeProportional(false);
         $objDrawing->setHeight($objDrawing->getHeight() * $scale_y);
     }
 }
开发者ID:Gavinthisisit,项目名称:Moodle,代码行数:28,代码来源:excellib.class.php

示例6: date

 $aSheet->insertNewRowBefore(1, 2);
 //Some empty rows for space
 $aSheet->setCellValue('A4', $user->area);
 $aSheet->setCellValue('A5', 'Reporte de Atención de documentos' . date("d-m-Y") . " {$user->abr_area}");
 $aSheet->getStyle('A4')->getFont()->getColor()->setARGB(PHPExcel_Style_Color::COLOR_DARKYELLOW);
 $aSheet->getStyle('A4')->getFont()->setSize(16);
 $aSheet->getStyle('A5')->getFont()->setSize(12);
 // Add a drawing to the worksheet
 echo date('H:i:s') . " Add a drawing to the worksheet\n<br/>";
 $objDrawing = new PHPExcel_Worksheet_Drawing();
 $objDrawing->setName('Logo');
 $objDrawing->setDescription('Logo');
 $objDrawing->setPath('./public_root/imgs/logo-oficial.jpg');
 $objDrawing->setHeight(46);
 $objDrawing->setCoordinates('A1');
 $objDrawing->setResizeProportional(false);
 $objDrawing->setWorksheet($aSheet);
 // Rename sheet
 echo date('H:i:s') . " Rename sheet\n<br />";
 $aSheet->setTitle("Area {$user->abr_area}");
 // Save Excel 2000 file
 echo date('H:i:s') . " Write to Excel5 format\n<br />";
 $objWriter = new PHPExcel_Writer_Excel5($objPHPExcel);
 $objWriter->save("temp/reporte{$k}.xls");
 /**************End save*****************/
 /*
  */
 #$xls->generateAndSaveXML($_SERVER['DOCUMENT_ROOT'] . '/temp/', 'my-test.xls');
 $mail->Subject = $user->abr_area . ": Reporte de Atencion de Documentos:" . date('d-m-Y');
 $mail->Body = $content;
 #echo $user->email;
开发者ID:electromanlord,项目名称:sgd,代码行数:31,代码来源:envio_reportes.php

示例7: load


//.........这里部分代码省略.........
                                 //~ http://schemas.openxmlformats.org/package/2006/relationships");
                                 $vmlRelationship = '';
                                 foreach ($relsWorksheet->Relationship as $ele) {
                                     if ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing") {
                                         $vmlRelationship = self::dir_add("{$dir}/{$fileWorksheet}", $ele["Target"]);
                                     }
                                 }
                                 if ($vmlRelationship != '') {
                                     // Fetch linked images
                                     $relsVML = simplexml_load_string($zip->getFromName(dirname($vmlRelationship) . '/_rels/' . basename($vmlRelationship) . '.rels'));
                                     //~ http://schemas.openxmlformats.org/package/2006/relationships");
                                     $drawings = array();
                                     foreach ($relsVML->Relationship as $ele) {
                                         if ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image") {
                                             $drawings[(string) $ele["Id"]] = self::dir_add($vmlRelationship, $ele["Target"]);
                                         }
                                     }
                                     // Fetch VML document
                                     $vmlDrawing = simplexml_load_string($zip->getFromName($vmlRelationship));
                                     $vmlDrawing->registerXPathNamespace('v', 'urn:schemas-microsoft-com:vml');
                                     $hfImages = array();
                                     $shapes = $vmlDrawing->xpath('//v:shape');
                                     foreach ($shapes as $shape) {
                                         $shape->registerXPathNamespace('v', 'urn:schemas-microsoft-com:vml');
                                         $imageData = $shape->xpath('//v:imagedata');
                                         $imageData = $imageData[0];
                                         $imageData = $imageData->attributes('urn:schemas-microsoft-com:office:office');
                                         $style = self::toCSSArray((string) $shape['style']);
                                         $hfImages[(string) $shape['id']] = new PHPExcel_Worksheet_HeaderFooterDrawing();
                                         if (isset($imageData['title'])) {
                                             $hfImages[(string) $shape['id']]->setName((string) $imageData['title']);
                                         }
                                         $hfImages[(string) $shape['id']]->setPath("zip://{$pFilename}#" . $drawings[(string) $imageData['relid']], false);
                                         $hfImages[(string) $shape['id']]->setResizeProportional(false);
                                         $hfImages[(string) $shape['id']]->setWidth($style['width']);
                                         $hfImages[(string) $shape['id']]->setHeight($style['height']);
                                         $hfImages[(string) $shape['id']]->setOffsetX($style['margin-left']);
                                         $hfImages[(string) $shape['id']]->setOffsetY($style['margin-top']);
                                         $hfImages[(string) $shape['id']]->setResizeProportional(true);
                                     }
                                     $docSheet->getHeaderFooter()->setImages($hfImages);
                                 }
                             }
                         }
                     }
                     // TODO: Make sure drawings and graph are loaded differently!
                     if ($zip->locateName(dirname("{$dir}/{$fileWorksheet}") . "/_rels/" . basename($fileWorksheet) . ".rels")) {
                         $relsWorksheet = simplexml_load_string($zip->getFromName(dirname("{$dir}/{$fileWorksheet}") . "/_rels/" . basename($fileWorksheet) . ".rels"));
                         //~ http://schemas.openxmlformats.org/package/2006/relationships");
                         $drawings = array();
                         foreach ($relsWorksheet->Relationship as $ele) {
                             if ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing") {
                                 $drawings[(string) $ele["Id"]] = self::dir_add("{$dir}/{$fileWorksheet}", $ele["Target"]);
                             }
                         }
                         if ($xmlSheet->drawing && !$this->_readDataOnly) {
                             foreach ($xmlSheet->drawing as $drawing) {
                                 $fileDrawing = $drawings[(string) self::array_item($drawing->attributes("http://schemas.openxmlformats.org/officeDocument/2006/relationships"), "id")];
                                 $relsDrawing = simplexml_load_string($zip->getFromName(dirname($fileDrawing) . "/_rels/" . basename($fileDrawing) . ".rels"));
                                 //~ http://schemas.openxmlformats.org/package/2006/relationships");
                                 $images = array();
                                 if ($relsDrawing && $relsDrawing->Relationship) {
                                     foreach ($relsDrawing->Relationship as $ele) {
                                         if ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image") {
                                             $images[(string) $ele["Id"]] = self::dir_add($fileDrawing, $ele["Target"]);
                                         }
开发者ID:abhinay100,项目名称:fengoffice_app,代码行数:67,代码来源:Excel2007.php

示例8: load


//.........这里部分代码省略.........
                                 if (isset($hyperlink['tooltip'])) {
                                     $docSheet->getCell($hyperlink['ref'])->getHyperlink()->setTooltip((string) $hyperlink['tooltip']);
                                 }
                             }
                         }
                     }
                     // Add comments
                     $comments = array();
                     if (!$this->_readDataOnly) {
                         // Locate comment relations
                         if ($zip->locateName(dirname("{$dir}/{$fileWorksheet}") . "/_rels/" . basename($fileWorksheet) . ".rels")) {
                             $relsWorksheet = simplexml_load_string($zip->getFromName(dirname("{$dir}/{$fileWorksheet}") . "/_rels/" . basename($fileWorksheet) . ".rels"));
                             //~ http://schemas.openxmlformats.org/package/2006/relationships");
                             foreach ($relsWorksheet->Relationship as $ele) {
                                 if ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments") {
                                     $comments[(string) $ele["Id"]] = (string) $ele["Target"];
                                 }
                             }
                         }
                         // Loop trough comments
                         foreach ($comments as $relName => $relPath) {
                             // Load comments file
                             $relPath = PHPExcel_Shared_File::realpath(dirname("{$dir}/{$fileWorksheet}") . "/" . $relPath);
                             $commentsFile = simplexml_load_string($zip->getFromName($relPath));
                             // Utility variables
                             $authors = array();
                             // Loop trough authors
                             foreach ($commentsFile->authors->author as $author) {
                                 $authors[] = (string) $author;
                             }
                             // Loop trough contents
                             foreach ($commentsFile->commentList->comment as $comment) {
                                 $docSheet->getComment((string) $comment['ref'])->setAuthor($authors[(string) $comment['authorId']]);
                                 $docSheet->getComment((string) $comment['ref'])->setText($this->_parseRichText($comment->text));
                             }
                         }
                     }
                     // TODO: Make sure drawings and graph are loaded differently!
                     if ($zip->locateName(dirname("{$dir}/{$fileWorksheet}") . "/_rels/" . basename($fileWorksheet) . ".rels")) {
                         $relsWorksheet = simplexml_load_string($zip->getFromName(dirname("{$dir}/{$fileWorksheet}") . "/_rels/" . basename($fileWorksheet) . ".rels"));
                         //~ http://schemas.openxmlformats.org/package/2006/relationships");
                         $drawings = array();
                         foreach ($relsWorksheet->Relationship as $ele) {
                             if ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing") {
                                 $drawings[(string) $ele["Id"]] = self::dir_add("{$dir}/{$fileWorksheet}", $ele["Target"]);
                             }
                         }
                         if ($xmlSheet->drawing && !$this->_readDataOnly) {
                             foreach ($xmlSheet->drawing as $drawing) {
                                 $fileDrawing = $drawings[(string) self::array_item($drawing->attributes("http://schemas.openxmlformats.org/officeDocument/2006/relationships"), "id")];
                                 $relsDrawing = simplexml_load_string($zip->getFromName(dirname($fileDrawing) . "/_rels/" . basename($fileDrawing) . ".rels"));
                                 //~ http://schemas.openxmlformats.org/package/2006/relationships");
                                 $images = array();
                                 foreach ($relsDrawing->Relationship as $ele) {
                                     if ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image") {
                                         $images[(string) $ele["Id"]] = self::dir_add($fileDrawing, $ele["Target"]);
                                     }
                                 }
                                 $xmlDrawing = simplexml_load_string($zip->getFromName($fileDrawing))->children("http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing");
                                 foreach ($xmlDrawing->oneCellAnchor as $oneCellAnchor) {
                                     $blip = $oneCellAnchor->pic->blipFill->children("http://schemas.openxmlformats.org/drawingml/2006/main")->blip;
                                     $xfrm = $oneCellAnchor->pic->spPr->children("http://schemas.openxmlformats.org/drawingml/2006/main")->xfrm;
                                     $outerShdw = $oneCellAnchor->pic->spPr->children("http://schemas.openxmlformats.org/drawingml/2006/main")->effectLst->outerShdw;
                                     $objDrawing = new PHPExcel_Worksheet_Drawing();
                                     $objDrawing->setName((string) self::array_item($oneCellAnchor->pic->nvPicPr->cNvPr->attributes(), "name"));
                                     $objDrawing->setDescription((string) self::array_item($oneCellAnchor->pic->nvPicPr->cNvPr->attributes(), "descr"));
                                     $objDrawing->setPath("zip://{$pFilename}#" . $images[(string) self::array_item($blip->attributes("http://schemas.openxmlformats.org/officeDocument/2006/relationships"), "embed")], false);
                                     $objDrawing->setCoordinates(PHPExcel_Cell::stringFromColumnIndex($oneCellAnchor->from->col) . ($oneCellAnchor->from->row + 1));
                                     $objDrawing->setOffsetX(PHPExcel_Shared_Drawing::EMUToPixels($oneCellAnchor->from->colOff));
                                     $objDrawing->setOffsetY(PHPExcel_Shared_Drawing::EMUToPixels($oneCellAnchor->from->rowOff));
                                     $objDrawing->setResizeProportional(false);
                                     $objDrawing->setWidth(PHPExcel_Shared_Drawing::EMUToPixels(self::array_item($oneCellAnchor->ext->attributes(), "cx")));
                                     $objDrawing->setHeight(PHPExcel_Shared_Drawing::EMUToPixels(self::array_item($oneCellAnchor->ext->attributes(), "cy")));
                                     if ($xfrm) {
                                         $objDrawing->setRotation(PHPExcel_Shared_Drawing::angleToDegrees(self::array_item($xfrm->attributes(), "rot")));
                                     }
                                     if ($outerShdw) {
                                         $shadow = $objDrawing->getShadow();
                                         $shadow->setVisible(true);
                                         $shadow->setBlurRadius(PHPExcel_Shared_Drawing::EMUTopixels(self::array_item($outerShdw->attributes(), "blurRad")));
                                         $shadow->setDistance(PHPExcel_Shared_Drawing::EMUTopixels(self::array_item($outerShdw->attributes(), "dist")));
                                         $shadow->setDirection(PHPExcel_Shared_Drawing::angleToDegrees(self::array_item($outerShdw->attributes(), "dir")));
                                         $shadow->setAlignment((string) self::array_item($outerShdw->attributes(), "algn"));
                                         $shadow->getColor()->setRGB(self::array_item($outerShdw->srgbClr->attributes(), "val"));
                                         $shadow->setAlpha(self::array_item($outerShdw->srgbClr->alpha->attributes(), "val") / 1000);
                                     }
                                     $objDrawing->setWorksheet($docSheet);
                                 }
                             }
                         }
                     }
                 }
                 if (!$this->_readDataOnly) {
                     $excel->setActiveSheetIndex(intval($xmlWorkbook->bookView->workbookView["activeTab"]));
                 }
                 break;
         }
     }
     return $excel;
 }
开发者ID:hostellerie,项目名称:nexpro,代码行数:101,代码来源:Excel2007.php

示例9: actionExcel

 public function actionExcel()
 {
     /*
         Проверка на доступ пользователя к странице
     */
     $permissions_report_task_search = \app\models\Permissions::find()->where('(SUBJECT_TYPE = :subject_type and SUBJECT_ID = :user_id and DEL_TRACT_ID = :del_tract and PERM_LEVEL != :perm_level and ACTION_ID = :action) or
                                     (SUBJECT_TYPE = :subject_type_dolg and SUBJECT_ID = :dolg_id and DEL_TRACT_ID = :del_tract and PERM_LEVEL != :perm_level and ACTION_ID = :action)', ['subject_type_dolg' => 1, 'dolg_id' => \Yii::$app->session->get('user.user_iddolg'), 'action' => 82, 'subject_type' => 2, 'user_id' => \Yii::$app->user->id, 'del_tract' => 0, 'perm_level' => 0])->one();
     if ($permissions_report_task_search) {
         /*
             Проверяем получены ли идентификаторы заданий для формирования отчета
         */
         if (Yii::$app->request->get('ids')) {
             $issues_ids = Yii::$app->request->get('ids');
             $issues_ids = explode(',', $issues_ids);
             /*
                 Делаем выборку необходимых заданий
             */
             $model = \app\models\Tasks::find()->where(['ID' => $issues_ids])->all();
             if ($model) {
                 // Создаем объект класса PHPExcel
                 $xls = new \PHPExcel();
                 // Устанавливаем индекс активного листа
                 $xls->setActiveSheetIndex(0);
                 // Получаем активный лист
                 $sheet = $xls->getActiveSheet();
                 // Подписываем лист
                 $sheet->setTitle('Отчет по отобранным заданиям');
                 $sheet->getStyle('A1')->getFont()->setBold(true);
                 // Вставляем текст в ячейку A1
                 $sheet->setCellValue("A1", 'Отчет по отобранным заданиям');
                 $sheet->getStyle('A1')->getFill()->setFillType(\PHPExcel_Style_Fill::FILL_SOLID);
                 $sheet->getStyle('A1')->getFill()->getStartColor()->setRGB('EEEEEE');
                 // Объединяем ячейки
                 $sheet->mergeCells('A1:I1');
                 // Выравнивание текста
                 $sheet->getStyle('A1')->getAlignment()->setHorizontal(\PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
                 // Формируем шапку
                 $sheet->setCellValue("A2", 'Заказ ПЭО');
                 $sheet->setCellValue("B2", 'Номер заказа');
                 $sheet->setCellValue("C2", 'Проект/Тема');
                 $sheet->setCellValue("D2", 'Обозначение');
                 $sheet->setCellValue("E2", 'Наименование');
                 $sheet->setCellValue("F2", 'Срок выполнения');
                 $sheet->setCellValue("G2", 'Статус');
                 $sheet->setCellValue("H2", 'Ф.И.О. и Дата');
                 $sheet->setCellValue("I2", 'Форматов А4');
                 /* устанавливаем ширину колонок и стили*/
                 $sheet->getStyle('A2:I2')->getFont()->setBold(true);
                 $sheet->getColumnDimension('A')->setAutoSize(true);
                 $sheet->getColumnDimension('B')->setAutoSize(true);
                 $sheet->getColumnDimension('C')->setAutoSize(true);
                 $sheet->getColumnDimension('D')->setAutoSize(true);
                 $sheet->getColumnDimension('E')->setAutoSize(true);
                 $sheet->getColumnDimension('F')->setAutoSize(true);
                 $sheet->getColumnDimension('G')->setWidth(20);
                 $sheet->getColumnDimension('H')->setAutoSize(true);
                 $sheet->getColumnDimension('I')->setAutoSize(true);
                 $row_number = 3;
                 foreach ($model as $task) {
                     $sheet->setCellValue("A" . $row_number, $task->PEOORDERNUM);
                     $sheet->setCellValue("B" . $row_number, $task->ORDERNUM);
                     $sheet->setCellValue("C" . $row_number, '');
                     $sheet->setCellValue("D" . $row_number, $task->TASK_NUMBER);
                     $sheet->setCellValue("E" . $row_number, 'Задание');
                     $sheet->setCellValue("F" . $row_number, \Yii::$app->formatter->asDate($task->DEADLINE, 'php:d-m-Y'));
                     //вставляем информацию по статусам
                     $task_states = \app\models\TaskStates::find()->where(['TASK_ID' => $task->ID])->orderBy('STATE_ID ASC')->all();
                     if ($task_states) {
                         foreach ($task_states as $state) {
                             $state_date = $state->getStateDate();
                             $logo = new \PHPExcel_Worksheet_Drawing();
                             $logo->setPath(Yii::getAlias('@webroot') . '/images/items_status/' . $state->getStateColour() . '.png');
                             $logo->setCoordinates("G" . $row_number);
                             $logo->setOffsetX(5);
                             $logo->setOffsetY(2);
                             $logo->setResizeProportional(true);
                             $logo->setWidth(16);
                             $logo->setWorksheet($sheet);
                             $sheet->setCellValue("G" . $row_number, '        ' . $state->getStateName());
                             $pers_tasks = \app\models\PersTasks::findOne($state->PERS_TASKS_ID);
                             $query = new \yii\db\Query();
                             $query->select('*')->from('STIGIT.V_F_PERS')->where('TN = \'' . $pers_tasks->TN . '\'');
                             $command = $query->createCommand();
                             $data = $command->queryOne();
                             $sheet->setCellValue("H" . $row_number, $data['FIO'] . ' ' . $state_date);
                             $task_docs = \app\models\TaskDocs::find()->where(['PERS_TASKS_ID' => $state->PERS_TASKS_ID])->one();
                             if ($task_docs) {
                                 $quantity = $task_docs->FORMAT_QUANTITY;
                             } else {
                                 $quantity = 0;
                             }
                             $sheet->setCellValue("I" . $row_number, $quantity);
                             $row_number++;
                         }
                     }
                     $row_number++;
                 }
                 //стили для рамки таблицы
                 $styleArray = array('borders' => array('allborders' => array('style' => \PHPExcel_Style_Border::BORDER_THIN)));
                 $total_rows = $row_number - 1;
//.........这里部分代码省略.........
开发者ID:alaevka,项目名称:stigit.basalt,代码行数:101,代码来源:ReportsController.php

示例10: 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

示例11: PHPExcel

$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
    $topic=mysqli_query($con,"SELECT MT_TOPIC FROM LMC_MEETING_TOPIC ORDER BY MT_TOPIC ASC");
开发者ID:Rajagunasekaran,项目名称:lmc,代码行数:31,代码来源:DB_PERMITS_ENTRY.php

示例12:

         if (!file_exists($cache_path)) {
             ImageManager::resize($path, $cache_path, 200);
         }
         if (!file_exists($cache_path)) {
             $cache_path = $path;
         }
         $drawing = new PHPExcel_Worksheet_Drawing();
         $drawing->setName($p['products_name']);
         $drawing->setDescription($p['products_name']);
         $drawing->setPath($cache_path);
         $drawing->setWidth($width);
         //$drawing->setHeight($height);
         $drawing->setCoordinates('A' . $product_row);
         $drawing->setOffsetX($offset_x);
         $drawing->setOffsetY($offset_y);
         $drawing->setResizeProportional(40);
         $drawing->setWorksheet($sheet);
     }
     //End Image
     $product_row += 2;
 }
 $sheet->setCellValue('D' . $order_row, $o['order_total']);
 $sheet->mergeCells('D' . $order_row . ':D' . $order_row_max);
 $sheet->getStyle('D' . $order_row . ':D' . $order_row_max)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
 $sheet->setCellValue('E' . $order_row, $o['delivery_name']);
 $sheet->mergeCells('E' . $order_row . ':E' . $order_row_max);
 $sheet->getStyle('E' . $order_row . ':E' . $order_row_max)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
 $delivery_address = $o["delivery_street_address"] . " " . $o["delivery_city"] . " " . $o["delivery_state"] . ", " . $o["delivery_country"];
 $delivery_address .= '  ' . $o['delivery_postcode'];
 $sheet->setCellValue('F' . $order_row, $delivery_address);
 $sheet->mergeCells('F' . $order_row . ':F' . $order_row_max);
开发者ID:wwxgitcat,项目名称:zencart_v1.0,代码行数:31,代码来源:order_man.php


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