KoolReport's Forum

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

Read together views in Codeigniter with report #107

Open tee opened this topic on on Sep 11, 2017 - 6 comments

tee commented on Sep 11, 2017

Hi support team,

Is it possible to allow my controller of Codeigniter to read together input.view.php, header and footer? The purpose is i want my view to have sidebar on the left hand side and right hand side (main page) is to show the view of input.view.php? Appreciate you. Below is my code:

$this->load->view('header');
$this->load->view('footer');
$report = new input(array(
            ));
$report->run()->render();

KoolReport commented on Sep 11, 2017

Consider this code:

$content = $report->run()->render(true);

This will return the content of report in string. You can do whatever you want with that string, for example attach header and footer before render.

tee commented on Sep 11, 2017

Could you show me an example? Thanks.

KoolReport commented on Sep 12, 2017

Another simple way to do is to send $report object to the view of CodeIgniter and render there.

$report = new MyReport();
$report->run():
$this->load->view('view',array("report"=>$report));

At the view.php, you just do:

<div>
<?php $report->render(); ?>
</div>
sunil commented on Apr 12, 2018

How can I use codeIgniter's encryption library to decrypt encrypted name & show it on view, so that koolreport will show correct names instead of encrypted.

KoolReport commented on Apr 12, 2018

The report created from KoolReport can receive parameter, so you can decrypt any string then transmit to koolreport.

$report = new MyReport(array(
    "decryped_name" => decrypt($encrypted_string)
))

Then in the view of myreport, you can get $this->params["decrypted_name"]

More on KoolReport parameters

sunil commented on Apr 12, 2018

I have encrypted name in users table at the time of registration using codeIgniter's [$this->encryption->encrypt('sunil'). I am selecting record using following code. $this->src('automaker')

    ->query("Select user_id, name, email_id from users)
    ->pipe($this->dataStore("users"));

This code giving me encrypted name which present it in db. When I am trying to show data in chart it display me name like [d8d3ed752701f6c0bc558c3aa819e486d217f04c41114fffa9ef70bfbeb155a55191ffeef4da36e] instead of [sunil]. So how can I decrypt name which selected using query by the use of [$this->encryption->decrypt('d8d3ed752701f6c0bc558c3aa819e486d217f04c41114fffa9ef70bfbeb155a55191ffeef4da36e')]. The chart code on view file is as follows

BarChart::create(array("dataSource"=>$this->dataStore("users"),

            "width"=>"80%",
            "height"=>"400px",
            "columns"=>array(
                "name"=>array(
                    'type' => 'string',
                    'label'=>'User Name', 
                ),
                "user_id"=>array(
                    'type' => 'number',
                    'label'=>'Id', 
                ),
            ),
            "clientEvents"=>array(
                "itemSelect"=>"function(params){
                    console.log(params.selectedValue);
                }"
            ),
        ));

Please give me solution.

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