Loredra L
Loredra L

Reputation: 1553

Jsreport client send request: Error occured - too many parameters

I have client that use jsreport.js. After a AJAX call to get data, I pass data to jsreport request in JSON to send to jsreport server but then this error appears.

$.getJSON(AJAXurl).
 success(function (people) {
 var data=JSON.stringify(people)
 jsreport.serverUrl = 'http://localhost:5488';
 var request = {
 template: { 
           shortid:"rJPUhdmv"},
  data: data};                                   
  jsreport.render('_blank', request);       })

Why does it happen? Do I use the jsreport correctly?

Upvotes: 0

Views: 296

Answers (1)

Jan Blaha
Jan Blaha

Reputation: 3095

You should not stringify the request data attribute, but use the original plain object instead.

$.getJSON(AJAXurl).success(function (people) {
 var data = people 
 jsreport.serverUrl = 'http://localhost:5488';
 var request = {
   template: { 
     shortid:"rJPUhdmv"
   },
   data: data
  };                                   
  jsreport.render('_blank', request);
})

Upvotes: 1

Related Questions