Jump to content
JasperReports Library 7.0 is now available ×

Problem with Integer object in report


Recommended Posts

By: Martin Duclos - tchitow

Problem with Integer object in report

2003-02-04 13:18

I am getting data from a database. Some of the fields that are coming from the database are Integers. When I try using those in the report, I always get the value 0. I have verified that the value in the db isn't 0 but is in fact a number != 0. The only way I can get this to work is by adding the following to my sql statement:

concat( '', someIntegerField )

This seems to force the returned value to be a string that gives the desired results in the report. This works for now, but there has to be a better way to make this work.

 

 

 

 

 

By: Teodor Danciu - teodord

RE: Problem with Integer object in report

2003-02-05 00:18

 

Hi,

 

What database and what JDBC driver are we

talking about?

 

Try to make a small Java program that executes

a query and retrieves the same values from the

ResultSet. It might be not related to JasperReports.

 

Thank you,

Teodor

 

 

 

 

 

By: Martin Duclos - tchitow

RE: Problem with Integer object in report

2003-02-05 09:31

Thanx for the reply. I'm getting the data from a mysql database. I tried making a simple report with just the one text field that I wasn't getting right in the big report. After hours of thinking, I realized that the query involved 2 tables. Thoses two tables each contain a field with the same name. To slove the problem:

select *, someTable.someField as anotherNameForField from someTable, someTable2

and Voila!

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