Jump to content

Stream has already been closed


tinti

Recommended Posts

Morning,

 
I have the following problem in my reports.
One jrxml file with a SQL and their fields mapped.
 
My detail band needs a title line in the report, so i've created a group with a groupHeader in it.
This groupHeader haver a textField with my title "Title", and a printWhebExpression.
 
It will print just when some random field of my sql will be not null.
 
Like that:
 
<printWhenExpression><![CDATA[$F{MY_FIELD} != null]]></printWhenExpression>
 
The problems is that, my SQL dont have values to the fields that i'm looking for, but theres a registry on that line.
 
Something like that:
 
select my_field,
field2
from my_table
where field3 = 'value'
and field4 is not null
 
The my_field and field2 dont have values, so, they will be null.
But, my condition in the "where" section, get me on registry line, as i said.
 
So, my detail will print, but my groupHeader not.
I need to force the groupHeader to print.
 
I tried to do a small change on my SQL, doing something like that:
 
select     alias.*,
                1 condition
from (
                select     my_field,
                                field2
                from        my_table
                where     field3 = 'value'
                and         field4 is not null
                ) alias
 
And then, i changed the expression to:
 
<printWhenExpression><![CDATA[$F{CONDITION}.intValue() == 1]]></printWhenExpression>
 
And it solved my problem, but now, sometimes i got the following error:
 
java.sql.SQLException: Stream has already been closed
 
 
Can someone give a help with this.

 

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...