Search code examples
sqlcrystal-reportshanainvoice

How to keep currency decimals from HANA in Crystal Reports?


I have a HANA database and Crystal Reports for print layouts. I am working on the invoice layout and I have values in two currencies:

  • Dollar (USD) have 2 decimals, e.g. 1,00
  • Guarani (GS) have none, e.g. 1

In the database, this is working:

rows in database

but Crystal Reports has its own config, and put 2 decimals or none:

this is an example of Crystal Reports view of Guaranies values, in the database didn't have decimals

How can I retrieve exactly as the database shows, or what formula I can apply to round decimals respecting the Currency?


Solution

  • Right click on the field that you want to modify the decimal value. Click "Format Field..." on the menu. On the Number tab of the window that opens click the "Customize..." button. This will take you to the screen where you can better define how this field should display decimal values.

    You the drop-down controls here that are labeled "Decimals:" and "Rounding:" to control the properties of the decimal. The Decimals control will determine how many digits will be displayed, while the Rounding control will determine to which significant digit to round the result displayed.

    Since you are working with foreign currencies, you may also want to take note of the Currency tab on this screen as well. It will be useful for displaying foreign currency symbols on your reports when necessary.