Dynamically change decimal places in Crystal Reports


The May 2009 Flexible Solutions GP Reports Newsletter brings us a tip for dynamically changing decimal places in Crystal Reports. This can be really useful for creating Sales Order Processing (SOP) reports for Dynamics GP, where GP stores the number of decimal places for each line item in the SOP10200 and SOP30300 tables.

Here are the steps to have Crystal dynamically determine how many decimal places to use for the quantity fields:

  1. Right click on the report field and choose Formal Field
  2. Go to the Number tab and click Customize
  3. Click on the Formula button next to Decimals:decimals02
  4. Enter the formula that determines how many decimal places to use – the result of the formula will be the number of decimal places the report will use

In the Dynamics GP SOP example, for SOP quantities the formula should be:

{SOP10200.DECPLQTY}-1

If you want do use a formula for the currency amounts, use the following:

{SOP10200.DECPLCUR}-1

And check out the latest demo video for GP Reports Viewer showing how easy it is to replace Dynamics GP’s SOP reports with Crystal Reports!

 

 

6 Responses to “Dynamically change decimal places in Crystal Reports”

  1. Exactly what i needed to. Thanks

    Like

  2. Hi Victoria,
    I am trying to run a simple Vacation Available report in Crystal. I’m pulling from UPR00100, the name and number of hours of vacation available. My issue is that the number pulls in as 1750 (for example). And it needs to be 17.50 hours. I have tried adding and subtracting the # of decimals, but nothing will move the decimal left two spaces.

    I tried your {SOP10200.DECPLQTY}-1 above , with the VACAVLBL field from the UPR00100 table. It saves as a valid formula in Crystal, but when I try to preview the report, I receive the message “Bad Formula Result”.

    Do you know of another formula that will work with this field?
    Thanks,
    Laurie

    Like

    • Hi Laurie,

      You cannot use the SOP10200 table if it is not in your data set, and I suspect that it would not be for a payroll report.

      Unless I am missing something you should just be able to create a formula to take the field that holds the 1750 (in your example) and divide it by 100. There should be no need to do this dynamically – that field will always need to be divided by 100.

      -Victoria

      Like

  3. Found this in a google search. Just what I needed. Thanks

    Like

Trackbacks/Pingbacks

  1. DynamicAccounting.net | Dynamically Changing Decimal Places in Crystal ReportsDynamically Changing Decimal Places in Crystal Reports - DynamicAccounting.net - April 25, 2016

    […] on June 3, 2009 by Mark Polino Victoria Yudin has a new post up on how to Dynamically Change Decimal Places in Crystal Reports. I’m not using Crystal much anymore unless a client already has it in their environment but […]

    Like

  2. Dynamically Changing Decimal Places in Crystal Reports - DynamicAccounting.net - June 3, 2009

    […] Changing Decimal Places in Crystal Reports Victoria Yudin has a new post up on how to Dynamically Change Decimal Places in Crystal Reports. I'm not using Crystal much anymore unless a client already has it in their environment but […]

    Like

Leave a comment