KoolReport's Forum

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

CSS Issue #613

Closed idham opened this topic on on Jan 24, 2019 - 10 comments

idham commented on Jan 24, 2019

I use koolreport on Yii2 and try make a simple report, the report appears but not with css style

Here the code :

  • SummaryMaterial.php
<?php
namespace app\controllers;

require(dirname(__FILE__)."../../../vendor/koolphp/koolreport/autoload.php");

//require_once "koolreport/autoload.php";

class SummaryMaterial extends \koolreport\KoolReport
{   
    use \koolreport\clients\Bootstrap;

    function settings()
    {
        return array(

            "assets"=>array(
                "path"=>"../../assets",
                "url"=>"/assets"
            ),

            "dataSources"=>array(
                "data"=>array(
                    "connectionString"=>"mysql:host=localhost;dbname=sicantas2",
                    "username"=>"root",
                    "password"=>"",
                    "charset"=>"utf8"
                )
            )
        );
    }
    function setup()
    {
        $this->src("data")
        ->query("SELECT * FROM melevator")
        ->pipe($this->dataStore("elevator"));
    }    
}
  • SummaryMaterial.view.php
<?php
    use \koolreport\widgets\koolphp\Table;
?>
<html>
    <head>
        <title>MyReport</title></title>
    </head>
    <body>
        <h1>MyReport</h1>
        <h3>List all Elevator</h3>
        <?php
        Table::create(array(
            "dataStore"=>$this->dataStore("elevator"),
            "class"=>array(
                "table"=>"table table-hover"
            )
        ));
        ?>
    </body>
</html>

KoolReport commented on Jan 24, 2019

Could you please open console and see which assets is not loaded.

idham commented on Jan 24, 2019

how to do that sir? can you explain the step please, sorry but i'm newbie with programming thanks

KoolReport commented on Jan 24, 2019

In your browser, press F12 to open the console and inspect tool of browser like Chrome

idham commented on Jan 24, 2019

that one?

KoolReport commented on Jan 24, 2019

Yes, the KoolReport.js should be loaded. Could you please view detail its url

idham commented on Jan 24, 2019

http://localhost/assets/1813048112/KoolReport.js

KoolReport commented on Jan 24, 2019

Now you check if there is that folder "1813048112" containing KoolReport.js inside your "assets"?

idham commented on Jan 24, 2019

idham commented on Jan 24, 2019

oh, i found it, i type the wrong directory, i cange /assets to ../assets, and it solved


"assets"=>array(
                "path"=>"../../assets",
                "url"=>"../assets"
            ),

Thanks for your help

KoolReport commented on Jan 24, 2019

You may change this:

            "assets"=>array(
                "path"=>"../../assets",
                "url"=>"/cantas/assets"
            ),

or better

            "assets"=>array(
                "path"=>"../../assets",
                "url"=>\yii\helpers\Url::base()."/assets"
            ),

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
solved

None