KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.

Controlling Multiple Reports in Index.php #975

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

Sowmya commented on Jul 5

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

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

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

    Thank you for your response
Sowmya commented on Jul 5

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

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

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

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

Sowmya commented on Jul 5

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

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

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

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

Sowmya commented on Jul 6

Thanks alot, It is Working.....

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

KoolReport Is Free and Open-Source!

KoolReport is a professional php reporting framework which saves you tons of time to construct dynamic data report & dashboard.

  • Connect to various datasources such as MySQL, SQL Server, MongoDB or even from CSV or Excel file.
  • Contain series of powerful built-in data processes for your data manipulation.
  • Generate stunning charts and graphs to help you communicate data insights to your audiences effectively.
  • Integrate seamlessly with any php frameworks such as Laravel, CodeIgniter, Symfony.
Download Now and register our tutorials to get started!

Download KoolReport
solved

None