KoolReport's Forum

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

Duplicate tables #1207

Open Ed Martin opened this topic on on Dec 5, 2019 - 2 comments

Ed Martin commented on Dec 5, 2019

I am finding the rendering of tables is showing two tables on my page, one formatted and the other not.

I used the code from the example on the website:

MyReport.php - <?php //MyReport.php require_once APPPATH."../vendor/autoload.php";

use \koolreport\codeigniter\Friendship;// All you need to do is to claim this friendship

class MyReport extends \koolreport\KoolReport {

function settings()
{
    return array(
        "dataSources"=>array(
            "automaker"=>array(
                "connectionString"=>"mysql:host=localhost;dbname=automaker",
                "username"=>"root",
                "password"=>"",
                "charset"=>"utf8"
            ),
        )
    ); 
} 
protected function setup()
{
    $this->src('automaker')
    ->query("SELECT employeeNumber, firstName,lastName,jobTitle, extension from employees")
    ->pipe($this->dataStore("employees"));
} 

}

MyReport.view.php

<?php

require_once APPPATH."../vendor/autoload.php";

use \koolreport\datagrid\DataTables;

?> <div class="report-content">

<div class="text-center">
    <h1>DataTables</h1>
    <p class="lead">
    The minimum settings to get DataTables working
    </p>
</div>

<?php
DataTables::create(array(
    "dataSource"=>$this->dataStore("employees"),
    "themeBase"=>"bs4", // Optional option to work with Bootsrap 4
    "cssClass"=>array(
        "table"=>"table table-striped table-bordered"
    )
));
?>

</div>

Ed Martin commented on Dec 5, 2019

I figured out that I had two render commands in my controller. I was trying to create multiple views, but wound up rendering on a single page.

Where would I be able to learn how to structure my charts and reports in my folders? Do I need to pair a controller and view every time I want a chart/report?

Also I would like to learn more about cards and how to integrate them in a dashboard.

KoolReport commented on Dec 6, 2019

Please consider a report is just an object which you can create and generate anywhere. There is no rule how report's folder should be. The best is the one that make sense to you. The card can be used inside a report view or it can be used in even a view of codeigniter. Follow our example, if you have any difficulty, just drop us a line here.

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

DataGrid