jmurray Posted January 19, 2007 Share Posted January 19, 2007 I am trying to use java.text.DecimalFormat in a scriptlet so that the string representation of a number does not appear in scientific notation. Unfortunately the compiler always complains as shown in the code sample below: Code:import net.sf.jasperreports.engine.*;import java.text.DecimalFormat;[snip]public String myNumberFormat(Double v1) throws JRScriptletException{/** make a string out of the Double that was passed in **/java.text.DecimalFormat formatter = java.text.DecimalFormat("#0.#"«»);String p = formatter.format(v1); [snip]C:ReportsDigiTollNETFLOWNF_PORT_TOTALS_SITE_SUBScriptlet.java:20:ÂcannotÂfindÂsymbol symbolÂÂ:ÂclassÂtext location:ÂpackageÂjava java.text.DecimalFormatÂformatterÂ=Âjava.text.DecimalFormat("#0.#"«»); ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ^ Removing the "java.text." class directive simply changes the error to "cannotÂfindÂsymbol DecimalFormat". It's like the scriptlet engine doesn't follow or know about the iReport classpath. Putting rt.jar into the iReport lib directory along with all the other jrs didn't help either. Any ideas? .Post edited by: jmurray, at: 2007/01/18 21:49 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