0

我想要实现的示例报告标题

我想实现这样的报告标题。$writer->writeSheetRow()如果我使用then添加报告标题和副标题,则$writer->writeSheetHeader()不会显示标题行。此外,我无法将图像插入工作表。如果有任何示例代码,那将非常有帮助。提前致谢!

 

4

1 回答 1

0

在生成 Excel 之前添加以下代码:

//locate where you have saved your image
$image = imagecreatefromjpeg('images/officelogo.jpg');
$objDrawing = new PHPExcel_Worksheet_MemoryDrawing();
$objDrawing->setName('Sample image');$objDrawing->setDescription('Sample image');
$objDrawing->setImageResource($image);
$objDrawing->setRenderingFunction(PHPExcel_Worksheet_MemoryDrawing::RENDERING_JPEG);
$objDrawing->setMimeType(PHPExcel_Worksheet_MemoryDrawing::MIMETYPE_DEFAULT);
$objDrawing->setHeight(150);
//Then locate where shall the image be placed in the excel, it indicates the UPPER LEFT corner if the image
$objDrawing->setCoordinates('A3');
$objDrawing->setWorksheet($objPHPExcel->getActiveSheet());
于 2019-03-19T06:57:38.980 回答