Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

292
Vistas
How to add custom header in ui-grid pdf export using PDFMake?

I am new working with the Angular UI-GRID and I need to create external buttons for the exporting features like PDF export I have read the documentation and found that I can use PDFMake library to create complex header through out the documentation I didn't found any example to resolve my issue.

Please look into the image and help me out. How can I combine both the feature?

var docDefinition = {
            content: [
                {
                    layout: 'lightHorizontalLines', // optional
                    table: {
                        // headers are automatically repeated if the table spans over multiple pages
                        // you can declare how many rows should be treated as headers
                        headerRows: 1,
                        widths: ['*', 'auto', 100, '*'],

                        body: [
                            ['First', 'Second', 'Third', 'The last one'],
                            ['Value 1', 'Value 2', 'Value 3', 'Value 4'],
                            [{ text: 'Bold value', bold: true }, 'Val 2', 'Val 3', 'Val 4']
                        ]
                    }
                }
            ]
        };

     //   #region export data
        
        pdfMake.createPdf(docDefinition).open();
       // #endregion
       
// with this I can export pdf with table
 var grid = $scope.gridApi.grid;
 var rowTypes = uiGridExporterConstants.ALL;
 var colTypes = uiGridExporterConstants.ALL;
 uiGridExporterService.pdfExport(grid, rowTypes, colTypes);
        
 //With this I can export my grid but without header.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

It can be done by using header function and adding table in it:

  header: function() {
    return {
      table: { 
       // Add your table data here       
      
      },
    };
  },
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda