embed jsreport on angular, node js application

  • Hello, I am new with jsreports studio, currently working on a project with angular and node js, i need to be able to fetch records from a database with jsreport designer, then embed it with angular applications , i've tried to follow the jsreport introduction but i cant get it right or the information is not enough.

  • Please elaborate more on the particular part you are having an issue with. What errors do you see? How your code looks like...

  • My problem is , am not sure how to create a template then point it with a script to fetch data from, do you have a working sample , a template with a script that fetches data from postgres that i can refer to

  • Here is an example how to make HTTP call to fetch data.

    In case you want to fetch from postgres, you will want to use a third-party library that is able to connect to the database.
    Like this one

  • Hello jan blaha , this is where am not sure what to do.

    //load some data from the remote API
    const axios = require('axios')
    async function beforeRender(req, res) {
        const r = await axios.get('http://localhost:3000/users')    
        req.data = { ...req.data, ...r.data}
    //send the pdf report by mail
    //send the pdf report by mail
    const nodemailer = require('nodemailer')
    async function afterRender(req, res) { 
        //const smtpTransport = nodemailer.createTransport({...})
        const mail = {
            from: '..>',
            to: '...',
            subject: '...',
            text: '...',       
            attachments: [
                filename: 'Report.pdf',
                content: new Buffer(res.content)
        try {
            await smtpTransport.sendMail(mail)
        } finally {

  • What should i put on the template that will load the data, the sample url ('http://localhost:3000/users') gets data from a table , with the columns , name, email, how do i get the data to be fetched on the script and displayed on the template with js report,

  • Here is a full demo that uses a script to load data from HTTP endpoint and structure the results into an output table.


Log in to reply

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.