Jump to content
Changes to the Jaspersoft community edition download ×

amount on jasper server is not same as in studio


tom_45

Recommended Posts

Hi guys,

I have installed the jasperstudio CE 6.6.0, and on the same server, jasper server 7.1.0 (Windows server 2016)

I am not a programmer, that's probably one of the biggest problems I have here. Let me explain.

I managed to create a pricelist report that correctly outputs prices via jasper studio. To that end, I created a text field because there are some calculations behind it:

( $P{prijslijst}.equals(0) ? "€ " +$F{base_sales_price-LAT_BE-EUR} :
( $P{prijslijst}.equals(1) ? "€ " + ($F{base_sales_price-LAT_BE-EUR} + ($F{base_sales_price-LAT_BE-EUR} * $F{export1_discount_pct})) :
( $P{prijslijst}.equals(2) ? "€ " + ($F{base_sales_price-LAT_BE-EUR} + ($F{base_sales_price-LAT_BE-EUR} * $F{export2_discount_pct})) :
( $P{prijslijst}.equals(3) ? "€ " + (($F{base_sales_price-LAT_BE-EUR} + ($F{base_sales_price-LAT_BE-EUR} * $F{export1_discount_pct})) + (($F{base_sales_price-LAT_BE-EUR} + ($F{base_sales_price-LAT_BE-EUR} * $F{export1_discount_pct}))*$F{export3_surcharge_pct} ))  :
( $P{prijslijst}.equals(4) ? "€ " + (($F{base_sales_price-LAT_BE-EUR} + ($F{base_sales_price-LAT_BE-EUR} * $F{export1_discount_pct})) + (($F{base_sales_price-LAT_BE-EUR} + ($F{base_sales_price-LAT_BE-EUR} * $F{export1_discount_pct}))*$F{export3_surcharge_pct} )+((($F{base_sales_price-LAT_BE-EUR} + ($F{base_sales_price-LAT_BE-EUR} * $F{export1_discount_pct})) + (($F{base_sales_price-LAT_BE-EUR} + ($F{base_sales_price-LAT_BE-EUR} * $F{export1_discount_pct}))*$F{export3_surcharge_pct} ))*$F{export4_surcharge_pct})) : 0
    )
))))

 

In jasperstudio, this is correctly output e.g. € 56.63

Then, with a lot of effort, I managed to get jasper server running and was able to upload the report to the server.

When I run the same report on the server, the € 56.63 has suddenly become € 5663.0

 

Same with quantities: 3 kg in jasper studio becomes 30000 kg on jasper server.

 

I'm beginning to understand it may have something to do with localisation, but I don't understand:

- what locale I am using in jasper studio (how can I see this ?)

- what steps do I have to take to ensure that the report displays consistently accross jasper studio and jasper server?

Thanks in advance for your valuable output.

Tom

Link to comment
Share on other sites

  • 2 weeks later...
  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

There is the Locale in the Server connection advanced settings which sets the locale to use for the Jaspersoft Studio connection to the server.  There is the built in parameter REPORT_LOCALE which contains the Locale used to fill the report.Default is system locale. 

There is the ../bundles/adhoc_masks.properties (for each locale as well) that sets the data formats but this generally applies to ad hoc views and JRXML reports based on Domains. But I am assuming yours is a jrxml report with a jdbc data source so this may not be relevant. 

I think its best to first publish the report using english locale and login to JRS server under the same locale to run the report and check. I tested this and the amounts reflect the same. You can also try setting the format in the text field "Pattern" in Studio and see whether that makes any difference.    

 

Link to comment
Share on other sites

Hi,

The locale used by me is dutch (belgium). I've set it in the server connection settings. When I login however in jasper server, that locale is not listed. Is there a way to add missing locales to jasper server?  Belgian(dutch) in my case?

 

Thanks for your extensive reply.

Link to comment
Share on other sites

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