Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

115
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!