KoolReport's Forum

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

Date formatting in Table Column #649

Open Ahmed Bucheeri opened this topic on on Feb 5, 2019 - 1 comments

Ahmed Bucheeri commented on Feb 5, 2019

i am fetching data from MSSQL using

  DB::table('Snags')
    ->select('Resource.ResourceName')->alias('ResourceName')
    ->addselect('Snags.SnagRef')->alias('SnagRef')
    ->addselect('Snags.OpenDate')->alias('Date')
    ->addselect('Snags.Problem')->alias('Problem')
    ->addselect('SnagPriority.Class')->alias('Category')
    ->addselect('Snags.PilotClearance')->alias('PilotClearance')
    ->addselect('SnagStatus.Status')->alias('Status')
    ->join('SnagStatus', 'Snags.StatusId','=','SnagStatus.Id')
    ->join('SnagPriority', 'Snags.PriorityId ','=','SnagPriority.Id')
    ->join('Resource','Snags.ResourceId','=','Resource.ResourceId')
    ->orderByRaw('Resource.ResourceName ASC')
    ->pipe($this->dataStore('Snags'));

And Viewing it by

    Table::create(array(
      "dataStore"=>$this->dataStore('Snags'),
      "columns"=>array(
        "ResourceName"=>array(
          "label"=>"Resource",
        ),
          "SnagRef"=>array(
            "label"=>"Ref #",
        ),
        "Date"=>array(
          "label"=>"Open Date",
          "type"=>"datetime",
          "format"=>"Y-m-d H:i:s",
          "displayFormat"=>"d-m-Y D"
      )
      ),
      "options"=>array(
        "title"=>"Device Utilization Summary"
      ),
      "cssClass"=>array(
        "table"=>"table table-hover table-striped table-bordered"
      ),
      "removeDuplicate"=>array("ResourceName")
    ));

Format is not working, could you please help

KoolReport commented on Feb 5, 2019

Make sure you have bootstrap in your report:

class MyReport extends \koolreport\KoolReport
{
    use \koolreport\clients\Bootstrap;
}

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