Download report over 2k rows using jsreport.download gives error too many parameters



  •           var data = $scope.dataarinsurancereport;
                jsreport.serverUrl = 'http://localhost:5488';
                jsreport.contentType = 'application/x-www-form-urlencoded';
                var request = {
                   
                    template: {
                       shortid: "B1lfjxbTIN"
                    },
                    data:  {data: $scope.dataarinsurancereport }
                };
                jsreport.download('report.pdf', request);
    

    //for 200 rows its work fine

    //when i use jsreport.renderAsync it gives content or shortid error



  • This is documented. The same applies for download and you can't use it if you want to send big data.
    https://jsreport.net/learn/browser-client

    Note that the render function serializes the input data into form and urlencoded request. This can easily hit the size limits if the input data set is large. In this case consider rather using renderAsync version.

    Not sure what is wrong with your renderAsync call. Can you share code how you use it?



  • Thanks for response

              var data = $scope.dataarinsurancereport;
                jsreport.serverUrl = 'http://localhost:5488';
                jsreport.contentType = 'application/x-www-form-urlencoded';
                var request = {
    
                    template: {
                       shortid: "B1lfjxbTIN"
                    },
                    data:  $scope.dataarinsurancereport 
                };
                jsreport.renderAsync('report.pdf', request);
    

    renderAsync request code



  • This is incomplete. Don't you handle the returned promise from renderAsync?
    Why do you set the jsreport.contentType?

    However, mainly the signature of renderAsync expects a single parameter. The rendering request specification.
    So you need to remove the first report.pdf parameter...

    Check the docs
    https://jsreport.net/learn/browser-client

    Also, the source code can help to debug issues. It is tiny and you can put easily some console.log there.
    https://github.com/jsreport/jsreport-browser-client-dist/blob/master/src/jsreport.js



  • ok thanks for quick reply

                  var data = $scope.dataarinsurancereport;
                jsreport.serverUrl = 'http://localhost:5488';
                jsreport.contentType = 'application/x-www-form-urlencoded';
               
                var request = {
    
                    template: {
                        content: "{#child childtemp}<div style='text-align:center'>{#pageNum}/{#numPages}</div>",
                        recipe: "phantom-pdf",
                        engine: 'none',
                    },
    
    
                };
                jsreport.download('report.pdf', request);
    

    can i use {#child childtemp} to append child template in content and {#pageNum} for page number as well from browser-client?



  • Thank You @jan_blaha

    jsreport.renderAsync working perfect for large data


Log in to reply
 

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