Rendering report using template name suddenly failing



  • I've been using the api for some time now and all of a sudden rendering has started to fail on me. After investigation I can duplicate the error in postman and the problem, it seems, is the api engine can no longer determine the template by name.

    So:

    {
      "template":   {
             "name": "name_of_template"
      }
      "data": {
         // data here
    }
    

    returns the following error:

    {
        "message": "Error during rendering report: undefined"
    }
    

    If I determine the id of the template and replace with the following:

    {
        "template": {
          "shortId" : "Hy-1MOBkm"
      },
      "data": {
      // etc
      }
    }
    

    The report rendering succeeds. I can duplicate this error on multiple reports.

    Has anything changed to break the option of using the template name?



  • Hi,

    there were no breaking changes regarding this.

    do you use jsreportonline or your on prem installation?

    If the jsreportonline... can you give me your subdomain name?

    If the on prem... Does it happen for all templates? Even for the new one?
    What store do you use? The default one? Which version you use?
    Can you look into logs? Do you use custom user or just non auth or the admin one?
    Do you have a custom script in place?
    In case you can email me zipped application, please do it.



  • This post is deleted!


  • Hi Jan,

    It's jsreportonline I'm using:

    https://agiletea.jsreportonline.net/api/report

    The template name is Quote_Template01

    It happens on a client domain as well for the same name.

    Here''s the error log:

    undefined
    undefined

    +0 Starting rendering request 9249
    +2 Rendering template {shortid:By6_4ox2z, recipe:phantom-pdf,engine:handlebars}
    +3 Inline data specified.
    +7 Executing script HJemlXcctM

    Actually, now I can replicate the error in the playground: Error occured - Error during rendering report: undefined

    When it first happened I went to the playground and tried the template with example data and it all worked fine. I switched the example data over to mimic the test data and that also worked.

    But now neither are working and the error is not helping identify the issue!

    It might not have anything to do with the template name after all.

    Rgds



  • It is likely the script causing the error in which you send the "undefined" error to the jsreport. A moment, taking a look.



  • I can see an Invoice Script added to the playground and this is set on the template. I suspect this is because I started this template from the invoice temaplte already there but I do not use, or want that script .

    How do I remove it from the template?



  • Ah ok. I see.

    You have in template assigned script "Invoice currency". Which was create by us as demo when you first created your account.
    Unfortunately this scripts uses third party API which stopped to work and the script handles it badly and crashes like this.
    We released a hotfix so new accounts don't have this anymore. We didn't expect someone has it attached to production template.
    We will take a look for other accounts.

    The quick solution for you now is to open jsreportonline studio. And deselect the "Invoice currency" script from your templates.
    Use ctrl click in left template scripts menu.

    I apologize for the troubles.



  • 0_1528529670884_upload-9b69b821-ee94-433e-ab87-a9cc04768cd1



  • Perfect - I'll also remove it from my assets so it doesn't creep in to anything else.
    Thank you for that - your response and support is the best I've encountered and very reassuring :)

    Have a great weekend!



  • Great. Happy to help.
    Nice weekend for you too.


Log in to reply
 

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