從iteye抄過來的,ireport 用在你項目一般出錯的2個問題

來源:互聯網
上載者:User

 

下面是我曾經遇到過的兩個問題,僅供參考

a. Jasper Reportnull 指標異常 用IReport3.7.3建一個模板,並編譯成.jasper檔案,程式產生report的時候拋null 指標異常。(程式用的jar包為jasperreports-3.5.3.jar)
是因為編譯Jasper檔案所用的jar包和調用jarsper檔案產生report所用的jar包版本不同。IReport3.7.3用的jar包版本是3.7.3(iReport-3.7.3\ireport\modules\ext\jasperreports-3.7.3.jar) //從irport安裝目錄下,找到對應目錄的jar包 

b. Jasper Report產生異常 Exception in thread "main" java.lang.NoClassDefFoundError: org/codehaus/groovy/control/CompilationFailedException
  2010.07.05 是因為模板裡面Language選項預設為Grovvy了。應該選為Java。這裡應該修改Ireport的預設選項,不然建立的範本語言都預設為Grovvy c.第三個問題,cannot assign instance of net.sf.jasperreports.engine.base.JRBaseStaticText to field net.sf.jasperreports.engine.base.JRBaseParagraph.paragraphContainer of type net.sf.jasperreports.engine.JRParagraphContainer in instance of net.sf.jasperreports.engine.base.JRBaseParagraph //搞不定了,去睡覺了,TNND JAVA ,日死你//JasperFillManager.fillReport(path,null,new JREmptyDataSource());//ireport 3.0編譯的jasper檔案能過//ireport3.6.0編譯的jasper檔案不能過,缺這個包groovy-all-1.7.5.jar//ireport4.5不能過,出這個錯,java.lang.ClassCastException: cannot assign,無解,不管了 睡覺去了,用JAVA的都是白癡的,那麼多包,都把時間浪費在編譯上了,能做些對社會有貢獻的事情嗎?

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.