Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

tJasperoutput

Hi,
I am using tJasperoutput component in Talend Integration Suit 5.0 to generate report. If all the filelds of the Report are of string type, then I am getting perfect output but if the jrxml has an integer or float values then the tJasperoutput step throws error. The schema of input component and tJasperoutput component is same.
The following is the error msg I am getting:-
Starting job Report3 at 16:58 30/07/2012.
connecting to socket on port 3724
connected
Exception in component tJasperOutput_1
net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file:
1. Cannot cast from Integer to String
value = (java.lang.String)(((java.lang.Integer)field_emp_id.getValue())); //$JR_EXPR_ID=11$
<-------------------------------------------------------------->
2. Cannot cast from Float to String
value = (java.lang.String)(((java.lang.Float)field_sales.getValue())); //$JR_EXPR_ID=14$
<----------------------------------------------------------->
3. Cannot cast from Integer to String
value = (java.lang.String)(((java.lang.Integer)field_emp_id.getOldValue())); //$JR_EXPR_ID=11$
<----------------------------------------------------------------->
4. Cannot cast from Float to String
value = (java.lang.String)(((java.lang.Float)field_sales.getOldValue())); //$JR_EXPR_ID=14$
<-------------------------------------------------------------->
5. Cannot cast from Integer to String
value = (java.lang.String)(((java.lang.Integer)field_emp_id.getValue())); //$JR_EXPR_ID=11$
<-------------------------------------------------------------->
6. Cannot cast from Float to String
value = (java.lang.String)(((java.lang.Float)field_sales.getValue())); //$JR_EXPR_ID=14$
<----------------------------------------------------------->
6 errors
at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:191)
at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:215)
at net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:131)
at client.report3_0_1.Report3.tFileInputDelimited_1Process(Report3.java:747)
at client.report3_0_1.Report3.runJobInTOS(Report3.java:973)
at client.report3_0_1.Report3.main(Report3.java:841)
disconnected
Job Report3 ended at 16:58 30/07/2012.

Thanks
Labels (4)
5 Replies
Anonymous
Not applicable
Author

Hi
The errors indicate that there are data type convertion issues.
Please make sure the data type of columns in the schema of the tJasperOutput are the same with the predefined jrxml file.
Regards,
Pedro
Anonymous
Not applicable
Author

Hi,
I have checked the data type of columns in the schema of the tJasperOutput and the predefined jrxml file. Both the schemas are same. In the schema "id" column is an integer filed in tJasperoutput step and in jrxml also. But it is throwing same error. If I take "id" as string in tJasperoutput and in jrxml then it works fine.
The screenshot of schema in tJasperoutput and jrxml are attached with the post.
Thanks
Anonymous
Not applicable
Author

Hi
Could you send me an email and attach the exported job and related files?
I try to reproduce this issue but failed.
Regards,
Pedro
Anonymous
Not applicable
Author

Hi,
I have sent you a mail on your email-id "xhuo@talend.com". I have provided the exported job, jrxml file and database script. Please confirm if you have received my mail.
Thanks
_AnonymousUser
Specialist III
Specialist III

Hi,
Did you find the solution, can you publish it ?
Regards,
Jérome