在Crystal Reports将小写货币转为大写?(未解決,再多謝100分)

apexmfg 2002-05-16 09:51:29
问题仍未解决呵,你(jdsbjcailei(基度山伯爵) )能否再帮帮(我想上传一个.rpt文件给你帮我改改,不知你是否有空帮啊,我能传到何处?),说祥细点,我的数很大啊,达到亿,再加小数3位,我从SQL的PUORDH.NET_BAL_AMT 调用数据,得到的值一般是12345678.256格式,你能否用Crystal Reports实现大小写转变,多谢

求助:在Crystal Reports如何将显示的1,235.1转为:壹仟贰佰参拾伍元壹角
即将1234567890货币数字转成大写的
那位高手能用Crystal Reports写出代码??

多谢100分!

...全文
69 23 打赏 收藏 转发到动态 举报
写回复
用AI写文章
23 条回复
切换为时间正序
请发表友善的回复…
发表回复
apexmfg 2002-05-17
  • 打赏
  • 举报
回复
问题终于解决,在此多谢有这么好的一个论坛,个个都真心助人,多谢tonyjoule(寒星㊣) . kevincomein . jdsbjcailei . B_babyface . lihonggen0 . 还有很多帮助我解决此问题的csdn高手们.特别感谢tonyjoule(寒星㊣) 2天来msn在线的无私帮助(助我编译代码,解答我的疑问等等),令我学到了很多知识,再次多谢!
周善文
寒星 2002-05-17
  • 打赏
  • 举报
回复
呵呵,兄弟取分来了。
apexmfg 2002-05-16
  • 打赏
  • 举报
回复
多谢大家帮忙,我真是感激不尽,你们来广东东莞,我一定请你去玩,要下班了,13:30分见!
kevincomein 2002-05-16
  • 打赏
  • 举报
回复
to:apexmfg() :

while length(CStr ({Voucher.Debit}))<>0 do

loop //是否用loop?

kevincomein 2002-05-16
  • 打赏
  • 举报
回复
你可以加个叁数,然后替换后付值给它
kevincomein 2002-05-16
  • 打赏
  • 举报
回复
正在想,能否告知循环结构是怎样的?
apexmfg 2002-05-16
  • 打赏
  • 举报
回复
我用的是繁体版windows,你能否帮我写成繁体的大写字,再次多谢!
apexmfg 2002-05-16
  • 打赏
  • 举报
回复
能告诉我在Crystal Report中如何调用这个dll吗?多谢了
还有,我想将此题加到200分,该如何做?
apexmfg 2002-05-16
  • 打赏
  • 举报
回复
尊敬的:tonyjoule(寒星)

你好!
你在我的问题中提到:“如果一定要在Crystal Report中解决的话,可以用VB写一个ActiveX Dll来封装此方法,然后挂到Crystal Report的Report Designer中去。这样,就可以象使用Crystal Report Designer自带的函数一样使用此方法。”
我想知道祥细的做法,你可以帮我做个DLL吗?能告诉我在Crystal Report中如何实现大小写货币转换吗?多谢!
周善文 2002-5-16
sparkles@163.com
apexmfg@163.net
寒星 2002-05-16
  • 打赏
  • 举报
回复
有兴趣的朋友可以通过MSN与我联系。tonyjoule@hotmail.com
寒星 2002-05-16
  • 打赏
  • 举报
回复
如果一定要在Crystal Report中解决的话,可以用VB写一个ActiveX Dll来封装此方法,然后挂到Crystal Report的Report Designer中去。这样,就可以象使用Crystal Report Designer自带的函数一样使用此方法。
lihonggen0 2002-05-16
  • 打赏
  • 举报
回复
'*********************************************************
'* 名称:nNumber2Chinese
'* 功能:数值转换为人民币(汉字)
'* 用法:nNumber2Chinese(数值)
'*********************************************************
Public Function Num2Chi(txtJE As Double) As String
Dim i, K As Integer
Dim NC, nd, ka, chrNum, strZheng As String
Dim c1, c2, c3 As String
Dim K1 As Integer
Dim Zheng As String
Dim Xiao As String
NC = Trim(Format(txtJE, "##0.00"))
c1 = "仟佰拾万仟佰拾亿仟佰拾万仟佰拾元"
c2 = "角分"
c3 = "玖捌柒陆伍肆叁贰壹"
If NC = 0 Then
Num2Chi = "零元整"
Exit Function
End If
Num2Chi = ""
Zheng = Mid(NC, 1, (Len(NC) - 3))
Xiao = Mid(NC, (Len(Zheng) + 2))
If Val(Xiao) <> 0 Then
For i = Len(Xiao) To 1 Step -1
chrNum = Mid(Xiao, i, 1)
If chrNum <> 0 Then
Num2Chi = Mid(c2, i, 1) & Num2Chi
Num2Chi = Mid(c3, (Len(c3) - chrNum + 1), 1) & Num2Chi
End If
Next i
End If

K = 0
If Val(Zheng) <> 0 Then
Num2Chi = "元" & Num2Chi
For i = Len(Zheng) To 1 Step -1
If (Len(Zheng) - i) = 4 Then
Num2Chi = "万" & Num2Chi
ElseIf (Len(Zheng) - i) = 8 Then
Num2Chi = "亿" & Num2Chi
ElseIf (Len(Zheng) - i) = 12 Then
Num2Chi = "万" & Num2Chi
End If
chrNum = Mid(Zheng, i, 1)
If chrNum <> 0 Then
If i = Len(Zheng) Then
Num2Chi = Mid(c3, (Len(c3) - chrNum + 1), 1) & Num2Chi
Else
If (Len(Zheng) - i) <> 4 And (Len(Zheng) - i) <> 8 And (Len(Zheng) - i) <> 12 Then
Num2Chi = Mid(c1, (Len(c1) - K), 1) & Num2Chi
End If
Num2Chi = Mid(c3, (Len(c3) - chrNum + 1), 1) & Num2Chi
End If
Else
If Mid(Num2Chi, 1, 1) <> "元" And Mid(Num2Chi, 1, 1) <> "万" And Mid(Num2Chi, 1, 1) <> "亿" Then
If Mid(Num2Chi, 1, 1) <> "零" Then
Num2Chi = "零" & Num2Chi
End If
End If
End If
K = K + 1
Next i
End If
If Right(Trim(Num2Chi), 1) <> "分" Then
Num2Chi = Num2Chi & "整"
End If
End Function
apexmfg 2002-05-16
  • 打赏
  • 举报
回复
up
等高手
apexmfg 2002-05-16
  • 打赏
  • 举报
回复
up
等高手
apexmfg 2002-05-16
  • 打赏
  • 举报
回复
以下是一位大哥的.pas (因急用,我暂引用,大哥体谅一下,哪位高手能将这些代码转到Crystal Reports))

unit rmb;

interface

function NumToUpper(const num:real):string;

implementation
uses SysUtils;

function NumToUpper(const num:real):string;
var aa,bb,cc:string;
bbb:array[1..16]of string;
uppna:array[0..9] of string;
i:integer;
begin

bbb[1]:='万';
bbb[2]:='仟';
bbb[3]:='佰';
bbb[4]:='拾';
bbb[5]:='亿';;
bbb[6]:='仟';;
bbb[7]:='佰';
bbb[8]:='拾';
bbb[9]:='万';
bbb[10]:='仟';
bbb[11]:='佰';
bbb[12]:='拾';
bbb[13]:='元';
bbb[14]:='.';
bbb[15]:='角';
bbb[16]:='分';
uppna[1]:='壹';
uppna[2]:='贰';
uppna[3]:='叁';
uppna[4]:='肆';
uppna[5]:='伍';
uppna[6]:='陆';
uppna[7]:='柒';
uppna[8]:='捌';
uppna[9]:='玖';
Str(num:16:2,aa);
cc:='';
bb:='';
result:='';
for i:=1 to 16 do
begin
cc:=aa[i];
if cc<>' ' then
begin
bb:=bbb[i];
if cc='0' then
cc:='零'
else
begin
if cc='.' then
begin
cc:='';
bb:='';
end
else
begin
cc:=uppna[StrToInt(cc)];
end
end;
result:=result+(cc+bb)
end;
end;
result:=result+'正';
end;

end.
apexmfg 2002-05-16
  • 打赏
  • 举报
回复
還是不行啊!
哪位高手能幫編個dll(最好是繁體的)供crystal report調用,感激不盡,分數不會少的
apexmfg@163.com
apexmfg 2002-05-16
  • 打赏
  • 举报
回复
kevincomein(白菜)
無法用啊
請收信!
apexmfg 2002-05-16
  • 打赏
  • 举报
回复
是8.5的,什么是towords(x)?
能否說說?
sunsunup 2002-05-16
  • 打赏
  • 举报
回复
你的crystal report是哪一种版本? 建議你購買8.5版或以上, 用towords(x)就解決啦.
sunsunup 2002-05-16
  • 打赏
  • 举报
回复
你的crystal report是哪一种版本? 建議你購買8.5版或以上, 用ccur(xx)就解決啦.
加载更多回复(3)

7,763

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧