Code to generate the excel file
$report->run()->exportToExcel('MyExcel')->saveAs($fullPath);
I have created a temporary MyExcel.view.php file just to test it.
use \koolreport\blade\Engine;
protected function bladeInit()
{
$viewsFolder = base_path(<view folder path>);
$cacheFolder = base_path(<cache folder path>);
$blade = new \Jenssegers\Blade\Blade($viewsFolder, $cacheFolder);
return $blade;
}
In the reports class file, I have initialized the blade package of koolreports.
I have tried placing the template file for the excel in the folder where the Reports class file was located as well as in the custom view folder. The most interesting thing I found was that I had to create MyExcel.view.php file in the folder where Reports class file was located and MyExcel.view.php file in the custom view folder as well for it to work, otherwise, it would just give view not found error.
Please provide me some information regarding this and if I am doing something wrong.