In this post, I will explain how to dynamically change decimal places in Crystal Report. To explain this I have created a sample table and sample crystal report in my example.
tbl_Sample contains a column id, decimalPlaces and Amount.
I want to format the Amount in crystal report as per the value of decimalPlaces. If decimalPlaces value is 3 then formatted Amount will be 123.256.
In the sample crystal report I added tbl_Sample as Datasource and designed crystal report as per below image.
Steps to Dynamically change decimal places in Crystal Report
1. Right click on "Amount"
2. On "Format Editor" window, click "Customize" button
3. On "Custom Style" window, Click "X2" in front of Decimals
4. On "Format Formula Editor" window, drag decimalPlaces field from report field to editor and click "Save and close" button
5. Back on "Custom Style" window, Click "X2" in front of Rounding
6. On "Format Formula Editor" window, drag decimalPlaces field from report field to editor and click "Save and close" button
After doing all these changes to Amount field you will get a below result
0 comments:
Post a Comment
Please do not enter any spam link in the message box.