Building a csv file with JSReport



  • Hi all,

    I'm trying to build a csv file with JSreport and I would like to know if it's possible to stay on the same line when looping instead of going to the next line. I have an object containing my header fields name so that's the reason why.

    If there is no way of doing it, I'll modify my answer when receving it from the server in my script file but it would be easier doing it on the templating side like I'm doing with my html to Excel file (html table).

    My piece of code for the moment :

    {{#each LstHeader}} 
        {{{Display}}}, 
    {{/each}}
    

    Result :

    Field 1,
    Field 2,
    Field 3,
    ...

    What I want :
    Field1, Field2, Field3, ...

    Thank you



  • I'm in hurry, so for now just quick hint - write your own each helper that will trim white spaces


  • administrators

    hi! handlebars has a syntax designed to handle whitespace, maybe it will help you http://handlebarsjs.com/expressions.html#whitespace-control

    if you still have problems it will be better if you can provide some basic example of your template + data here so we can help you more.



  • It's exactly what I was looking for!

    Thanks a lot for your help



  • Ah, much better. Thanks @bjrmatos


Log in to reply
 

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