KoolReport's Forum

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

Subreports, report view in multiple pages & Pivot process #46

Open zenon opened this topic on on Aug 1, 2017 - 6 comments

zenon commented on Aug 1, 2017

Hi,

Can KoolReport support subreports and reports with multiple pages? Eg: 1)Subreports resulted from different queries, but will be displayed in the same report.

  2)Reports with multiple pages resulted from different departments, i.e., each page only shows one department.

If yes, could you please explain how to do it?

And also, is the pivot process included in koolreport folder? Or it is part of the pivot package? I can't find the pivot process file in my koolreport folder.

use \koolreport\processes\Pivot;

Appreciate it.

KoolReport commented on Aug 1, 2017

Hi,

If you think a report is just an separated html page. You can link them together in a bigger report. So when user click on the link of specific report just like click to link of web page, the corresponding report will be loaded.

The Pivot process used to be in the koolreport\processes however we have moved to Pivot package. Sorry for not removing it in documentation.

The Pivot package is $19 which helps you to analyze data in multi-dimension.

zenon commented on Aug 1, 2017

Let's say, user is required to select a date range displayed from <input type="date">, eg: from 1 July 2017 to 31 July 2017. Based on a SQL statement, the report will be generated based on the dates stored in the database, eg: 10 July 2017 and 14 July 2017, in one table.

Is it possible to display the report generated in two different pages, i.e. one page one table for 10 July and the second page second table for 14 July?

I'm afraid that linking web pages could not work because data in the databases varies, whereas links are fixed. Need your advice on this.

Appreciate it. Thanks.

KoolReport commented on Aug 1, 2017

Here are some guide:

  1. Create a report called Main. This report will receive user input and only get the list of available dates. For example when user input 1 July to 31 July, the report will get two dates 10 July and 14 July. Here you can use that date to generate links to detail report. The link will have format "defailreport.php?date=2017-07-10" for example.

  2. Create DetailReport which will received date as parameter.

  3. Create detailreport.php with following code:

$report = DetailReport(array(
    "date"=>$_GET["date"]
));
$report->run()->render();

In the DetailReport.php, you will receive param $this->params["date"], use it to make further request to load data for specific date only.

Overall, your user will go to index.php where the Main report allow users to enter dates and Main report will display available dates within date ranges. The link is available for user to go further to detail report.

zenon commented on Aug 1, 2017

I'm confused. Does this means that the controller is DetailReport.php, report is Main.php and the report view is detailreport.php?

Could you please show me an example for no1?

Sorry, I just started php so this is confusing for me. Hope you can help.

Thanks a lot.

KoolReport commented on Aug 2, 2017

You have following file:

  1. index.php: This init the Main report
  2. Main.php: Contain Main class extends from KoolReport
  3. Main.view.php
  4. defailreport.php: Like the index.php but use to capture the $_GET["date"] to init the DetailReport
  5. DetailReport.php: Contain DetailReport class extends from KoolReport
  6. DetailReport.view.php
mike commented on Aug 30, 2018

is this process submit update form without reloading page

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