KoolReport's Forum

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

Further development, documentation #2

Open Hanns Fiechtner opened this topic on on Apr 26, 2017 - 13 comments

Hanns Fiechtner commented on Apr 26, 2017

Hi all!

Thank you for this good idea! i just started and it worked after eliminating a small issue. Now i wanted to dive deeper and have some questions.

  1. is it possible to change alignment in tables, especially for numbers (right)
  2. how to change decimal point, thousands separator, currency
  3. page breaks in lists, header, footer
  4. change ordering on the fly (by end user)
  5. grouping with intermediate headers

There would be much more - but i understand, that the product is just at the beginning. as an example of features, i would like to turn your attention to http://www.reportico.org

Thank you very much.

KoolReport commented on Apr 26, 2017

Hi Hanns,

Sorry for my late reply. For your questions:

Change the alignment of of table

You can set the cssClass of the table like this:

"cssClass"=>array(
    "td"=>"right-align"
);

And you create a css class:

<style>
.right-align
{
    text-align:right;
}
</style>

Change decimal point of number, set prefix and suffix

In the Table widgets, you will find this settings. Basically you can format any kinds of number and currency

    "columns"=>array(
        "amount"=>array(
            "type"=>"number",
            "decimals"=>2,
            "thousandSeparator"=>",",
            "decimalPoint"=>".",
            "prefix"=>"$",
            "suffix"=>"",
        )
    )

page breaks in lists, header, footer

I think this option is good for exporting PDF or printing only. And for your information, we are working on an package called Exporting which can handle those page header, footer, page break, exporting to PDF, JPG and others.

Change ordering by end-user

This is easy. Basically the KoolReport is allowed to set parameters. And those params can be access in setup() function of the report. So you receive input from user like the ordering desc or asc, you pass to the report, and in the setup() function we order the data accordingly. Please refer to this post: How to insert parameters to KoolReport?.

Grouping with intermediate header

I am not sure if you mean this intermediate header like this: KoolGrid Grouping

If so, we will consider it in future version of \koolreport\widgets\koolphp\Table

Please let me know.

Hanns Fiechtner commented on Apr 26, 2017

Your suggestions worked so far - parameter passsing and alignment. But alignment now is valid for whole table (all td). How to address specific columns? Number formatting in chart works only in popup window, Not in x-axis of chart

KoolReport commented on Apr 26, 2017

Oh, that's a good question actually.

You do this:

"cssClass"=>array(
    "td"=>function($row,$columnName){
        return ($columnName=="amount")?"right-align":"";
    }
)
Peter Williams commented on Apr 27, 2017

Hi Hanns,

I am Peter from KoolPHP Inc.

I have seen reportico right from the beginning of our project. It is good open-source PHP reporting tools. However there are so many improvements can be done there. Frankly, I do not like it. Although it covers the basic needs of a report but the generated report is lack of flexibility in term of report design. Also, charts and graphs there are limited.

Admitted that compare to KoolReport, it has the designer tool however, the tools look basic, fundamental. The looks and feels is bad ( in my opinion).We are planing to have designer tool for KoolReport as well. At that time, people without PHP knowledge can create reporting easily.

For now, we will analyze and learn the good feature from them.

Please do not get me wrong because of my opinion about reportico. They are good free software. Just that I feel we can do much more, providing a way better reporting framework for PHP.

Please let me know your opinion.

KoolReport commented on May 16, 2017

Hi Hanns,

Just to let you know that we have release Export package.

The package allows us to export report to PDF and other formats.

Please have a look and give us your comment.

Regards,

KoolPHP Inc

Hanns Fiechtner commented on May 16, 2017

@Peter Apr 27 Hi Peter, i agree with you completely. It´s not, that i am a big fan of reportico. I just mentioned it, to pull out some potential good ideas - or to avoid some things. Report writing is a demanding task - and up to now, i did not find a really good and easy to handle solution. All the best for KoolReport!!

zenon commented on Jul 29, 2017

Hi KoolPHP Inc,

Referring to your comment above on Apr 26, how to do it with multiple specific columns?

Thanks.

KoolReport commented on Jul 29, 2017

Hi,

In the new version now you can do (for alignment)

Table::create(array(
    "columns"=>array(
        "column1"=>array(
            "align"=>"right",
        ),
        "column2"=>array(
            "align"=>"left",
        ),
        "column3"=>array(
            "align"=>"center",
        ),
    )
))
zenon commented on Jul 29, 2017

Sorry I did not state my purpose clearly. I want to set color for specific multiple columns.

Thanks.

KoolReport commented on Jul 29, 2017

I see, so you just follow the post on Apr 26, there you receive $columnName as function param. Base on the name of column, you return corresponding css class. Please remember to define color for that class name using <style>.

zenon commented on Jul 31, 2017

KoolPHP Inc,

Could you please show me an example for setting color for multiple columns? I tried but was unable to set for multiple columns, only one column.

Thanks.

KoolReport commented on Jul 31, 2017

Example:

"cssClass"=>array(
    "td"=>function($row,$columnName){
        switch($columnName)
        {
            case "column_1":
                return "bg-red"; //Make column 1 red background.
            case "column_2":
                return "bg-green"; //Make column 2 green background;
            default:
                return ""; //Other columns with no css class settings.
        }
    }
)

You have the css class like this:

<style>
    .bg-red
    {
        background-color:red;
    }
    .bg-green
    {
        background-color:green;
    }
</style>
zenon commented on Jul 31, 2017

Thanks for your help, KoolPHP Inc.

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
suggestion

None