topred Posted March 30, 2007 Share Posted March 30, 2007 Hi,I've checked the documentation and forums but haven't been able to find an answer so far. I have a database with an integer Status column. The Java code normally takes care of mapping the numeric value to a string value, such as 1="Ready", 2="In Progress", etc. However, I want to generate a JasperReport with the string values, not the integers. I'm using a JRResultSetDataSource for the data. How do I perform this mapping? Thanks. Bob Link to comment Share on other sites More sharing options...
topred Posted April 7, 2007 Author Share Posted April 7, 2007 Any suggestions? It seems like some of the options are conditional expressions, resource bundles, or parameters, but I expect someone has already solved this in an intelligent way. Also, I want to keep it simple when using iReports. Thanks. Bob Link to comment Share on other sites More sharing options...
Teodor Danciu Posted April 20, 2007 Share Posted April 20, 2007 Hi, I guess it is about: "where to store this relationship between numbers and texts".Well, you already seemed to find some answers, which should work pretty good.I like the resource bundle approach. Otherwise you could just create an utility static method somewhere in your application that takes an integer and returns a string and use it in your JRXML. I hope this helps.Teodor 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