2004 IR Help Posted August 24, 2006 Share Posted August 24, 2006 By: Norbert - noreic textFieldExpression 2005-12-16 23:02 Can one invoke an custom Java class in a textFieldExpression? I created a class called StringUtil that has a static method called getId. This method returns a string. Now, I added the following expression in report created using iReport: StringUtil.getId() I also included the import to the iReport definition. But once I tried to compile the report I got the following JRException: Errors were encountered when compiling report expressions class file: 1. The method getId() is undefined for the type StringUtil I move the report Java source code to Eclipse and I was able to do the Java compilation. So, the usage of the StringUtil class is valid (in Java), but the JasperReport compiler doesn't like it's usage in a textFieldExpression. Thanks. By: Norbert - noreic RE: textFieldExpression 2005-12-17 01:04 Yes, one can use a custom Java class. In my case, the error happened because the .jar file didn't have that class... :( I added the custom class to the .jar file and then I was able to invoke the method and display the text generated by the custom class in the report. 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