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

114
Vistas
Jsreport how to fill the table with data

im trying to to fill a table with data to export it in pdf using jsreport but i couldnt manage to do it . This is the html file :

<h1>test{{test}}</h1>
<table class='table striped'>
        <thead>
            <tr>
                <th>OrderID</th>
                <th>ShipAddress</th>
                <th>ShipCity</th>
                <th>ShipCountry</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td>{{items.order}}</td>
                <td>{{items.addr}}</td>
                <td>{{items.city}}</td>
                <td>{{items.country}}</td>
            </tr>
        </tbody>
    </table>

And this is the data :

{
"items": [
    {
        "order": "65854",
        "addr": "test 1",
        "city": "2fc2",
        "country": "2fc2"
    },
    {
        "order": "75757",
        "addr": "azerty",
        "city": "2fc2",
        "country": "2fc2"
    },
    {
        "order": "65575784",
        "addr": "tst",
        "city": "2fc2",
        "country": "2fc2"
    }
]
}

I've tried a lot of things but i couldnt manage to do it.

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

0

you must use

<h1>test{{test}}</h1>
<table class='table striped'>
    <thead>
        <tr>
            <th>OrderID</th>
            <th>ShipAddress</th>
            <th>ShipCity</th>
            <th>ShipCountry</th>
        </tr>
    </thead>
    <tbody>
       {{#each items}}
        <tr>
            <td>{{order}}</td>
            <td>{{addr}}</td>
            <td>{{city}}</td>
            <td>{{country}}</td>
        </tr>
       {{/each}}
    </tbody>
</table>

https://jsreport.net/learn/handlebars

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