Jump to content
Changes to the Jaspersoft community edition download ×

iReport + Oracle + Data from function


jacek.hajdarowicz

Recommended Posts

Hello,

I'm trying to create a report in iReport. That report has to fetch some data from our database. One of the things it has to get is a total sum, that also has to be converted from a number to text - $323 -> three hundred and twenty-three. The problem is that we have to use polish characters in that conversion "ą, ę, ś, ć" etc. To do that we wrote a function that does that and returns correct values. The issue comes when we try using it inside of iReport.

The query looks like this: SELECT CONVERT_NUMBER_TO_WORD(17908.80, 'PLN') FROM DUAL;
When we use it in SqlPlus we get this: "siedemnaście tysięcy dziewięćset osiem złotych i osiemdziesiąt groszy" - which is correct
But when we try to do the same in iReport, we get this: "siedemnacie tysi©cy dziewi©†set osiem zotych i osiemdziesiĄt groszy"

As you can see, when we get the data in iReport it seems to be using different encoding. It's displayed like that in the Preview Data inside query window, on the internal preview and on the PDF preview.
The reason why I'm lost at this point is because if we try selecting ANY other data that resides in a table, we get correct encoding, the issue seems to only appear when we try to select data using a function (no matter what that function is, if it returns varchar2 it's not encoded properly).

Additional info:
Database: Oracle Database 12c Release 12.1.0.1.0 - 64bit
iReport: 5.6.0
JDBC: ojdbc5.jar
NLS_CHARACTERSET: AL32UTF8
Problematic function: CREATE OR REPLACE FUNCTION CONVERT_NUMBER_TO_WORD(num IN NUMBER, curr IN VARCHAR2) RETURN VARCHAR2
Font (iReport): Arial.ttf (same for PDF)
Pdf encoding: Identity-H

We've tried looking for ways to set proper encoding so that data is fetched properly, but it seems that we are unable to do so :(

 

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