资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

FastReport中怎么定义报表大写金额

这篇文章给大家介绍FastReport中怎么定义报表大写金额,内容非常详细,感兴趣的小伙伴们可以参考借鉴,希望对大家能有所帮助。

成都创新互联公司是一家朝气蓬勃的网站建设公司。公司专注于为企业提供信息化建设解决方案。从事网站开发,网站制作,网站设计,网站模板,微信公众号开发,软件开发,微信平台小程序开发,10余年建站对PVC花箱等多个领域,拥有丰富的网站制作经验。

我们在设计FastReport报表时,遇到客户有可能需要显示的是大写金额,可以用如下方法设计报表解决.

首先要改为大写金额的用[tt]做为变量定义

FastReport中怎么定义报表大写金额

然后在文本编辑器里写代码

FastReport中怎么定义报表大写金额

代码:

begin
  qianwei:=-2;
  Smallmonth:=formatfloat('0.00',[QueryBody."iamt"]);
  dianweizhi :=pos('.',Smallmonth);
  tt :='';
  BigMonth:='';
  qian:=length(Smallmonth);
  while qian>0 do
  begin
    if qian<>dianweizhi then
    begin
      i:=copy(Smallmonth,qian,1);
      if i='1' then wei1:='壹'
      else if i='2' then wei1:='贰'
      else if i='3' then wei1:='叁'
      else if i='4' then wei1:='肆'
      else if i='5' then wei1:='伍'
      else if i='6' then wei1:='陆'
      else if i='7' then wei1:='柒'
      else if i='8' then wei1:='捌'
      else if i='9' then wei1:='玖'
      else if i='0' then wei1:='零';
      if qianwei=-3      then  qianwei1:='厘'
      else if qianwei=-2 then  qianwei1:='分'
      else if qianwei=-1 then  qianwei1:='角'
      else if qianwei=0  then  qianwei1:='元'
      else if qianwei=1  then  qianwei1:='拾'
      else if qianwei=2  then  qianwei1:='佰'
      else if qianwei=3  then  qianwei1:='千'
      else if qianwei=4  then  qianwei1:='万'
      else if qianwei=5  then  qianwei1:='拾'
      else if qianwei=6  then  qianwei1:='佰'
      else if qianwei=7  then  qianwei1:='千'
      else if qianwei=8  then  qianwei1:='亿'
      else if qianwei=9  then  qianwei1:='十'
      else if qianwei=10 then  qianwei1:='佰'
      else if qianwei=11 then  qianwei1:='千';
      inc(qianwei);
      BigMonth :=wei1+qianwei1+BigMonth;
    end;
    dec(qian);
  end;
  tt := BigMonth;
end

按照上面的办法轻松搞定.

关于FastReport中怎么定义报表大写金额就分享到这里了,希望以上内容可以对大家有一定的帮助,可以学到更多知识。如果觉得文章不错,可以把它分享出去让更多的人看到。


网站名称:FastReport中怎么定义报表大写金额
文章出自:http://cdkjz.cn/article/gogeih.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

大客户专线   成都:13518219792   座机:028-86922220