我是gettingerror"无法关闭zip文件.."并意识到它没有权限写入该目录。 在这里我的代码:
$template = 'myexcel1.xls';
//set absolute path to directory with template files
$templateDir = __DIR__ . "/../controllers/";
//set config for report
$config = array(
'template' => $template,
'templateDir' => $templateDir
);
//load template
$R = new PHPReport($config);
// print_r($R); die();
$R->load(array(
'id' => 'scenario_input',
'repeat' => TRUE,
'data' => $data
)
);
// print_r($R); die();
// define output directoy
$output_file_dir = 'opt/lampp/htdocs/randema/';
$output_file_excel = $output_file_dir . 'Myexcel1.xls';
//download excel sheet with data in /tmp folder
$result = $R->render('excel', $output_file_excel);