KoolReport's Forum

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

How can i make rowspan and colspan on my table ? #771

Closed vudoc opened this topic on on Apr 1, 2019 - 2 comments

vudoc commented on Apr 1, 2019

My table view right now,

I would like to make like this,

My controller,

public function koolsearch(Request $request)
{     
 $report = new MyReport(array(
        "min" => $request->min,
        "agen" => $request->agen,
        "sec" => $request->sec,
        "sub_sec" => $request->sub_sec,
    ));       
     $report->run();
     return view("Koolreport.report",["report"=>$report]);
}

MyReport.php, function setup()

{
 $min = $this->params["min"];
 $agen = $this->params["agen"];
 $sec = $this->params["sec"];
 $sub_sec = $this->params["sub_sec"];
 
 $this->src("mysql")->query(MySQL::type(
        DB::table("demands")->join('approved_project_info', 'approved_project_info.unapprove_project_id', '=', 'demands.project_id')
       ->where('ministry', $min)     
        ))
    ->pipe($this->dataStore('demands'));
   
}

MyReport.view.php,

 <?php
 Table::create(array(
"dataSource"=>$this->dataStore("demands"),
"columns" => array(
            "project_code" => array(
                "label" => "Project Code",
                  "cssStyle"=>"border-right:none;"
            ),
            "project_title" => array(
                "label" => "Project Nmae (Implementation Period)",
            ),
            "project_cost_total" => array(
                "label" => "Total",
            ),
            "project_aid" => array(
                "label" => "PA",
            ),
            //6 row start
            //6 row end  
            "allocation_total" => array(
                "label" => "Allocation Total",
            ),
            "allocation_taka" => array(
                "label" => "Taka",
            ),
            "capital" => array(
                "label" => "Capital ",
            ),
            "capital_revenue" => array(
                "label" => "Revenue",
            ),
            "cdvat" => array(
                "label" => "CDVAT",
            ),
            "cdvat_pa" => array(
                "label" => "Project Aid",
            ),
            "allocation_others" => array(
                "label" => "Others",
            ),
        ),
    "cssClass"=>array(
    "table"=>"table table-bordered",
    "tr"=>"row-css-class",
    "th"=>"header-css-class",
    "td"=>"cell-css-class",
    "tf"=>"footer-cell-css-class",
)

))

    ?>

My Report.blade.php,

<tbody> <?php echo $report->render(); ?>
</tbody>

KoolReport commented on Apr 2, 2019

You may have a look at this example:

https://www.koolreport.com/examples/reports/koolphp_table/header/

Athough it may not be exactly what you want but it is closed.

vudoc commented on Apr 2, 2019

Thank You it working

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
solved

Laravel