How to add parameters/input to jrxml file by Rest API when creating

1

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

Iras's picture
7
Joined: Mar 24 2018 - 7:08am
Last seen: 1 year 7 months ago

1 Answer:

1

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)

andre.sousa's picture
Joined: Oct 28 2019 - 3:56am
Last seen: 4 weeks 1 day ago
Feedback
randomness