KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

Export PDF Is Blank #554

Open lori opened this topic on on Dec 10, 2018 - 2 comments

lori commented on Dec 10, 2018

Hi . l when export to pdf in larave, my file pdf is blank .

// web.php

Route::get('admin/testreport', "TestReportController@index");

// MyPage.php

<?php 
namespace App\Reports; 

class MyPage extends \koolreport\KoolReport {
use \koolreport\laravel\Friendship;
use \koolreport\export\Exportable;
public function settings()
{   }   
protected function setup()
{    } 

}

// MyPage.view.php

<html>
<head>
    <title>Content that you want to convert to PDF</title>
</head>
<body>
    <h1>Export HTML to PDF</h1>
    <p>It is easy to convert HTML to PDF using KoolReport's Export package</p>
</body>

</html>

// MyPageController.php

<?php 
namespace App\Http\Controllers; 

use App\Reports\MyPage;
class MyPageController extends Controller {
public function index()
{
    $report = new MyPage;
    $report->run()->export('MyPage')
        ->settings(array(
            "resourceWaiting"=>5000,
        ))
        ->pdf(array(
            "format"=>"A4",
            "orientation"=>"portrait"
        ))
        ->toBrowser("mypage.pdf",true);
}

}

help me. thanks.

KoolReport commented on Dec 11, 2018

Hi,

If you create a simple index.php to initiate MyPage exporting, ( not related to laravel) does it work? If you try to render the report normally, does it work as well?

lori commented on Dec 11, 2018

Hi yes . in the normal it work as well . l when export to pdf in larave, my file pdf is blank . thanks

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
help needed

Export