<?xml version="1.0" encoding="utf-8"?>
<Report ScriptLanguage="CSharp" ReportInfo.Created="08/20/2012 15:14:53" ReportInfo.Modified="04/23/2020 21:26:49" 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 formatUnit(string mect)
    {
      string result = &quot;&quot;;
      switch(mect)
      {
        case &quot;电表&quot;:
          result = &quot;度&quot;;
          break;
        case &quot;自来水表&quot;:
          result = &quot;吨&quot;;
          break;
        case &quot;天然气表&quot;:
          result = &quot;立方&quot;;
          break;
        case &quot;按户分摊&quot;:
          result = &quot;&quot;;
          break;
        case &quot;按面积分摊&quot;:
          result = &quot;&quot;;
          break;
        default:
          result = mect;
        break;
      }
      return result;
    }
    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" CanGrow="true" Condition="[收费明细情况.GroupReport]" KeepTogether="true">
      <TextObject Name="Text15" Top="56.7" Width="718.2" Height="47.25" CanGrow="true" Text="尊敬的[收费明细情况.门牌号]业主/客户：&#13;&#10;   [收费明细情况.GROUPNAME][收费明细情况.业主姓名]名下面积为[收费明细情况.AREA]㎡物业截至[查询条件.收费截止日期]有如下费用，敬请于[查询条件.最迟催缴日]前到物业服务中心缴纳为谢！" VertAlign="Center" Font="宋体, 9pt" LineHeight="22.68"/>
      <TextObject Name="Text18" Left="529.2" Top="37.8" Width="189" Height="18.9" Text="打印日期：[Date]" VertAlign="Center" Font="宋体, 9pt"/>
      <TextObject Name="Text19" Left="529.2" Top="18.9" Width="189" Height="18.9" Text="打单员：[查询条件.当前操作员]" VertAlign="Center" Font="宋体, 9pt"/>
      <TextObject Name="Text20" Top="18.9" Width="718.2" Height="37.8" Text="[查询条件.小区]催费单" HorzAlign="Center" VertAlign="Center" Font="宋体, 12pt, style=Bold"/>
      <DataBand Name="Data1" Top="149.75" Width="718.2" Height="28.35" DataSource="收费明细情况">
        <TextObject Name="Text3" Width="226.8" Height="28.35" Border.Lines="All" Text="[IIf([收费明细情况.GROUPNAME]!=&quot;&quot;,[收费明细情况.门牌号]+[收费明细情况.收费名称],[收费明细情况.收费名称])]" VertAlign="Center" Font="宋体, 9pt"/>
        <TextObject Name="Text5" Left="378" 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="500.85" 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="557.55" Width="94.5" 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="226.8" Width="75.6" Height="28.35" Border.Lines="All" Text="[IIf([收费明细情况.收费类型]==&quot;计量收费类&quot;,[收费明细情况.起始日期]+&quot;\r\n&quot;+[收费明细情况.起码],[收费明细情况.起始日期])]" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
        <TextObject Name="Text13" Left="302.4" Width="75.6" Height="28.35" Border.Lines="All" Text="[IIf([收费明细情况.收费类型]==&quot;计量收费类&quot;,[收费明细情况.结束日期]+&quot;\r\n&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"/>
        <TextObject Name="Text28" Left="444.15" Width="56.7" Height="28.35" Border.Lines="All" Text="[formatUnit([收费明细情况.METRICTYPE])]" Format="Number" Format.UseLocale="true" HorzAlign="Center" VertAlign="Center" WordWrap="false" Font="宋体, 9pt" Trimming="EllipsisCharacter"/>
        <DataHeaderBand Name="DataHeader1" Top="107.95" Width="718.2" Height="37.8" RepeatOnEveryPage="true">
          <TextObject Name="Text29" Left="226.8" Top="18.9" Width="75.6" Height="18.9" Border.Lines="All" Text="起" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
          <TextObject Name="Text30" Left="302.4" Top="18.9" Width="75.6" Height="18.9" Border.Lines="All" Text="止" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
          <TextObject Name="Text4" Width="226.8" Height="37.8" Border.Lines="All" Text="收费项目" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
          <TextObject Name="Text6" Left="378" Width="66.15" Height="37.8" Border.Lines="All" Text="数量" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
          <TextObject Name="Text8" Left="500.85" Width="56.7" Height="37.8" Border.Lines="All" Text="单价" VertAlign="Center" Font="宋体, 9pt"/>
          <TextObject Name="Text10" Left="557.55" Width="94.5" Height="37.8" Border.Lines="All" Text="金额" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
          <TextObject Name="Text12" Left="226.8" Width="151.2" Height="18.9" Border.Lines="All" Text="表计/周期" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
          <TextObject Name="Text25" Left="652.05" Width="66.15" Height="37.8" Border.Lines="All" Text="滞纳金" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
          <TextObject Name="Text27" Left="444.15" Width="56.7" Height="37.8" Border.Lines="All" Text="单位" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
        </DataHeaderBand>
        <Sort>
          <Sort Expression="[收费明细情况.门牌号]"/>
          <Sort Expression="[收费明细情况.收费类型]"/>
          <Sort Expression="[收费明细情况.收费名称]"/>
        </Sort>
      </DataBand>
      <GroupFooterBand Name="GroupFooter1" Top="182.1" Width="718.2" Height="94.5">
        <TextObject Name="Text21" Width="557.55" Height="28.35" Border.Lines="All" Text="合计：大写（[convertToChineseMoney([Total])]）" VertAlign="Center" Font="宋体, 9pt"/>
        <TextObject Name="Text22" Left="557.55" Width="160.65" 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" Text="新思维物业" HorzAlign="Right" Font="宋体, 9pt"/>
      </GroupFooterBand>
    </GroupHeaderBand>
  </ReportPage>
</Report>
