Jump to content
We've recently updated our Privacy Statement, available here ×

alexlat13

Members
  • Posts

    2
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Security Advisories

Downloads

Posts posted by alexlat13

  1. Hello.

    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()
           jServer.setName(NAME_SERVER)
           jServer.setUsername(username)
           jServer.setPassword(password)
           ResourceDescriptor rd = new ResourceDescriptor()
           rd.setWsType(ResourceDescriptor.TYPE_JRXML)
           rd.setUriString(reportUri)
     
           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 com.jaspersoft.ireport.jasperserver.ws.WSClient.runReport(WSClient.java:403)
    | Error at com.jaspersoft.ireport.jasperserver.ws.WSClient.runReport(WSClient.java:320)
    | Error at com.jaspersoft.ireport.jasperserver.ws.WSClient$runReport.call(Unknown Source)
    | Error at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
    | Error at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
    | Error at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120)
    ...

     

     

     

     

     

     

  2. Hello everyone. I have a question: "Can I send data (XML or JSON) to create a report using the rest service?" I don't want use xml_url connect to other file (DATASOURCE_XML_REMOTE). Can anyone help in this matter? Would be grateful for examples.I use JasperServer 5.5.0 and simple application (Java / groovy) rest client jersey. I have created a jasper report data_source - XmlDataSource and JSONDatasource.

    Best regards, Alexander

×
×
  • Create New...