[.Net Core 2] Reporting with a lot of data



  • Hi,

    I would like to know if jsreport can handle a huge set of data and how to avoid long loading time?

    We have to generate reports with hundreds of pages and we want to avoid loading all data in memory, so we need some way to generate the report page per page. We though of using and yield on the IENumerable to fetch the data record by record, will it work with jsreport? If not, is there any other solution?

    Best regards,

    Stéphane



  • Hi,

    templating engine like handlebars and html to pdf converter like phantomjs needs the whole input in one part.
    Neither of them works in stream/chunk way. Both of them needs to load the whole input to the memory.
    This means it is not supported to render data page by page in jsreport, because of the limitation of the underlying libraries.

    In time we should be able to split the work into multiple tasks and merge the final pdf into one using pdf utils extension.
    However we haven't even prototype that yet.

    I would recommend to send to jsreport only the data you really need for the report in the aggregated form.
    I've seen pdf reports with thousands of pages generated through jsreport. So perhaps your data will fit into memory also.

    Jan



  • Hi,

    Thanks for your quick answer. I've made a test with 100.000 records and I received an error : "Unable to render template. request entity too large".

    Is there a limit of size of the data we pass to the Render method?

    Stéphane



  • This is rather a security limit to avoid huge json requests killing the process.
    You can increase the default 20mb limit in .net using:

      new LocalReporting()...
     .Configure(cfg => { 
         ...    
         cfg.Express = new ExpressConfiguration() { InputRequestLimit = "50mb" }
         return cfg;
     })
    

    or in jsreport.config.json

    {
      ...
      "express": { "inputRequestLimit": "50mb" }
    }
    


  • Thank you very much, I missed this config option. Performance of jsreport are really good btw.

    Have a good day,

    Stéphane


Log in to reply
 

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