Search code examples
oraclereportoraclereports

Editing the values of a column in Oracle reports


I have a oracle report which is to display a set of values and it can be generated both as pdf and csv formats. I had to make sure that these values always shows upto 3 decimals. That is:

0.1  --> 0.100
0.01 --> 0.010
0    --> 0.000

Excel doesnt consider the trainling zeros and so I used the following code for making excel display all the 3 decimals:

select '="'||to_char(value,'90.999')||'"' from table1; 
--The column is declared as NUMBER(10,3) in the table

Now the number shows up in the excel as desired, but in pdf format it shows like : =" 0.000"

Can anyone please tell me how to make it consistent in both pdf and csv formats?


Solution

  • You could evaluate the format parameter of the report at runtime and use a DECODE statement or CASE statement to determine which output format / value for the column.

    I think this would achieve what you are aiming for ie. a single structured report using the same query for either csv or pdf output.