我正在使用PHP Excel,以2张纸的形式导出数据。每个工作表应具有不同的结构和不同的内容。在这里,我有代码,我试图用它生成2个名称不同但数据和结构相同的图纸。这是我使用的代码:
<?php
include '...config.php';
/** Error reporting */
error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);
date_default_timezone_set('Europe/London');
if (PHP_SAPI == 'cli')
die('This example should only be run from a Web Browser');
/** Include PHPExcel */
require_once dirname(__FILE__) . '/../Classes/PHPExcel.php';
// Create new PHPExcel object
$objPHPExcel = new PHPExcel();
// FIRST SHEET BEGIN
// Rename worksheet
$objPHPExcel->getActiveSheet(0)->setTitle('FIRST SHEET');
// Set active sheet index to the first sheet, so Excel opens this as the first sheet
//$objPHPExcel->setActiveSheetIndex();
// Set document properties
$objPHPExcel->getProperties()->setCreator("test.de")
->setLastModifiedBy("test.de")
->setTitle("Study …
Run Code Online (Sandbox Code Playgroud)