Dar estilo a una cabecera al importar datos a un excel

71 views
Skip to first unread message

Almudena Soblechero Garcia

unread,
Nov 2, 2016, 11:31:34 AM11/2/16
to CodeIgniter-spanish
Hola buenas tardes,  

Estoy creando un excel con la clase xlsxwriter.class.php, y tengo una duda de si se puede dar formato a la cabecera de ese excel, me explico:

el excel se crea de esta forma:

   header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
   header('Content-Disposition: attachment;filename="resumen.xlsx"');
   header('Cache-Control: max-age=0');
   //Creamos el objeto
   $cabecera = array_keys($datos[0]);
   $writer = new XLSXWriter();
   //Pintamos cabecera y datos en la pestaña sedes.
   //-- Si queremos pintar en una nueva pestaña habría que copiar la linea siguiente.-
   $writer->writeSheet($datos,'shhet1', $header);
   $writer->writeToStdOut();

Yendo a la documentación de la clase en el método(función) pintar cabecera writeSheetHeader hay lo siguiente:
$sheet->file_writer->write('<row collapsed="false" customFormat="false" customHeight="false" hidden="false" ht="12.1" outlineLevel="0" r="' . (1) . '" >');

Y la pregunta, es si a esta etiqueta row, podría aplicar un estilo diferente al  customFormat="false" , por ejemplo las letras en negrita y el fondo en gris...


Muchas gracias, 

y perdón si no me he explicado correctamente.

Saludos.

Reply all
Reply to author
Forward
0 new messages