Xlsx Recipe: add image fail when using a template



  • Xlsx Recipe: add image fail when using a template
    It works on empty example but if I upload a template I get an error :

    Error while executing templating engine. Cannot read property 'r:id' of undefined. Error on line 270:98.
    
      268 |     var drawingFullName
      269 |     if (this.ctx.root.$xlsxTemplate['xl/worksheets/' + sheetFullName].worksheet.drawing) {
    > 270 |       var rid = this.ctx.root.$xlsxTemplate['xl/worksheets/' + sheetFullName].worksheet.drawing.$['r:id']
          |                                                                                                  ^
      271 |       this.ctx.root.$xlsxTemplate['xl/worksheets/_rels/' + sheetFullName + '.rels'].Relationships.Relationship.forEach(function (r) {
      272 |         if (r.$.Id === rid) {
      273 |           drawingFullName = r.$.Target.replace('../drawings/', '')
    
    
    logs:
    +0      Starting rendering request 987 (user: null)
    +3      Rendering template { name: excel-image, recipe: xlsx, engine: handlebars, preview: true }
    +4      Inline data specified.
    +5      Resources not defined for this template.
    +11     Base url not specified, skipping its injection.
    +11     Rendering engine handlebars
    TypeError: Cannot read property 'r:id' of undefined
    


  • Would you please upload somewhere the xlsx template so we can take a look?



  • it's an empty template I downloaded it from Google Drive, just created an empty google sheet downloaded it then uploaded it as a template, please check this link that I forked from the playground https://playground.jsreport.net/w/anon/nDSs3WAd



  • I fixed it yesterday here https://github.com/jsreport/jsreport-xlsx/issues/34
    It will be part of the next release or you can get it now using

    npm i jsreport/jsreport-xlsx --save
    

    The problem doesn't normally occur when using windows excel and when creating a blank sheet.
    Anyway, it is now fixed.



  • Thank You I will Check this ^_^


Log in to reply
 

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