KoolReport's Forum

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

KoolReport Pro vs KoolReport configuration #1217

Open Ed Martin opened this topic on on Dec 14, 2019 - 9 comments

Ed Martin commented on Dec 14, 2019

I am a bit confused by the layout of KoolReport Pro. I was able to get reports done in KoolReports, but I am not having much luck getting the Pro version to work. I have tried it both with and without Codeigniter (I have current projects without, but am testing CI). How should the directory structure look if I add the files from KoolReport 4.3 to a project in xampp:

/xampp
-htdocs/
----- acme/
----- index.php
----- main.php
----- second.php

at which level should I place the Koolreport folder, reports and examples?

KoolReport commented on Dec 14, 2019

May I know if you install KoolReport Pro with composer or you download manually from our license page?

Ed Martin commented on Dec 14, 2019

I have actually done it both ways. I used composer and got the auth file to place koolreport in a local project under htdocs. And originally I downloaded the files from the welcome email I received.

Most of my current production projects are hosted on a third-party site and written primarily in PHP/js with a MySQL backend. I am currently using google charts in one of the projects and would like to upgrade the visuals for my client.

I also have a new client who will be looking for some of the great reporting features Koolreport provides like cube and report filters. I am leaning towards building their project in CodeIgniter as I am starting from scratch. I am, for the most part, self-taught and just need a bit of a jump start to integrate your product into my workflow.

KoolReport commented on Dec 14, 2019

Actually you can put KoolReport at anywhere, even outside of htdocs, KoolReport will work as long as you got reference correctly. However to make things simple, you can put it inside your project folder. Let say your project folder is acme then you put koolreport folder inside acme.

Ed Martin commented on Dec 14, 2019

OK, and when you say reference, which folder/file am I referencing when I want to call a report. It appears in the tutorial that all the files (e.g. index.php, MyReport.php and MyReport.view.php) are to be in the same folder. If I have multiple reports/charts will they each need a separate folder or do they share the index.php file?

KoolReport commented on Dec 14, 2019

Make a folder called "reports" to hold all reports:

/reports
-SaleReport.php
-SaleReport.view.php
-MaketingReport.php
-MarketingReport.view.php

And then in anywhere, for example, inside an action of CI Controller, you want to render report. You just need to reference at top of controller file.

require_once "/path/to/reports/SaleReport.php";

and inside the action you can do:

function index()
{
    $saleReport = new SaleReport;
    $saleReport->run()->render();
}

Hope that helps.

Ed Martin commented on Dec 14, 2019

Awesome, thanks very much

Ed Martin commented on Dec 14, 2019

Another question. It appears the packages included with the Pro version are currently in the reports folder as well. Should they be moved out if I plan to use some of them or just treat them as a subfolder (e.g. reports/amazing-theme/simplecard)?

also which config.php file is the one referenced in:

use \koolreport\amazing\Theme;

public function settings()
{
    $config = include "../../../config.php";    

    return array(
        "dataSources"=>array(
            "automaker"=>$config["automaker"]
        )
KoolReport commented on Dec 15, 2019

The packages should not be put into "reports" folder where you store your report, it should be inside the "koolreport" folder. If you download the KoolReport Pro, you just need to copy the whole "koolreport" folder (next to examples folder) to your project. And that's all.

Ed Martin commented on Dec 15, 2019

Thanks for your help! I think the packages came from the examples folder when I copied the files. I went back to the config you suggested and I was able to generate tables and charts from my database.

I think I am getting closer to understanding how this works. But I still have one area of confusion. I created the reports folder and placed the three files (index.php, MyReport.php, and MyReport.view.php. The report and table rendered when I enter http://localhost/acme/reports in my browser. Now if I want to create MyReport2 using another table in my database, how should I configure the files in the reports folder?

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