pdfCreatePagesGroup working with jsrender on Windows (2.7.1) but not on Linux (2.7.2)



  • Hi,
    We switched to the jsrender engine for our report templates recently and we are not able to use the pdfCreatePagesGroup method on our development server running jsreport 2.7.2 on Linux. This works as expected on my local machine running jsreport 2.7.1 on Windows.

    With the following syntax :

    {{pdfCreatePagesGroup name='test' /}}
    

    We get this error :

    2020-04-20T16:02:58.166Z - warn: Error when processing render request 6 Error while executing templating engine. Unknown tag: {{pdfCreatePagesGroup}}  Error
        at /srv/absocore.jsreport.app/node_modules/jsrender/jsrender-node.js:223:27
        at Object.<anonymous> (/srv/absocore.jsreport.app/node_modules/jsrender/jsrender-node.js:2879:2)
        at Module._compile (module.js:652:30)
        at Object.Module._extensions..js (module.js:663:10)
        at Module.load (module.js:565:32)
        at tryModuleLoad (module.js:505:12)
        at Function.Module._load (module.js:497:3)
        at Module.require (module.js:596:17)
        at require (internal/module.js:11:18)
        at Object.<anonymous> (/srv/absocore.jsreport.app/node_modules/jsreport-jsrender/lib/jsrenderEngine.js:6:16)
    

    We also tried with the following syntax :

    {{:~pdfCreatePagesGroup('test')}}
    

    And we get this error :

    2020-04-20T18:38:27.444Z - warn: Error when processing render request 5 Error while executing templating engine. view.ctxPrm(...) is not a function TypeError: view.ctxPrm(...) is not a function
        at Object.eval [as fn] (eval at buildCode (/srv/absocore.jsreport.app/node_modules/jsrender/jsrender-node.js:2480:10), <anonymous>:13:40)
        at renderWithViews (/srv/absocore.jsreport.app/node_modules/jsrender/jsrender-node.js:1777:22)
        at Object.renderContent [as render] (/srv/absocore.jsreport.app/node_modules/jsrender/jsrender-node.js:1644:13)
        at Tag.render (/srv/absocore.jsreport.app/node_modules/jsrender/jsrender-node.js:2788:24)
        at renderTag (/srv/absocore.jsreport.app/node_modules/jsrender/jsrender-node.js:869:26)
        at Object.eval [as fn] (eval at buildCode (/srv/absocore.jsreport.app/node_modules/jsrender/jsrender-node.js:2480:10), <anonymous>:6:2)
        at renderWithViews (/srv/absocore.jsreport.app/node_modules/jsrender/jsrender-node.js:1791:18)
        at Object.renderContent [as render] (/srv/absocore.jsreport.app/node_modules/jsrender/jsrender-node.js:1644:13)
        at renderTag (/srv/absocore.jsreport.app/node_modules/jsrender/jsrender-node.js:892:22)
        at Function.eval [as fn] (eval at buildCode (/srv/absocore.jsreport.app/node_modules/jsrender/jsrender-node.js:2480:10), <anonymous>:6:2)
    

    Again, both those syntaxes work on Windows running jsreport 2.7.1.

    If this can help, our template is included in another template using the "{#child ...}" syntax and its recipe is "html". The parent template recipe is "chrome-pdf" with "jsrender" engine.

    We tried to use the "liberation" font for the group as described in this post but it does not help.

    Is there a problem with jsreport 2.7.2 or are we missing something?

    Thanks



  • Would you try to replicate the issue in playground? Or send me a minimal export?

    I tried what you described on local (2.7.2 win) and it works. In playground (2.7.1 Linux) it works as well
    https://playground.jsreport.net/w/anon/WdKmyDbd



  • I am not able to replicate the issue in playground and it is hard for me to make a minimal export since the template uses custom javascript files and complex data.

    I made a couple more tests on my development environment and the problem seems to be related to the child template. When I replace the "{child ...}" tag with the child template content, the groups are working. I simplified the child template as much as possible and the problem is still there.

    Is there any required configurations for this to work with a child template?



  • What if you export/import my linked example to your environment, does it work there?

    The child templates usage was fixed in jsreport-pdf-utils@1.6.1 extension. Its part of the jsreport@2.7.2 but please check if you really have the right version inside node_modules.



  • Thanks for the quick replies!

    I got the same error after importing your example in my environment (view.ctxPrm(...) is not a function).

    The package.json file in my "node_modules/jsreport-pdf-utils" folder says I have jsreport-pdf-utils@1.6.1


Log in to reply
 

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