KoolReport's Forum

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

Want to show complex header #2598

Open FIMM opened this topic on on Feb 28, 2022 - 1 comments

FIMM commented on Feb 28, 2022

I am using laravel koolreport My Datatables setting is

  DataTables::create([
            "dataSource"=>$finaloutput,
            "complexHeaders" => true,
            "headerSeparator" => "-",
            "options"=>array(
                "paging"=>true,
                "pageLength" => 10,
                "searching"=>true,
                "colReorder"=>true,
                "order"=>array(
                    array(0,"desc"), //Sort by first column desc
                ),
            ),
            "searchOnEnter" => true,
            "searchMode" => "or",
            "themeBase"=>"bs4",
            "columns"=>array(
                "year_of_complain"=>array(
                    "label"=>"YEAR",
                   // "type"=>"number",
                    "searchable" => true,
                    "type"=>"datetime",
                    "format"=>"Y-m-d H:i:s",
                    "displayFormat"=>"Y"
                ),
                "total"=>array(
                  "label"=>"TOTAL COMPLAINTS",
                  "type"=>"number",
                  //"searchable" => true,
                ),
                "total1"=>array(
                    "label"=>"CLOSED",
                    "type"=>"number",
                    //"searchable" => true,
                ),
                "total2"=>array(
                    "label"=>"ON-GOING",
                    "type"=>"number",
                    //"searchable" => true,
                  )
            ),
            "cssClass"=>array(
                "table"=>"table table-striped table-bordered"
            )
        ]);

I want to show one complex header top of 3 total value. Please help me

Sebastian Morales commented on Mar 2, 2022

Pls change your total column name to "total-0", "total-1", and "total-2" for complex header to work with "headerSeparator" = "-":

https://www.koolreport.com/docs/processes/columnrename/

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