mpolo91 Posted March 29, 2023 Share Posted March 29, 2023 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 More sharing options...
Tirupathi Mangalarapu Posted March 29, 2023 Share Posted March 29, 2023 Are you using any default values on the text property? Can you share a copy of your jrxml file here? Link to comment Share on other sites More sharing options...
mpolo91 Posted March 30, 2023 Author Share Posted March 30, 2023 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 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