Hi,
I need to add parameters/input to my jrxml file by Rest API. My file create normally but wihout parameters. I need to add parameters to this jrxml file. Only I have found that I need to path to inputcontrolreference but it doesn't works. Below the code which I send using the put method:
{ "label" : "paragon", "description" : "paragon jrxml", "dataSource" : { "dataSourceReference": {"uri": "/datasources/Oraclunio"} }, "inputControls" : [ { "inputControlReference": {"uri": "/reports/G/paragon_files/NumerZamowienia"} }, { "inputControlReference": {"uri": "/reports/G/paragon_files/Rodzaj"} } ], "alwaysPromptControls": true, "controlsLayout" : "popupScreen", "jrxml" : { "jrxmlFile" : { "label" : "Main jrxml", "type" : "jrxml", "content": "content" } } }
I have used such a link :
http://localhost:8081/jasperserver/rest_v2/resources/reports/G/paragon?createFolder=false
1 Answer:
Posted on November 2, 2019 at 4:25am
After some time seaching i found a solution, here is it:
<reportUnit> <alwaysPromptControls>true</alwaysPromptControls> <controlsLayout>popupScreen</controlsLayout> <label>{0}</label> <dataSourceReference> <uri>{1}</uri> </dataSourceReference> <inputControls> <inputControlReference> <uri>{2}</uri> </inputControlReference> </inputControls> <jrxmlFile> <label>Main jrxml</label> <type>jrxml</type> <content>{3}</content> </jrxmlFile> </reportUnit>
{0} => string
{1} => uri for a datasource on JasperSoft Server
{2} => uri for a inputcontrol on JasperSoft Server
{3} => base64 encoded string (content o file jrml)