Quantcast
Channel: Active questions tagged row - Stack Overflow
Viewing all articles
Browse latest Browse all 447

Laravel Multiple sheets with multiple heading rows

$
0
0

I already achieved the code for two rows but data is not aligning with the rows. I tried several methods to map the data but still the data is showing after the headings

enter image description here

enter image description here

This is what i want to achieved so far, this is the headings and the map

` public function headings():array{return[['Entity Name','Fund Cluster'],

       ['Date','Reference','Item Desc',       ],    ]; }`

`public function map($row):array{

    $firstRowData = ['entity_name' => $row['entity_name'],   // Data for "Entity Name"'fund_cluster' => $row['fund_cluster'], // Data for "Fund Cluster"'date' => '',                            // Placeholder for the third column (empty in the first row)    ];    // Second row of headings    $secondRowData = ['entity_name' => '',         'fund_cluster' => '',        'date' => $row['date'],    'reference' => $row['reference'],   'item_desc' => $row['item_desc'],      ];    $mappedData = array_merge($firstRowData, $secondRowData);    return $mappedData; }`

Viewing all articles
Browse latest Browse all 447

Trending Articles