php - How to change all cell's height and width in laravel excel -


i want apply height , width row's in laravel excel

i able change height , width single row @ time using following code

 $sheet->setsize('a1', 25, 18);  $sheet->setsize('b1', 25, 18);  $sheet->setsize('c1', 25, 18);  $sheet->setsize('d1', 25, 18);  $sheet->setsize('e1', 25, 18);  $sheet->setsize('f1', 25, 18); 

now question have thousands of rows how can manage ?

i have following code

 \excel::create('users report'.$time, function ($excel) use ($arrusers) {               $excel->sheet('users', function ($sheet) use ($arrusers) {                  // set margins                 $sheet->fromarray($arrusers, null, 'a1', true);                  $sheet->setsize('a1', 25, 18);                 $sheet->setsize('b1', 25, 18);                 $sheet->setsize('c1', 25, 18);                 $sheet->setsize('d1', 25, 18);                 $sheet->setsize('e1', 25, 18);                 $sheet->setsize('f1', 25, 18);                  $sheet->row(1, array(                     'name', 'username', 'contact', 'email', 'verified', 'inactivity'                 ));                  // freeze first row                 $sheet->freezefirstrow();                  $sheet->cell('a1:f1', function($cell) {                      // set font                     $cell->setfont(array(                         'family'     => 'calibri',                         'size'       => '12',                         'bold'       =>  true                     ));                  });              });         })->store('xls')->download('xls'); 

please me out stuck.

thanks.

solve using following code

 \excel::create('users report'.$time, function ($excel) use ($arrusers) {               $excel->sheet('users', function ($sheet) use ($arrusers) {                  // set margins                 $sheet->fromarray($arrusers, null, 'a1', true);                  for( $intrownumber = 1; $intrownumber <= count($arrusers) + 1; $intrownumber++){                     $sheet->setsize('a' . $intrownumber, 25, 18);                     $sheet->setsize('b' . $intrownumber, 25, 18);                     $sheet->setsize('c' . $intrownumber, 25, 18);                     $sheet->setsize('d' . $intrownumber, 25, 18);                     $sheet->setsize('e' . $intrownumber, 25, 18);                     $sheet->setsize('f' . $intrownumber, 25, 18);                 }                  $sheet->row(1, array(                     'name', 'username', 'contact', 'email', 'verified', 'inactivity'                 ));                  // freeze first row                 $sheet->freezefirstrow();                  $sheet->cell('a1:f1', function($cell) {                      // set font                     $cell->setfont(array(                         'family'     => 'calibri',                         'size'       => '12',                         'bold'       =>  true                     ));                  });              });         })->store('xls')->download('xls'); 

Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -