<?xml version="1.0" encoding="utf-8"?>
<Report ScriptLanguage="CSharp" ReportInfo.Created="08/20/2012 15:14:53" ReportInfo.Modified="04/15/2019 18:13:31" ReportInfo.CreatorVersion="2013.2.5.0">
  <ScriptText>using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Windows.Forms;
using System.Drawing;
using System.Data;
using FastReport;
using FastReport.Data;
using FastReport.Dialog;
using FastReport.Barcode;
using FastReport.Table;
using FastReport.Utils;

namespace FastReport
{
  public class ReportScript
  {
    public string convertToChineseMoney(decimal num)
    {
      string strChina = &quot;零壹贰叁肆伍陆柒捌玖&quot;;    //0-9所对应的汉字
      string strUnit = &quot;万仟佰拾亿仟佰拾万仟佰拾元角分&quot;; //数字位所对应的汉字
      string strSingleNum = &quot;&quot;;    //从原num值中取出的值
      string strNum = &quot;&quot;; //数字的字符串形式
      string strResult = &quot;&quot;;    //人民币大写金额形式
      string chChina = &quot;&quot;;    //数字的汉语读法
      string chUnit = &quot;&quot;;    //数字位的汉语读法
      int i;    //循环变量
      int lenth;    //num的值乘以100的字符串长度
      int nZero = 0;    //用来计算连续的零值是几个
      int temp;    //从原num值中取出的值
      num = Math.Round(Math.Abs(num), 2);    //将num取绝对值并四舍五入取2位小数
      strNum = ((long)(num * 100)).ToString();    //将num乘100并转换成字符串形式
      lenth = strNum.Length;    //找出最高位
      if (lenth &gt; 15)
      {
        return &quot;位数过大，无法转换！&quot;;
      }
      //取出对应位数的strUnit的值。如：200.55,lenth为5所以strUnit=佰拾元角分
      strUnit = strUnit.Substring(15 - lenth);
      //循环取出每一位需要转换的值
      for (i = 0; i &lt; lenth; i++)
      {
        strSingleNum = strNum.Substring(i, 1);    //取出需转换的某一位的值
        temp = Convert.ToInt32(strSingleNum);    //转换为数字
        if (i != (lenth - 3) &amp;&amp; i != (lenth - 7) &amp;&amp; i != (lenth - 11) &amp;&amp; i != (lenth - 15))
        {
          //当所取位数不为元、万、亿、万亿上的数字时
          if (strSingleNum == &quot;0&quot;)
          {
            chChina = &quot;&quot;;
            chUnit = &quot;&quot;;
            nZero = nZero + 1;
          }
          else
          {
            if (strSingleNum != &quot;0&quot; &amp;&amp; nZero != 0)
            {
              chChina = &quot;零&quot; + strChina.Substring(temp, 1);
              chUnit = strUnit.Substring(i, 1);
              nZero = 0;
            }
            else
            {
              chChina = strChina.Substring(temp, 1);
              chUnit = strUnit.Substring(i, 1);
              nZero = 0;
            }
          }
        }
        else
        {
          //该位是万亿，亿，万，元位等关键位
          if (strSingleNum != &quot;0&quot; &amp;&amp; nZero != 0)
          {
            chChina = &quot;零&quot; + strChina.Substring(temp, 1);
            chUnit = strUnit.Substring(i, 1);
            nZero = 0;
          }
          else
          {
            if (strSingleNum != &quot;0&quot; &amp;&amp; nZero == 0)
            {
              chChina = strChina.Substring(temp, 1);
              chUnit = strUnit.Substring(i, 1);
              nZero = 0;
            }
            else
            {
              if (strSingleNum == &quot;0&quot; &amp;&amp; nZero &gt;= 3)
              {
                chChina = &quot;&quot;;
                chUnit = &quot;&quot;;
                nZero = nZero + 1;
              }
              else
              {
                if (lenth &gt;= 11)
                {
                  chChina = &quot;&quot;;
                  nZero = nZero + 1;
                }
                else
                {
                  chChina = &quot;&quot;;
                  chUnit = strUnit.Substring(i, 1);
                  nZero = nZero + 1;
                }
              }
            }
          }
        }
        if (i == (lenth - 11) || i == (lenth - 3))
        {
          //如果该位是亿位或元位，则必须写上
          chUnit = strUnit.Substring(i, 1);
        }
        strResult = strResult + chChina + chUnit;
        if (i == lenth - 1 &amp;&amp; strSingleNum == &quot;0&quot;)
        {
          //最后一位（分）为0时，加上“整”
          strResult = strResult + '整';
        }
      }
      if (num == 0)
      {
        strResult = &quot;零元整&quot;;
      }
      return strResult;
    }
  }
}
</ScriptText>
  <Dictionary>
    <TableDataSource Name="收费明细情况" ReferenceName="Data.收费明细情况" DataType="System.Int32" Enabled="true">
      <Column Name="CID" DataType="System.String"/>
      <Column Name="BDATE" Alias="起始日期" DataType="System.String"/>
      <Column Name="EDATE" Alias="结束日期" DataType="System.String"/>
      <Column Name="QTY" Alias="数量" DataType="System.Decimal"/>
      <Column Name="PRICE" Alias="单价" DataType="System.Decimal"/>
      <Column Name="MONEY" Alias="金额" DataType="System.Decimal"/>
      <Column Name="QM" Alias="起码" DataType="System.Decimal"/>
      <Column Name="ZM" Alias="止码" DataType="System.Decimal"/>
      <Column Name="DESCRIPT" Alias="备注" DataType="System.String"/>
      <Column Name="FDATE" Alias="收费日期" DataType="System.String"/>
      <Column Name="CDATE" Alias="创建日期" DataType="System.String"/>
      <Column Name="PID" Alias="收费凭证号" DataType="System.String"/>
      <Column Name="FEETYPE" Alias="收费类型" DataType="System.String"/>
      <Column Name="FNAME" Alias="收费名称" DataType="System.String"/>
      <Column Name="NAME" Alias="门牌号" DataType="System.String"/>
      <Column Name="CNAME" Alias="业主姓名" DataType="System.String"/>
      <Column Name="TEL" Alias="业主电话" DataType="System.String"/>
      <Column Name="YM" DataType="System.String"/>
      <Column Name="ID" DataType="System.String"/>
      <Column Name="PLOTID" DataType="System.String"/>
      <Column Name="FID" DataType="System.String"/>
      <Column Name="BACKID" Alias="退还编号" DataType="System.String"/>
      <Column Name="YN" Alias="已收费" DataType="System.Int32"/>
      <Column Name="ZJ" DataType="System.Decimal"/>
      <Column Name="ZNJ" DataType="System.Decimal"/>
      <Column Name="AREA" DataType="System.Decimal"/>
      <Column Name="BLL" DataType="System.Decimal"/>
      <Column Name="FORMULA" DataType="System.String"/>
      <Column Name="GROUPNAME" DataType="System.String"/>
      <Column Name="GroupReport" DataType="System.String"/>
      <Column Name="METRICTYPE" DataType="System.String"/>
    </TableDataSource>
    <TableDataSource Name="查询条件" ReferenceName="Data.查询条件" DataType="System.Int32" Enabled="true">
      <Column Name="小区" DataType="System.String"/>
      <Column Name="物业类型" DataType="System.String"/>
      <Column Name="收费截止日期" DataType="System.String"/>
      <Column Name="门牌号" DataType="System.String"/>
      <Column Name="当前操作员" DataType="System.String"/>
      <Column Name="收费开始日期" DataType="System.String"/>
      <Column Name="最迟催缴日" DataType="System.String"/>
    </TableDataSource>
    <Total Name="Total" Expression="[收费明细情况.金额]+[收费明细情况.ZNJ]" Evaluator="Data1" PrintOn="GroupFooter1"/>
  </Dictionary>
  <ReportPage Name="Page1">
    <GroupHeaderBand Name="GroupHeader1" Width="718.2" Height="103.95" Condition="[收费明细情况.GroupReport]" KeepTogether="true">
      <TextObject Name="Text2" Top="75.6" Width="66.15" Height="28.35" Border.Lines="All" Text="年月" VertAlign="Center" Font="宋体, 9pt"/>
      <TextObject Name="Text4" Left="66.15" Top="75.6" Width="217.35" Height="28.35" Border.Lines="All" Text="收费名称" VertAlign="Center" Font="宋体, 9pt"/>
      <TextObject Name="Text6" Left="453.6" Top="75.6" Width="66.15" Height="28.35" Border.Lines="All" Text="数量" VertAlign="Center" Font="宋体, 9pt"/>
      <TextObject Name="Text8" Left="519.75" Top="75.6" Width="56.7" Height="28.35" Border.Lines="All" Text="单价" VertAlign="Center" Font="宋体, 9pt"/>
      <TextObject Name="Text10" Left="576.45" Top="75.6" Width="75.6" Height="28.35" Border.Lines="All" Text="金额" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
      <TextObject Name="Text12" Left="283.5" Top="75.6" Width="85.05" Height="28.35" Border.Lines="All" Text="起始" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
      <TextObject Name="Text14" Left="368.55" Top="75.6" Width="85.05" Height="28.35" Border.Lines="All" Text="结束" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
      <TextObject Name="Text15" Top="47.25" Width="529.2" Height="28.35" Text="门牌号：[收费明细情况.门牌号]  业主姓名：[收费明细情况.业主姓名]  面积：[收费明细情况.AREA]㎡  收费截止日期：[查询条件.收费截止日期]  " VertAlign="Center" Font="宋体, 9pt"/>
      <TextObject Name="Text18" Left="529.2" Top="56.7" Width="189" Height="18.9" Text="打印日期：[Date]" Font="宋体, 9pt"/>
      <TextObject Name="Text19" Left="529.2" Top="28.35" Width="189" Height="18.9" Text="打单员：[查询条件.当前操作员]" Font="宋体, 9pt"/>
      <TextObject Name="Text20" Left="151.2" Width="359.1" Height="37.8" Text="[查询条件.小区]催费单" HorzAlign="Center" VertAlign="Center" Font="宋体, 12pt, style=Bold"/>
      <TextObject Name="Text25" Left="652.05" Top="75.6" Width="66.15" Height="28.35" Border.Lines="All" Text="滞纳金" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
      <DataBand Name="Data1" Top="107.95" Width="718.2" Height="28.35" DataSource="收费明细情况">
        <TextObject Name="Text1" Width="66.15" Height="28.35" Border.Lines="All" Text="[收费明细情况.YM]" VertAlign="Center" Font="宋体, 9pt"/>
        <TextObject Name="Text3" Left="66.15" Width="217.35" Height="28.35" Border.Lines="All" Text="[IIf([收费明细情况.GROUPNAME]!=&quot;&quot;,[收费明细情况.门牌号]+[收费明细情况.收费名称],[收费明细情况.收费名称])]" VertAlign="Center" Font="宋体, 9pt"/>
        <TextObject Name="Text5" Left="453.6" Width="66.15" Height="28.35" Border.Lines="All" Text="[收费明细情况.数量]" Format="Number" Format.UseLocale="true" HorzAlign="Right" VertAlign="Center" WordWrap="false" Font="宋体, 9pt" Trimming="EllipsisCharacter"/>
        <TextObject Name="Text7" Left="519.75" Width="56.7" Height="28.35" Border.Lines="All" Text="[收费明细情况.单价]" Format="Number" Format.UseLocale="true" HorzAlign="Right" VertAlign="Center" WordWrap="false" Font="宋体, 9pt" Trimming="EllipsisCharacter"/>
        <TextObject Name="Text9" Left="576.45" Width="75.6" Height="28.35" Border.Lines="All" Text="[收费明细情况.金额]" Format="Number" Format.UseLocale="true" HorzAlign="Center" VertAlign="Center" WordWrap="false" Font="宋体, 9pt" Trimming="EllipsisCharacter"/>
        <TextObject Name="Text11" Left="283.5" Width="85.05" Height="28.35" Border.Lines="All" Text="[IIf([收费明细情况.收费类型]!=&quot;计量收费类&quot;,[收费明细情况.起始日期],[收费明细情况.起码])]" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
        <TextObject Name="Text13" Left="368.55" Width="85.05" Height="28.35" Border.Lines="All" Text="[IIf([收费明细情况.收费类型]!=&quot;计量收费类&quot;,[收费明细情况.结束日期],[收费明细情况.止码])]" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
        <TextObject Name="Text26" Left="652.05" Width="66.15" Height="28.35" Border.Lines="All" Text="[收费明细情况.ZNJ]" Format="Number" Format.UseLocale="true" HorzAlign="Center" VertAlign="Center" WordWrap="false" Font="宋体, 9pt" Trimming="EllipsisCharacter"/>
        <Sort>
          <Sort Expression="[收费明细情况.门牌号]"/>
          <Sort Expression="[收费明细情况.收费类型]"/>
          <Sort Expression="[收费明细情况.收费名称]"/>
        </Sort>
      </DataBand>
      <GroupFooterBand Name="GroupFooter1" Top="140.3" Width="718.2" Height="66.15">
        <TextObject Name="Text21" Width="576.45" Height="28.35" Border.Lines="All" Text="合计：大写（[convertToChineseMoney([Total])]）" VertAlign="Center" Font="宋体, 9pt"/>
        <TextObject Name="Text22" Left="576.45" Width="141.75" Height="28.35" Border.Lines="All" Text="[Total]" Format="Number" Format.UseLocale="true" HorzAlign="Center" VertAlign="Center" WordWrap="false" Font="宋体, 9pt" Trimming="EllipsisCharacter"/>
        <TextObject Name="Text23" Top="37.8" Width="500.85" Height="18.9" Text="备注：请您尽快来物业公司缴清所欠费用。谢谢！" Font="宋体, 9pt"/>
        <TextObject Name="Text24" Left="500.85" Top="37.8" Width="207.9" Height="18.9" HorzAlign="Right" Font="宋体, 9pt"/>
      </GroupFooterBand>
    </GroupHeaderBand>
  </ReportPage>
</Report>
