joshuab Posted April 1, 2015 Share Posted April 1, 2015 Hi,I'm very new to iReport and I've been given a Jasper report template and a Java datasource to start editing. I've been given instructions on how to setup iReport however when I follow the instructions, I get a number of "Type mismatch: cannot convert from boolean to Object" errors generated when I try to Preview the template.I'm running iReport 5.6.0 on Mac OS X 10.9 and running with JDK 7.65, I've tried changing the JDK version but it hasn't made any difference to the errors.The really strange thing is that I have given the template and datasource to a couple of other developers and talked them through the instructions (so that they followed the exact same steps as I did). One of them is running in OS X and the other running in Windows 7. Both of these developers were able to use the template and Preview it without getting the same problems that I've been having.I've tried a number of things (reinstalled iReport, changed JDK, turned my computer on and off, sacrificed a goat) but I keep on getting these errors.Has anyone seen this error before and have any ideas about what could be causing this error on my machine, while other developers got it working first time (following the exact same steps)?Thanks. Link to comment Share on other sites More sharing options...
sanbez Posted April 1, 2015 Share Posted April 1, 2015 Show full stacktrace Link to comment Share on other sites More sharing options...
AnnMary.Thomas Posted April 1, 2015 Share Posted April 1, 2015 Check the type of the fileds in your report. Say if your query is Select filed1,filed2 from table1 where field1 and field2 are of type boolean. Then the corresponding fileds in your report where you are dispaying or using in some calculation for other fileds, the type should be same Link to comment Share on other sites More sharing options...
joshuab Posted April 2, 2015 Author Share Posted April 2, 2015 Hi thanks for your response, some more details on my question: The field is called invoiceHeader and it's type is a Java object. The text field that's generating the error has a Text Field expression which is: $F{invoiceHeader}.getInvoiceId() The text field Expression Class is: java.lang.String The error being generated is: Type mismatch: cannot convert from long to Object. The Java method .getInvoiceId() returns a long, which explains part of the error. But what is unclear to me is why iReport Studio is expecting an Object to be returned. Also, as I posted originally, this error is not occurring in other developers environments. Thanks again for your help. Link to comment Share on other sites More sharing options...
sanbez Posted April 2, 2015 Share Posted April 2, 2015 It is wrong (or not full) description of problem. In first message you say about "Type mismatch: cannot convert from boolean to Object" Now: "Type mismatch: cannot convert from long to Object." Why you wrote about difference errors? You don't show stacktrace. You don't show definition $F{invoiceHeader} in jrxml. Telepaths are on vacation :) Probably you can try change getInvoiceId() {return long} to getInvoiceId() {return Long} But this is only an attempt to guess without seeing anything Link to comment Share on other sites More sharing options...
bharaniabhishek123 Posted April 2, 2015 Share Posted April 2, 2015 Try nestedType like below Link to comment Share on other sites More sharing options...
sanbez Posted April 3, 2015 Share Posted April 3, 2015 OMG. What is it? Where author use collection? 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