Follow by Email

Wednesday, May 18, 2016

How to ignore zero decimal place values in Crystal Reports

I had this requirement where I wanted to show a decimal number with 2 decimal points in my report but when there is no decimal value I wanted to show the integer part only i.e.

I wanted to show


instead of
50.00 (default behavior)

I had to define a custom formula for this

here is the procedure

  1. right click on your field in crystal report
  2. Format field
  3. Click on Number tab
  4. Press customize button
  5. Define a formula for Decimals as below
Crystal Report Formula
if CurrentFieldValue - truncate(CurrentFieldValue) <> 0 then

This basically means that if the current value has no decimals show 0 or no decimal places , else show 2.

Thanks to an answer in below stackoverflow thread from where I got to know about "CurrentFieldValue "

Thursday, May 5, 2016

SCRIPT438: Object doesn't support this property or method

Problem :
When trying to click on a check box I was getting this error message

SCRIPT438: Object doesn't support this property or method

Reason : 

The reason was that the Id of my inbox and the function it was calling on click was the same

<INPUT type="checkbox" id="isGeneral" onclick="isGeneral(this)" />

Solution :

Changed the function name like

<INPUT type="checkbox" id="isGeneral" onclick="isGeneralBestPractice(this)" />

And it was working fine after that.