Hello,
I need to run a report with parameters calculated in Talend. I found the plugin tJasperServerExec and I read the tutorial http://community.jaspersoft.com/wiki/tjasperserverexec-tutorial
But I get this error :
[INFO ]: org.apache.commons.httpclient.HttpMethodDirector - Redirect requested but followRedirects is disabledAxisFault faultCode: {http://xml.apache.org/axis/}HTTP faultSubcode: faultString: (302)D�plac� Temporairement faultActor: faultNode: faultDetail: {}:return code: 302 {http://xml.apache.org/axis/}HttpErrorCode:302 (302)D�plac� Temporairement at org.apache.axis.transport.http.CommonsHTTPSender.invoke(CommonsHTTPSender.java:218) at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32) at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118) at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83) at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165) at org.apache.axis.client.Call.invokeEngine(Call.java:2784) at org.apache.axis.client.Call.invoke(Call.java:2767) at org.apache.axis.client.Call.invoke(Call.java:2443) at org.apache.axis.client.Call.invoke(Call.java:2366)[WARN ]: org.apache.commons.httpclient.HttpMethodBase - Going to buffer response body of large or unknown size. Using getResponseBodyAsStream instead is recommended. at org.apache.axis.client.Call.invoke(Call.java:1812) at com.jaspersoft.jasperserver.irplugin.wsclient.RepositorySoapBindingStub.runReport(RepositorySoapBindingStub.java:193) at com.jaspersoft.jasperserver.irplugin.wsclient.WSClient.runReport(WSClient.java:390) at com.jaspersoft.jasperserver.irplugin.wsclient.WSClient.runReport(WSClient.java:311) at test1.jasper_0_1.jasper.tFileInputDelimited_2Process(jasper.java:577) at test1.jasper_0_1.jasper.runJobInTOS(jasper.java:975) at test1.jasper_0_1.jasper.main(jasper.java:832)Exception in component tJasperServerExec_1AxisFault faultCode: {http://xml.apache.org/axis/}HTTP faultSubcode: faultString: (302)D�plac� Temporairement faultActor: faultNode: faultDetail: {}:return code: 302 {http://xml.apache.org/axis/}HttpErrorCode:302 (302)D�plac� Temporairement at org.apache.axis.transport.http.CommonsHTTPSender.invoke(CommonsHTTPSender.java:218) at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32) at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118) at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83) at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165) at org.apache.axis.client.Call.invokeEngine(Call.java:2784) at org.apache.axis.client.Call.invoke(Call.java:2767) at org.apache.axis.client.Call.invoke(Call.java:2443) at org.apache.axis.client.Call.invoke(Call.java:2366) at org.apache.axis.client.Call.invoke(Call.java:1812) at com.jaspersoft.jasperserver.irplugin.wsclient.RepositorySoapBindingStub.runReport(RepositorySoapBindingStub.java:193)[statistics] disconnected at com.jaspersoft.jasperserver.irplugin.wsclient.WSClient.runReport(WSClient.java:390) at com.jaspersoft.jasperserver.irplugin.wsclient.WSClient.runReport(WSClient.java:311) at test1.jasper_0_1.jasper.tFileInputDelimited_2Process(jasper.java:577) at test1.jasper_0_1.jasper.runJobInTOS(jasper.java:975) at test1.jasper_0_1.jasper.main(jasper.java:832)
Is anyone can help me ? Thanks in advance !
6 Answers:
tJasperServerExec is a very old component. I just use JasperReports Server REST API with tRESTClient.
http://community.jaspersoft.com/documentation/tibco-jasperreports-server...
https://help.talend.com/display/TalendComponentsReferenceGuideFall1EN/tR...
Thanks for your answer. So I tested tRestClient but it doesn't work (I don't know how to set it ...)
My report is published on server, in Reports/TestFactures, and it's called "facture".
When I want to execute it via URL to generate a PDF, I do : http://localhost:8080/jasperserver/flow.html?_flowId=viewReportFlow&Pare...
and it's worked !
In Talend, I use tRestClient. In parameter I do :
URL : "http://localhost:8080/jasperserver/rest_v2/reports/reports/TestFactures/..."
Parameters : I write the parameters of my URL with values (WITH_NUMFACT, IN_NOTIN and NUMFACT)
I don't know if to write other marameters.
When I execute this, I get the error : "No message body reader has been found for class org.dom4j.Document, ContentType: text/html;charset=UTF-8"
I read lots of forums and the "JasperReports Server Web Service Guide" but I don't manage to do it ... and I don't understand how generate the PDF and save it on server or anywhere.
Do you have some examples, tutorials, ... ? Thanks in advance for your help !
Thanks for your answer.
But in my uri, I allready add authentication : http://localhost:8080/jasperserver/rest_v2/reports/reports/TestFactures/...?j_username=myusername&j_password=mypassword (I tested without I got an error of authentication)
Any other idea ?
Sorry, pointed you to a wrong API.
Use the report service and just specify "pdf" as the output format. This is what I'm doing.
http://community.jaspersoft.com/documentation/tibco-jasperreports-server...
Hello,
it doesn't work with "http://localhost:8080/jasperserver/rest_v2/reports/reports/TestFactures/..."
I tested with API Chrome : Advanced Rest Client this URL and the status is OK
In response Header :
Server: Apache-Coyote/1.1Cache-Control: privateExpires: Thu, 01 Jan 1970 01:00:00 CETP3p: CP="ALL"Content-Disposition: attachment; filename="facture.pdf"Output-Final: trueContent-Type: application/pdfContent-Length: 55627Date: Fri, 30 Dec 2016 14:55:11 GMT
%PDF-1.5 %���� 7 0 obj <</Filter/FlateDecode/Length 2996>>stream x���v����MOmc�� [...]