KoolReport's Forum

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

Controlling Multiple Reports in Index.php #975

Open Sowmya opened this topic on on Jul 5, 2019 - 11 comments

Sowmya commented on Jul 5, 2019

Hi KoolReport team,

I am Sowmya, I'm KoolReport Pro User. I implemented KoolReports in CodeIgniter3.

I prepared reports, and run through "function index()" of "CodeIgniter/Controllers/Home" Controller.

class Home extends CI_Controller
{
    public function index()
      {
        include APPPATH."mainiDM\ProfitCenter_Wise_Report.php";
        $report = new ProfitCenter_Wise_Report;
        $report->run()->render();
      } 
} 

How can I Run Multiple reports?????

Please give me the solution. Because I am new to KoolReport and CodeIgniter. I am only CodeIgniter Developer in my organization.

    Please Help me....
Thanks In advance....
KoolReport commented on Jul 5, 2019

You may run a report per action in codeigniter. index() is considered an action. Create another user define action and put your report initiation there. Please refer to CodeIgniter to know how to create a new action. If you work on report export, you can put exporting code in a separate action.

Sowmya commented on Jul 5, 2019

Can you give me one example snippet for that...

    Thank you for your response
Sowmya commented on Jul 5, 2019

Because, If I run my report using UserDefined Method like below, it gives me the table of content. It doesnot display Graph....

class Home extends CI_Controller 
{ 
    public function index()
      {
        $this->load->view('..\mainiDM\Multi_Drop_Down.php');
      } 
      public function ProfitCenter_Wise_Report() 
      {
        include APPPATH."mainiDM\ProfitCenter_Wise_Report.php";
        $report = new ProfitCenter_Wise_Report;
        $report->run()->render('ProfitCenter_Wise_Report.view');
      }

When I run my Report through Index() method directly, It gives me Graph Output..... Below is my code

class Home extends CI_Controller 
{ 
    public function index()
      {

        include APPPATH."mainiDM\ProfitCenter_Wise_Report.php";
        $report = new ProfitCenter_Wise_Report;
        $report->run()->render();

      }

In this scenario, How can I run multiple reports??????????????????

KoolReport commented on Jul 5, 2019

try to make:

      public function profitwise() 
      {
        include APPPATH."mainiDM\ProfitCenter_Wise_Report.php";
        $report = new ProfitCenter_Wise_Report;
        $report->run()->render();
      }

then you called

http://localhost/your-project-path/index.php/home/profitwise
Sowmya commented on Jul 5, 2019

Hi Thanks for your solution, but it wont works....Same Issue. I want to run my report through home page link button as follows...

<ul class="dropdown-menu">
<li><a href="<?php echo site_url('Home\profitwise'); ?>">ProfitCenter Wise Sales</a></li>
KoolReport commented on Jul 5, 2019

In your report, do you use use \koolreport\codeigniter\Friendship;

Sowmya commented on Jul 5, 2019

Ya, I used in "ProfitCenter_Wise_Report.php"

use \koolreport\KoolReport;
use \koolreport\codeigniter\Friendship;
use \koolreport\processes\ColumnMeta;
use \koolreport\processes\Limit;
use \koolreport\processes\RemoveColumn;
use \koolreport\processes\OnlyColumn;
use \koolreport\processes\Sort;
use \koolreport\processes\Group;
use \koolreport\processes\TimeBucket;
use \koolreport\processes\Filter;
use \koolreport\processes\DateTimeFormat;
use \koolreport\processes\CopyColumn;
use \koolreport\cube\processes\Cube;
KoolReport commented on Jul 5, 2019

try to put that line as it look like this in your report

class MyReport extends \koolreport\KoolReport
{
    use \koolreport\codeigniter\Friendship;
    ...
}
Sowmya commented on Jul 5, 2019

Hi I implemented as you guide only... But result is same.......

class ProfitCenter_Wise_Report extends \koolreport\KoolReport
{
	use \koolreport\codeigniter\Friendship;
	
	public function settings()
	{
		return array(
			"assets"=>array(
                "path"=>"../../assets",
                "url"=>"assets",
            ),
            "dataSources"=>array(
                "invoice"=>array(
                    "connectionString"=>"sqlsrv:Server=SQLPC;Database=MainiDM",
                    "username"=>"sa",
                    "password"=>"sa1234",
                    "charset"=>"utf8"
                )
            )
        );
	}
KoolReport commented on Jul 5, 2019

Remove the "assets" in the settings for me, let see if it works

Sowmya commented on Jul 6, 2019

Thanks alot, It is Working.....

            Thank You So much For your Support.....

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