.RDLC报告中的格式金额 [英] Format Amount in .RDLC Report

查看:81
本文介绍了.RDLC报告中的格式金额的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我想格式化金额,即1000000到10,00,000.

我尝试了以下方法:

格式(字段!Amount.Value,"N")

,Format(Fields!Amount.Value,#,#")

但是不起作用.

在此先感谢

Hi There Good day,

I want to format amount i.e 1000000 to 10,00,000.

I have tried the following:

Format(Fields!Amount.Value, "N")

, Format(Fields!Amount.Value, "#,#")

But Doesn''t work.

Thanks in advance

推荐答案

= Format(CDec(Amount.Value),"N")
=Format(CDec(Amount.Value),"N")


私有子工作表_Change(ByVal目标为范围)
const WS_RANGE As String ="H1:H10"''< ==更改为西装

出错时转到ws_exit
Application.EnableEvents = False

如果没有相交(目标,Me.Range(WS_RANGE)),那么
使用目标
如果为IsNumeric(.Value),则
如果.Value> 0然后
.NumberFormat ="[> = 10000000]#\,## \,## \,## 0; [> = 100000] ## \,## \,## 0; ##,## 0"
ElseIf .Value< 0然后
.NumberFormat ="[< =-10000000]-#\,## \,## \,## 0; [< =-100000]-## \,## \,## 0; ##, ## 0"
如果
结束 如果
结束 以
结尾 如果
结束
ws_exit:
Application.EnableEvents = True
结束Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "H1:H10" ''<== change to suit

On Error Goto ws_exit
Application.EnableEvents = False

If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
If IsNumeric(.Value) Then
If .Value > 0 Then
.NumberFormat = "[>=10000000]#\,##\,##\,##0;[>=100000]##\,##\,##0;##,##0"
ElseIf .Value < 0 Then
.NumberFormat = "[<=-10000000]-#\,##\,##\,##0;[<=-100000]-##\,##\,##0;##,##0"
End If
End If
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub


这篇关于.RDLC报告中的格式金额的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆