Send data_source parameters Web Services (runReport)


I have a problem. I wrote a simple code (groovy): 

public MainTest {
public static JasperPrint runReport(String reportUri, Map parameters) throws Exception {
JServer jServer = new JServer()
       ResourceDescriptor rd = new ResourceDescriptor()
       return getServer(URL_REPOSITORY_SERVICE).getWSClient().runReport(rd, parameters)
public static void main() {
      String xml = "<?xml version=\"1.0\" encoding=\"utf-8\"?><inforeports><report><webcastId>92354</webcastId></report><report><webcastId>92355</webcastId></report></inforeports>"
       Map<String, Object> params = new HashMap<String, Object>();
       Document document = JRXmlUtils.parse(new ByteArrayInputStream(xml.getBytes("UTF-8")))
       params.put(JRXPathQueryExecuterFactory.PARAMETER_XML_DATA_DOCUMENT, document)
       runReport("/test/example_report_xml", params)

How set parameter XML_DATA_SOURCE?  Because I have exception:


| Error java.lang.Exception: 1 - java.lang.String cannot be cast to org.w3c.dom.Document
| Error at
| Error at
| Error at$ Source)
| Error at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(
| Error at
| Error at







alexlat13's picture
Joined: Jan 17 2014 - 2:38am
Last seen: 7 years 11 months ago

0 Answers:

No answers yet