KoolReport's Forum

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

Facing some issues in excel export #2897

Open Giri Rajan opened this topic on on Dec 7, 2022 - 5 comments

Giri Rajan commented on Dec 7, 2022

Hi Kool Report Team, We require assistance in exporting the report to Excel.

1. We require the table column grouping option to group the header. 
2. Excel export requires the CSS style option. (Like background colour, font style, etc.) 
3. We require report headers in Excel, same as in PDF.

If this option already exists, please kindly assist us.

Sebastian Morales commented on Dec 8, 2022

Yes, all 3 of your requirements are avaiable in our Excel package or KoolReport Pro.

1 . For table grouping:

https://www.koolreport.com/examples/reports/excel/table_rowgroup/ (look for row group setting in file MyReportExcel.view.php at the end of page)

Excel Table row group documentation

2 . For style, you can define it with array similarly to CSS but not exactly the same:

https://www.koolreport.com/examples/reports/excel/table/ (look for style array in file MyReportExcel.view.php at the end of page)

Excel Table style documentation

Style array example values

3 . For report header, you can set it in Excel template:

https://www.koolreport.com/examples/reports/excel/excel_template/

Excel template documentation

Let us know if you have any detail question. Rgds,

Giri Rajan commented on Dec 14, 2022

Hi Kool Report Team, Thanks for the reply. We need to export Excel like this,

We are currently exporting an Excel report using Kool report like this:

Sebastian Morales commented on Dec 14, 2022

I assume that you don't want the empty group column, which is the one grouped by. If that's the case pls use "columnTops" instead of "top" in excel Table's rowGroup setting. For example:

        \koolreport\excel\Table::create(array(
            "dataSource" => $this->dataStore('sales'),
            "columns" => [
                // "customerName", // hide customerName column if you want
                "productLine",
                "dollar_sales" => [...]
            ],
            "rowGroup" => [
                "customerName" => [ // grouped by customerName
                    ...
                    // "top" => "Top: Customers: {customerName}", // comment out "top" i.e hide the empty group column
                    "columnTops" => [
                        "productLine" => "Top: Customers: {customerName}", // show customerName group in column productLine 
                        "dollar_sales" => "{totalSales}"
                    ]
                ], 

If you need something else let us know. Rgds,

Giri Rajan commented on Dec 14, 2022

We need row grouping with colSpan like this

Sebastian Morales commented on Dec 19, 2022

It's a pity it's not possible to merge cells of the group row in Excel table export yet. We will investigate options to design and implement this feature in the future. Rgds,

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
None yet

None