这是我在控制器中的操作,但它给出了这个错误:
Your report has an error and couldn't be processed!
Try to output the command: C:^^^\xampp^^^\htdocs^^^\pay^^^\vendor^^^\chrmorandi^^^\yii2-jasper^^^\src^^^\Jasper/../JasperStarter/bin/jasperstarter
compile C:^^^\xampp^^^\htdocs^^^\pay/vendor/chrmorandi/yii2-jasper/examples/shipments_report.jrxml//设置sample目录的别名
Yii::setAlias('@example', '@vendor/chrmorandi/yii2-jasper/examples');
/* @var $jasper Jasper */
$jasper = Yii::$app->jasper;
// Compile a JRXML to Jasper
$jasper->compile(Yii::getAlias('@example') . '/shipments_report.jrxml')->execute();
// Process a Jasper file to PDF and RTF (you can use directly the .jrxml)
$jasper->process(
Yii::getAlias('@example') . '/shipments_report.jasper',
['php_version' => '7.1.11'],
['pdf', 'rtf'],
false,
false
)->execute();
// List the parameters from a Jasper file.
$array = $jasper->listParameters(Yii::getAlias('@example') . '/shipments_report.jasper')->execute();
// return pdf file
Yii::$app->response->sendFile(Yii::getAlias('@example') . '/shipments_report.pdf');发布于 2018-01-11 08:57:58
设置别名时缺少@,请更改以下内容
Yii::setAlias('example', '@vendor/chrmorandi/yii2-jasper/examples');至
Yii::setAlias('@example', '@vendor/chrmorandi/yii2-jasper/examples');https://stackoverflow.com/questions/48198138
复制相似问题