php - iReport send generated PDF report via email -


i'm using jasper report ireport 5.6.0 create dynamic reports company. integrated reporting tool php web application, it's working. created export options in html template , preview button in iframe

i don't want put iframe in php variable , send email function. can generate report downloadable pdf, xls .. file, can send file automatically attachment email ?

i'm using laravel framework, code generating , exporting report:

    use jasperphp\jasperphp;  public function xmltopdf()     {         $output = public_path() . '/report/'.time().'_cancelack';         $output = public_path() . '/report/'.time().'_cancelack';         $ext = "pdf";         $data_file = public_path() . '/report/cancelack.xml';         $driver = 'xml';         $xml_xpath = '/cancelresponse/cancelresult/id';          \jasperphp::process(             public_path() . '/report/cancelack.jrxml',              $output,              array($ext),             array(),             array('data_file' => $data_file, 'driver' => $driver, 'xml_xpath' =>   $xml_xpath),                                false,             false         )->execute();          header('content-description: file transfer');         header('content-type: application/octet-stream');         header('content-disposition: attachment; filename='.time().'_cancelack.'.$ext);         header('content-transfer-encoding: binary');         header('expires: 0');         header('cache-control: must-revalidate, post-check=0, pre-check=0');         header('content-length: ' . filesize($output.'.'.$ext));         flush();         readfile($output.'.'.$ext);         unlink($output.'.'.$ext);      } 

is there solution export report attachment email (php) ?


Comments

Popular posts from this blog

amazon web services - S3 Pre-signed POST validate file type? -

c# - Check Keyboard Input Winforms -