burferd Posted September 2, 2009 Share Posted September 2, 2009 I'm using JasperReports 3.6.0 and iReport 3.5.3, NetBeans6.5.1 and Glassfish 2.0I have a report that works fine in iReport, but when I attempt to run it from my application, I get the following exception when calling the JasperFillManager.fillReport() method to create the report:"cannot assign instance of net.sf.jasperreports.engine.base.JRBaseStaticText to field net.sf.jasperreports.engine.base.JRBaseLineBox.boxContainer of type net.sf.jasperreports.engine.JRBoxContainer in instance of net.sf.jasperreports.engine.base.JRBaseLineBox"It kind of sounds like something in the report itself is trying to use the wrong type of component, but I know virtually nothing about Jasper Reports.Does anyone have an idea what is causing this?Let me know if I need to post any additional information or code.Thanks. Link to comment Share on other sites More sharing options...
burferd Posted September 14, 2009 Author Share Posted September 14, 2009 I'm bringing this up again since I did not recieve any feedback on my last post.I have added jrxml version of the report I am attempting to run as an attachment. I have also included the code I am using to create the report in my application. The report gives the exception noted in my last post when it attempts to create the report in the following line of code: jp = JasperFillManager.fillReport( sb1.getReportDir()+"Company_Report.jasper", parameters, conn ); The error message is: "cannot assign instance of net.sf.jasperreports.engine.base.JRBaseStaticText to field net.sf.jasperreports.engine.base.JRBaseLineBox.boxContainer of type net.sf.jasperreports.engine.JRBoxContainer in instance of net.sf.jasperreports.engine.base.JRBaseLineBox" I do not understand how the report can run in iReport, but have problems in the application.Maybe there is a missng library?Here are the libraries I am linking to in the application:commons-beanutils-1.8.0.jarcommons-collections-2.1.1.jarcommons-digester-1.7.jarcommons-logging-1.0.4.jariText-2.1.0.jarjasperreports-3.6.0.jarjfreechart-1.0.12.jarpoi-3.2-FINAL-20081919.jar I'm at a standstill until I can figure out what the problem is here.Any help is appreciatedThanks. Code: public boolean createCompanyRpt() { JasperPrint jp=null; JasperReport jr = null; try { String title = "Tag Enrollment Report"; Map parameters = new HashMap(); String dir = sb1.getReportDir(); jp = JasperFillManager.fillReport( sb1.getReportDir()+"Company_Report.jasper", parameters, conn ); if( doPdf )doPdfReport( jp, "CompanyReport"); if( doExcel )doExcelReport( jp, "CompanyReport" ); } catch( Exception e ) { e.printStackTrace(); log( "<ReportSessionBean.createCompanyRpt> Error: "+ e.toString()); sb1.setMessage( "Error creating report."); return false; } return true; } Link to comment Share on other sites More sharing options...
burferd Posted September 16, 2009 Author Share Posted September 16, 2009 I managed to resolve the issue. Thanks for the feedback. Link to comment Share on other sites More sharing options...
alfonsolist Posted October 13, 2009 Share Posted October 13, 2009 Hello, I have the same problem you describe your solution Link to comment Share on other sites More sharing options...
burferd Posted October 14, 2009 Author Share Posted October 14, 2009 The problem was that in the bowels of NetBeans, the older Jasper Reports libraries were being referenced.This, apparently caused some confusion. It looks like there is a change between the Jasper Reports libraries - not backward compatible.I was not able to resolve this by changing libraries in the NetBeans IDE library manager, but had to ferret it out in the internal setup files for NetBeans.Not sure exactly how I found it, but if you do a project search for the old library name, you might find a reference that you can delete. 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