Jump to content

JSON equivalent to XML for POST reportExecutions REST SERVICE?


tonyy

Recommended Posts

<reportExecutionRequest> <reportUnitUri>/supermart/details/CustomerDetailReport</reportUnitUri> <async>true</async>
<freshData>false</freshData> <saveDataSnapshot>false</saveDataSnapshot> <outputFormat>html</outputFormat>
<interactive>true</interactive> <ignorePagination>false</ignorePagination>
<pages>1-5</pages>
<parameters>

<reportParameter name="someParameterName"> <value>value 1</value>
<value>value 2</value>

</reportParameter>
<reportParameter name="someAnotherParameterName">

<value>another value</value> </reportParameter>

</parameters> </reportExecutionRequest> 

 

This is XML listed in documentation, what is the equivalent for this in JSON? Online converters did not help , the requests with their resulting json could not be serialized on JasperServers. Particular complaint is about parameters.

How nice to introduce XML example and omit JSON - Well Done Jasper Team! And thanks for not answering our questions you are so helpful.

 

 

Link to comment
Share on other sites

  • 2 months later...
  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

Hi Tony,

Did you ever manage to get the JSON report execution requests working properly? I am having a very similar issue where no matter what parameters I send to the server, they never get passed to the report.

And man is it frustrating that all the jasper examples are in xml and not json. Come on.

Cheers

Link to comment
Share on other sites

  • 4 weeks later...

Hi, I've just succesfully get JSON reportExecutionRequest structure send.

You are rigth - there are no good examples for JSON - but it is possible to decompile jar files and see class definitions used by server.... 

 

{"reportUnitUri":"/reports/fait/pracownicy","async":true,"freshData":true,"saveDataSnapshot":false,"outputFormat":"pdf","interactive":false,"ignorePagination":true,"pages":null,"parameters":{"reportParameter":[{"name":"Parameter1","value":["a"]}]}}        
 
C# wrapper class of it:
 
    public class ReportParameter
    {
        public String name { get; set; }
        public List<String> value { get; set; }
 
    }
 
    public class ReportParameters
    {
        public List<ReportParameter> reportParameter { get; set; }
    }
 
    public class reportExecutionRequest
    {
        public string reportUnitUri { get; set; }
        public bool async { get; set; }
        public bool freshData { get; set; }
        public bool saveDataSnapshot { get; set; }
        public string outputFormat { get; set; }
        public bool interactive { get; set; }
        public bool ignorePagination { get; set; }
        public string pages { get; set; } //1-5
        public ReportParameters parameters { get; set; }
    } 
 
Regards, 
Rafal
 
 
Link to comment
Share on other sites

  • 2 years later...
  • 5 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...