Jump to content
Changes to the Jaspersoft community edition download ×

Jaspersoft prints wrong values in a text field expression


mpolo91

Recommended Posts

Hi everyone,

i had created a Jasperreport that prints the name of a city (f.e. "Munich") and the name of a country (f.e. "Bavaria"). If I run the preview I get the strange error that the program prints for both fields value "Bavaria". So the country name is equal the cityname.

I check the SQL query and the data in the database, but there, everything looks correct. If I run the query in a databasemanager, I got the correct values. Also in a corresponding BIRT Report the values are printd correctly. 
So I think this have to be a problem of Jaspersoft and not problem of the query. I checked the report and only hint I found was, that the field of the cityname is the only field that has no property of name "com.jaspersoft.studio.field.tree.path". Any other fields are mapped to the database table with this property. I added this property, but this did not bring a change.

Any ideas why this happened?

 

 

 

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Hi,

I did not use default values, but now after rewriting the sql query it works. We think the problem was a left join in the query, that is now replaced with a subselect. But its strange. Why the old query works correctly in Birt and DBeaver and not in Jaspersoft?
With the old query the field value where configured on this way:
 

 <field name="Countryname" class="java.lang.String">        <property name="com.jaspersoft.studio.field.name" value="Cityname"/>        <property name="com.jaspersoft.studio.field.label" value="Countryname"/>        <property name="com.jaspersoft.studio.field.tree.path" value="DATATABLE_NAME"/>    </field> <field name="Cityname" class="java.lang.String">        <property name="com.jaspersoft.studio.field.name" value="Cityname"/>        <property name="com.jaspersoft.studio.field.label" value="Cityname"/> </field>[/code]

 

 

Link to comment
Share on other sites

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...