Skip to main content

Re: Substance + Jasper Reports

  • From: Danno Ferrin <shemnon@...>
  • To: "users@..." <users@...>
  • Subject: Re: Substance + Jasper Reports
  • Date: Fri, 23 Dec 2011 05:40:29 -0800 (PST)
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=Uvl07FytUtPLyKtMbf8tmIIlwcXnlwEIYLU3QYecPPTPmBMIG7M3Rb19J3J+BYoiktECteWT6UtaYLdutHEHW202x/5qB6uY/4xK9Y+7a0afQ6m5A43mFAEz0waMnDCluad76B8kBbrwaS4snQbV1kVWQhZ4PH4NZ7B6V5l+Bsw=;

The problem is that jasper reports itself is then pulling itself out of the EDT when printing the report.   I maintain a maintenance fork of substance called "insubstantial" and I have the EDT exception disabled by default.  

The source is at github (https://github.com/Insubstantial/insubstantial/) and the most current release is 7.0 (http://insubstantial.posterous.com/).  If  you are using maven it has maven co-ordinates of :
<dependency>
<groupId>com.github.insubstantial</groupId>
<artifactId>substance</artifactId>
<version>7.0</version>
</dependency>
or you can download the jars from the blog post.  Be sure to pick up laf-widget, laf-plugin, and trident since I don't embed those in the substance jar I ship.

--Danno

From: Leandro Guimarães <leo.guimaraes@...>
To: users@...
Sent: Thursday, December 22, 2011 9:42 AM
Subject: Re: Substance + Jasper Reports

Hello Pedro,
  Thank you very much for your answer!

  I believe i'm invoking that code inside the UI dispatch. I did a test with the isEventDispatchThread() method, and it enters the code.

 if(javax.swing.SwingUtilities.isEventDispatchThread()) {
                     jr.printReport(....); //Enter here
  }

That's the right way to check if i'm in eventDispatchThread?

Thanks Again!
Leandro Guimarães


On Thu, Dec 22, 2011 at 2:33 PM, Pedro Duque Vieira <pedro.duquevieira@...> wrote:
That exception happens when you try to make changes to the UI outside of the UI dispatch thread. 
Invoke that code in the UI dispatch.

Cheers,
Pedro DV

2011/12/22 Leandro Guimarães <leo.guimaraes@...>
Hello Everyone,

   I'm using substance and Jasper Reports. I can open the report template with no problemas, but when i click the PRINT button, the default OS printer dialog do not render tottaly. Reading the log i have the following exception:

 
org.jvnet.lafwidget.UiThreadingViolationException: Component state change must be done on Event Dispatch Thread
    at org.jvnet.lafwidget.LafWidgetUtilities.testComponentStateChangeThreadingViolation(LafWidgetUtilities.java:593)
    at org.jvnet.lafwidget.animation.FadeStateListener$1.stateChanged(FadeStateListener.java:232)
    at javax.swing.DefaultButtonModel.fireStateChanged(Unknown Source)
    at javax.swing.DefaultButtonModel.setRollover(Unknown Source)
    at javax.swing.AbstractButton.setEnabled(Unknown Source)
    at net.sf.jasperreports.view.JRViewer$21.run(JRViewer.java:1209)
    at java.lang.Thread.run(Unknown Source)
ERROR 13:46:29,966 JRViewer$21.run:1217  - Print error.

I don't know if it's a problem with the Substance or Jasper, please could someone help me?

Thanks!

Leandro






Substance + Jasper Reports

Leandro Guimarães 12/22/2011

Re: Substance + Jasper Reports

Pedro Duque Vieira 12/22/2011

Re: Substance + Jasper Reports

Leandro Guimarães 12/22/2011

Re: Substance + Jasper Reports

Pedro Duque Vieira 12/22/2011

Re: Substance + Jasper Reports

Danno Ferrin 12/23/2011

Re: Substance + Jasper Reports

Martin Cavanagh 12/23/2011
 
 
Close
loading
Please Confirm
Close