I am trying to create a report that operates via two different URLs in order to embed a report within a separate application.
URL 1 (Working): https://reports.testdomain.com/finance/profit_and_loss/index.php URL 2 (Not Working): https://testdomain.com/reports/finance/profit_and_loss/index.php
Absolute path on disk: /data/websites/reporting_system/live/finance/profit_and_loss/
A symbolic link residing in: /data/websites/another_system/live/reports which points to: /data/websites/reporting_system/live/
The goal is to have all of the reports for every system located in the same place (reporting server). I would like to have the symbolic links enable connection to all of the reports vis their respective URLs.
Response of the getcwd() function within the MyReport.php file: data/websites/another_system/live
From within the koolreport/core/src/core/ResourceManager.php file (line 134), dumping of the $assets array produces the following:
array(2) {
["path"]=> string(44) "/data/websites/another_system/live/koolreport_assets"
["url"]=> string(44) "/data/websites/another_system/live/koolreport_assets"
}
I can live with the files residing in the /data/websites/another_system/live/koolreport_assets folder, however that is not optimal. I would prefer the assets folder reside as a subfolder of the actual report (ie: /data/websites/another_system/live/finance/profit_and_loss/koolreport_assets) rather then at the top level. Getting the report to work is more important at this time.
When the report attempts to run, the following errors appear via the page Inspector within Firefox: GET https://testdomain.com/data/websites/another_system/live/koolreport_assets/3409401219/KoolReport.js Uncaught SyntaxError: missing ) after argument list
That path will never work. It should be at least https://testdomain.com/koolreport_assets/3409401219/KoolReport.js
index.php
<?php
require_once "../../koolreport/core/autoload.php"; require_once "MyReport.php";
$report = new MyReport; $report->run()->render();
MyReport.php
<?php
echo getcwd(); class MyReport extends \koolreport\KoolReport {
}
MyReport.view.php
<?php
use \koolreport\widgets\google\BarChart;
$category_amount = array(
array("category"=>"Books","sale"=>32000,"cost"=>20000,"profit"=>12000),
array("category"=>"Accessories","sale"=>43000,"cost"=>36000,"profit"=>7000),
array("category"=>"Phones","sale"=>54000,"cost"=>39000,"profit"=>15000),
array("category"=>"Movies","sale"=>23000,"cost"=>18000,"profit"=>5000),
array("category"=>"Others","sale"=>12000,"cost"=>6000,"profit"=>6000),
);
$category_sale_month = array(
array("category"=>"Books","January"=>32000,"February"=>20000,"March"=>12000),
array("category"=>"Accessories","January"=>43000,"February"=>36000,"March"=>7000),
array("category"=>"Phones","January"=>54000,"February"=>39000,"March"=>15000),
array("category"=>"Others","January"=>12000,"February"=>6000,"March"=>6000),
);
?> <div class="report-content">
<div style="margin-bottom:50px;">
<?php
BarChart::create(array(
"title"=>"Sale Report",
"dataSource"=>$category_amount,
"columns"=>array(
"category",
"sale"=>array("label"=>"Sale","type"=>"number","prefix"=>"$"),
"cost"=>array("label"=>"Cost","type"=>"number","prefix"=>"$"),
"profit"=>array("label"=>"Profit","type"=>"number","prefix"=>"$"),
)
));
?>
</div>
<div style="margin-bottom:50px;">
<?php
BarChart::create(array(
"title"=>"Sale Report on Stack",
"dataSource"=>$category_sale_month,
"columns"=>array(
"category",
"January"=>array("label"=>"January","type"=>"number","prefix"=>"$"),
"February"=>array("label"=>"February","type"=>"number","prefix"=>"$"),
"March"=>array("label"=>"March","type"=>"number","prefix"=>"$"),
),
"options"=>array(
"isStacked"=>true
)
));
?>
</div>
</div>
Any assistance with correctig the pathing would be greatly helpful.