Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Cleadon
    @hep99_twitter
    I've create the jsreport folder and the jsreport.config.json file with the content and marked it to copy. Killed any old node processes and re-ran - still getting the error
    Cleadon
    @hep99_twitter
    I've ran processmon on the system and the jsreport.config.json is never touched when the build runs. It's in the directory, but no process ever opens it.
    Cleadon
    @hep99_twitter
    When I run the command "npm install jsreport-wkhtmltopdf" from the jsreport folder, should it put the contents in the folder, as it's not, it's putting it in the node_modules folders
    Jan Blaha
    @pofider
    I will push in a moment to github some sample repo so you can check it out
    Cleadon
    @hep99_twitter
    Thanks Jan, appreciate the help
    here it is, the main problem was bug in jsreport.Types nuget, you need to explicitly install the latest
    Cleadon
    @hep99_twitter
    That's worked. Thanks so much. Does the node_modules have to be in the jsreport folder or can it look in the main node_modules at the root of the project?
    gaurav porwal
    @gauravprwl14
    How to handle blob images in jsreport
    Pls help.me it's urgent
    Jan Blaha
    @pofider
    @gauravprwl14 please elaborate more.. your question isn't clear
    Cleadon
    @hep99_twitter
    Hi, Is it possible to use prepend with the middlewarefilter in dotnet core to have a cover page?
    Jan Blaha
    @pofider
    Cleadon
    @hep99_twitter
    Cheers Jan!
    Ry Blaisdell
    @rylincoln
    :wave: hola - i am trying to get the permanent link header from response but having trouble here - reading here
    jsreport.renderAsync({
        template: {
          shortid: reportalObj[i].js_short_id
        },
        data: payload,
        options: {
          reports: {
            save: true,
            blobName: name
          }
        }
      })
        .then(res => {
          res.headers
        })
    results in undefined
    Jan Blaha
    @pofider
    please try this
    res.xhr.getResponseHeader('Permanent-Link')
    Ry Blaisdell
    @rylincoln
    oh man - so close it's there i think but Refused to get unsafe header "Permanent-Link"
    i'll google that
    Ry Blaisdell
    @rylincoln
    access-control-allow-origin: *
    access-control-expose-headers: *
    connection: keep-alive
    content-disposition: inline;filename=Maine Vernal Pool Assessment.pdf
    content-type: application/pdf
    date: Wed, 20 May 2020 20:58:10 GMT
    server: nginx/1.14.0 (Ubuntu)
    transfer-encoding: chunked
    x-powered-by: Express
    x-xss-protection: 0
    this was reply from res.xhs.getAllResponseHeaders();
    don't see the permalink but do see the filename
    oh wait - nevermind
    i'm an idiot - i forgot i switched branches with diff code here
    Ry Blaisdell
    @rylincoln
    Thanks, Jan, it all works as expected now.
    gaurav porwal
    @gauravprwl14

    Hey Everyone, I am using JSreport for production and it is deployed in Heroku with 1x dyno
    But app keep crashing when 11 concurrent requests are made. I am unable to figure out what is the root issue

    I am using the default jsreport.config.json

    {
      "extensions": {
      "httpPort": 5488,
      "httpsPort": null,
      "store": {
        "provider": "fs"
      },
      "blobStorage": {
        "provider": "fs"
      },
      "logger": {
        "console": {
          "transport": "console",
          "level": "debug"
        },
        "file": {
          "transport": "file",
          "level": "info",
          "filename": "logs/reporter.log"
        },
        "error": {
          "transport": "file",
          "level": "error",
          "filename": "logs/error.log"
        }
      },
      "allowLocalFilesAccess": true,
      "templatingEngines": {
        "timeout": 10000,
        "numberOfWorkers": 12,
        "strategy": "http-server",
        "templateCache": {
          "max": 100,
          "enabled": true
        }
      },
      "chrome": {
        "timeout": 40000,
        "strategy": "chrome-pool",
        "numberOfWorkers": 12,
        "launchOptions": {
          "args": [
            "--no-sandbox"
          ]
        }
      }
    }
    can someone help me with the configuration
    BJR Matos
    @bjrmatos

    hi @gauravprwl14

    hmm the configuration file looks wrong, it should be more like this:

    {
      "httpPort": 5488,
      "httpsPort": null,
      "store": {
        "provider": "fs"
      },
      "blobStorage": {
        "provider": "fs"
      },
      "logger": {
        "console": {
          "transport": "console",
          "level": "debug"
        },
        "file": {
          "transport": "file",
          "level": "info",
          "filename": "logs/reporter.log"
        },
        "error": {
          "transport": "file",
          "level": "error",
          "filename": "logs/error.log"
        }
      },
      "allowLocalFilesAccess": true,
      "templatingEngines": {
        "timeout": 10000,
        "numberOfWorkers": 12,
        "strategy": "http-server",
        "templateCache": {
          "max": 100,
          "enabled": true
        }
      },
      "extensions": {
        "chrome": {
          "timeout": 40000,
          "strategy": "chrome-pool",
          "numberOfWorkers": 12,
          "launchOptions": {
            "args": [
              "--no-sandbox"
            ]
          }
        }
      }
    }

    however i don’t know if this is the real file you are using or you just copied it wrong here

    as per the 11 concurrent requests problem hmm i don’t have a good explanation, it will be really weird the jsreport produces this alone, i guess this is a problem with some configuration in Heroku, are there no logs available in the Heroku side?

    or maybe there are also some jsreport logs that you can share when does request are made, if it breaks at jsreport side you should be able to get some logs in logs/error.log
    gaurav porwal
    @gauravprwl14
    May 25 04:01:10 airops-reporting-staging app/web.1 2020-05-25T11:01:10.387Z - debug: Base url not specified, skipping its injection.
    May 25 04:01:10 airops-reporting-staging app/web.1 2020-05-25T11:01:10.403Z - debug: Replaced assets ["Helvetica.otf"]
    May 25 04:01:10 airops-reporting-staging app/web.1 2020-05-25T11:01:10.405Z - debug: Rendering engine handlebars
    May 25 04:01:10 airops-reporting-staging app/web.1 2020-05-25T11:01:10.414Z - debug: Replaced assets ["Helvetica.otf"]
    May 25 04:01:10 airops-reporting-staging app/web.1 2020-05-25T11:01:10.417Z - debug: Rendering engine handlebars
    May 25 04:01:10 airops-reporting-staging app/web.1 2020-05-25T11:01:10.429Z - debug: Replaced assets ["Helvetica.otf"]
    May 25 04:01:10 airops-reporting-staging app/web.1 2020-05-25T11:01:10.430Z - debug: Rendering engine handlebars
    May 25 04:01:10 airops-reporting-staging app/web.1 2020-05-25T11:01:10.565Z - debug: Compiled template not found in the cache, compiling
    May 25 04:01:10 airops-reporting-staging app/web.1 2020-05-25T11:01:10.570Z - debug: Executing recipe chrome-pdf
    May 25 04:01:10 airops-reporting-staging app/web.1 2020-05-25T11:01:10.699Z - debug: Compiled template not found in the cache, compiling
    May 25 04:01:10 airops-reporting-staging app/web.1 2020-05-25T11:01:10.708Z - debug: Compiled template not found in the cache, compiling
    May 25 04:01:10 airops-reporting-staging app/web.1 2020-05-25T11:01:10.711Z - debug: Compiled template not found in the cache, compiling
    May 25 04:01:10 airops-reporting-staging app/web.1 2020-05-25T11:01:10.724Z - debug: Compiled template not found in the cache, compiling
    May 25 04:01:10 airops-reporting-staging app/web.1 2020-05-25T11:01:10.794Z - debug: Compiled template not found in the cache, compiling
    May 25 04:01:10 airops-reporting-staging app/web.1 2020-05-25T11:01:10.796Z - debug: Compiled template not found in the cache, compiling
    May 25 04:01:10 airops-reporting-staging app/web.1 2020-05-25T11:01:10.797Z - debug: Executing recipe chrome-pdf
    May 25 04:01:10 airops-reporting-staging app/web.1 2020-05-25T11:01:10.798Z - debug: Executing recipe chrome-pdf
    May 25 04:01:10 airops-reporting-staging app/web.1 2020-05-25T11:01:10.798Z - debug: Executing recipe chrome-pdf
    May 25 04:01:10 airops-reporting-staging app/web.1 2020-05-25T11:01:10.800Z - debug: Compiled template not found in the cache, compiling
    May 25 04:01:10 airops-reporting-staging app/web.1 2020-05-25T11:01:10.803Z - debug: Executing recipe chrome-pdf
    May 25 04:01:10 airops-reporting-staging app/web.1 2020-05-25T11:01:10.806Z - debug: Executing recipe chrome-pdf
    May 25 04:01:10 airops-reporting-staging app/web.1 2020-05-25T11:01:10.807Z - debug: Executing recipe chrome-pdf
    May 25 04:01:10 airops-reporting-staging app/web.1 2020-05-25T11:01:10.809Z - debug: Executing recipe chrome-pdf
    May 25 04:01:11 airops-reporting-staging app/web.1 2020-05-25T11:01:11.202Z - debug: Converting with chrome HeadlessChrome/79.0.3945.0 using chrome-pool strategy
    May 25 04:01:11 airops-reporting-staging app/web.1 2020-05-25T11:01:11.430Z - debug: Converting with chrome HeadlessChrome/79.0.3945.0 using chrome-pool strategy
    May 25 04:01:11 airops-reporting-staging app/web.1 2020-05-25T11:01:11.486Z - debug: Converting with chrome HeadlessChrome/79.0.3945.0 using chrome-pool strategy
    May 25 04:01:14 airops-reporting-staging app/web.1 #1 0x55e7300d3ee3 base::debug::StackTrace::StackTrace()
    May 25 04:01:14 airops-reporting-staging app/web.1 #3 0x55e73014225f base::SimpleThread::Start()
    May 25 04:01:14 airops-reporting-staging app/web.1 #4 0x55e72e910a72 content::SandboxHostLinux::Init()
    May 25 04:01:14 airops-reporting-staging app/web.1 #8 0x55e72fd5a9dd headless::(anonymous namespace)::RunContentMain()
    May 25 04:01:14 airops-reporting-staging app/web.1 #9 0x55e72fd5a73b headless::HeadlessShellMain()
    May 25 04:01:14 airops-reporting-staging app/web.1 #12 0x55e72da1f0aa _start
    May 25 04:01:14 airops-reporting-staging app/web.1 #0 0x55e73016fe29 base::debug::CollectStackTrace()
    May 25 04:01:14 airops-reporting-staging app/web.1 #1 0x55e7300d3ee3
    Cleadon
    @hep99_twitter
    Hi, I'm trying to use PDFUtils to add a footer using a docker image of jsReports and an azure app that remotely accesses the docker image. I'm using this code.
    HttpContext.JsReportFeature()
    .Recipe(Recipe.ChromePdf)
    .Engine(Engine.Handlebars)
    .Configure((r) => r.Template.Chrome = new Chrome {
    Format = "A4"
    })
    .Configure((r) =>
    {
    r.Template.PdfOperations = new[]
    {
    new PdfOperation()
    {
    Template = new Template
    {
    Content = strHeaderFooterHtml,
    Engine = Engine.None,
    Recipe = Recipe.ChromePdf,
    Chrome = new Chrome {Format = "A4"}
    },
    Type = PdfOperationType.Merge
    },
    new PdfOperation()
    {
    Template = new Template
    {
    Content = strCoverHtml,
    Engine = Engine.None,
    Recipe = Recipe.ChromePdf,
    Chrome = new Chrome {Format = "A4"}
    },
    Type = PdfOperationType.Prepend
    }
    };
                });
    the standard header footer from https://playground.jsreport.net/w/admin/kMI4FBmw
    but I see this rendered on the page.. {{#each $pdf.pages}}{{#if @index}}
    I pass the HTML for header/footer as a string of the actual html
    Jan Blaha
    @pofider
    when you set Engine = Engine.None, then no engine is used tags like {{#each}} will just stay as strings
    you likely want to use Engine.Handlebars for the header merge operation
    Cleadon
    @hep99_twitter
    of course... thanks
    Cleadon
    @hep99_twitter
    I'm getting a strange error. Passing the helpers in as a string from..
    new PdfOperation()
    {
    Template = new Template
    {
    Content = strHeaderFooterHtml,
    Helpers = strHeaderFooterHelper,
    Engine = Engine.Handlebars,
    Recipe = Recipe.ChromePdf,
    Chrome = new Chrome {Format = "A4"}
    },
    Type = PdfOperationType.Merge
    }
    gives An unhandled exception has occurred while executing the request.
    Error while executing pdf-utils operations. Error while executing templating engine. Unexpected token 'return'

    the string is

    function getPageNumber (pageIndex) {
    if (pageIndex == null) {
    return ''
    }

    const pageNumber = pageIndex + 1
    
    return pageNumber

    }

    function getTotalPages (pages) {
    if (!pages) {
    return ''
    }

    return pages.length

    }

    Jan Blaha
    @pofider
    please use here code highlighting, it is otherwise hard to read
    otherwise the string looks good, not sure what is the problem, maybe some wrong escaping
    Cleadon
    @hep99_twitter
    thanks, will make sure all code in highlighted in future
    You were right, now working
    zewar96
    @zewar96
    Is it better to post in here or on the Forums? I already posted my question on the forum (https://forum.jsreport.net/topic/1665/jsreport-types-missing) but i am not sure which is monitored more
    Jan Blaha
    @pofider
    Hi, I answer on forum
    zewar96
    @zewar96
    @pofider Thank you. i will use that and not clog up both with the same question.