wilxom Posted August 23, 2007 Share Posted August 23, 2007 An error message was prompted out when i try to insert argument(PARAMETERS) into the substring statement. Error Message: net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file: 1. The method substring(int) in the type String is not applicable for the arguments (Integer) value = (java.lang.String)(((java.lang.String)field_NLHASH.getValue()).substring( ((java.lang.Integer)parameter_pendM.getValue()) ));//$JR_EXPR_ID=8$ <-------> Example: $F{NLHASH}.substring( $P{pbeginM}, $P{pendM} ) I tested both parameter having values but it display an error saying that the method substring(int) in the type String is not applicable for the arguments (Integer). Please help. Thanks Regards,Wilson Link to comment Share on other sites More sharing options...
codyjasperForge Posted August 23, 2007 Share Posted August 23, 2007 Instead of casting 'parameter_pendM' into and 'Integer',you need to cast it into a 'int'. Either add '.intValue()' onto the end of you parenthesis, or try another method of casting. ((java.lang.Integer)parameter_pendM.getValue()).intValue())); See what this does... Link to comment Share on other sites More sharing options...
wilxom Posted August 24, 2007 Author Share Posted August 24, 2007 Thanks for your reply.With the solution provided, i manage to past the parameter or variable into the substring. I just added intValue() at the back of each parameter.Please refer to the below statement: $F{NLHASH}.substring( $P{pbeginM}.intValue(), $P{pendM}.intValue() ) Thanks for the solution provided. Regards,Wilson Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now