KoolReport's Forum

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

Troubles with the start #1101

Closed Stephane opened this topic on on Sep 26, 2019 - 7 comments

Stephane commented on Sep 26, 2019

Hi there,

So i've found your project while searching for a BI solution for ours and i'm quite interested, so i've managed to give it a try, get it on our test server (i'm working without framework) downloaded the package and started following your quickstart guide (after reading some documentation) but i deal with an error occured by RessourceManager.

I have this kind of folder architecture : http://xxxx.xxx.xx/~PhPtests/Reporting/ and i've put the package there, then created the 3 files + csv on Reporting folders.

So basically i have http://xxxx.xxx.xx/~PhPtests/Reporting/index.php & SalesByCustomer.php and SalesByCustomer.view.php and then http://xxxx.xxx.xx/~PhPtests/Reporting/koolreport/

When i load the index.php i've got 404 not found for Koolreport.js because it's trying to go to http://xxx/home/PhPTests/public_html/Reporting/koolreport_assets/1946006000/KoolReport.js (and offcourse KoolReport is not defined since the js is not linked)

i've checked on your Core/ResourceManager.php and you call the repertory by the $_SERVER["[SCRIPT_FILENAME]"] but in my case it won't work this way since your script will try to go to http://xxx/home/PhPTests/public_html/Reporting/koolreport_assets/1946006000/KoolReport.js and it's not the real address

Is there anything to do? will i find this kind of troubles on another Core section of your scripts?

Can i bypass it in any ways?

Thanks

Stephane commented on Sep 26, 2019

I've managed to get it "kinda" working with including myself all the dependence in js and css in the header, but it's not really convenient.

KoolReport commented on Sep 26, 2019

A solution is that you can try is to move "koolreport" folder to public which can be accessed via browser. By this way, KoolReport will not need to publish its resources rather it use the resources directly. Please let me know if it works.

Stephane commented on Sep 26, 2019

Tried, i've put the koolreport directory to public_html but doesn't seem to do anything, i don't have anymore errors now but instead a white page

Stephane commented on Sep 26, 2019

I've managed to "force" the url by pushing $targetAssetUrl = "koolreport_assets"; on line 167 in RessourceManager.php, no more errors and the links to js etc.. seems ok, i'm just facing another error now with a left hand assignement throwed by js, i'll check on it later seems he pushed some weird assetUrl=koolreport_assets/2548464955<br> on it

KoolReport.widget.init(assetUrl=koolreport_assets/2548464955<br>assetUrl=koolreport_assets/2474023734<br>{"js":["koolreport_assets\/2474023734\/jquery.min.js",["koolreport_assets\/2548464955\/googlechart.js"]],"css":[]},function(){

    gchart5d8cd1bed16491 = new KoolReport.google.chart("BarChart","gchart5d8cd1bed16491",["customerName","dollar_sales"],[["Customer","Amount",{"role":"emphasis"}],["Euro+ Shopping Channel",{"v":820689.54,"f":"$820,690"},true],["Mini Gifts Distributors Ltd.",{"v":591827.34,"f":"$591,827"},true],["Australian Collectors, Co.",{"v":180585.07,"f":"$180,585"},true],["Muscle Machine Inc",{"v":177913.95,"f":"$177,914"},true],["La Rochelle Gifts",{"v":158573.12,"f":"$158,573"},true],["Dragon Souveniers, Ltd.",{"v":156251.03,"f":"$156,251"},true],["Down Under Souveniers, Inc",{"v":154622.08,"f":"$154,622"},true],["Land of Toys Inc.",{"v":149085.15,"f":"$149,085"},true],["AV Stores, Co.",{"v":148410.09,"f":"$148,410"},true],["The Sharp Gifts Warehouse",{"v":143536.27,"f":"$143,536"},true]],{"title":"Sales By Customer"},{"package":"corechart","stability":"current","mapsApiKey":""});

and

KoolReport.widget.init(assetUrl=koolreport_assets/1584210495<br>assetUrl=koolreport_assets/2474023734<br>{"js":["koolreport_assets\/2474023734\/jquery.min.js",["koolreport_assets\/1584210495\/table.js"]],"css":["koolreport_assets\/1584210495\/table.css"]},function(){

ktable5d8cd1bed1e902 = new KoolReport.koolphp.table('ktable5d8cd1bed1e902',{"cKeys":["customerName","dollar_sales"],"removeDuplicate":[],"paging":null});
    });
KoolReport commented on Sep 26, 2019

Another solution is you try to set the "assets" settings, please look at this topic. Let me know if it works.

Stephane commented on Sep 30, 2019

Got it working with :

"assets"=>array(
                "path"=>"koolreport_assets",
                "url"=>"koolreport_assets"
            ),

Thanks !

KoolReport commented on Sep 30, 2019

That's great!

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

None