<?xml version="1.0" encoding="utf-8"?>
<Report ScriptLanguage="CSharp" ReportInfo.Created="04/27/2014 12:39:39" ReportInfo.Modified="04/11/2017 10:40:12" ReportInfo.CreatorVersion="2014.3.1.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 int AmtLength = 2;
    public int PriceLength = 2;
    public int QtyLength = 2;
    public string ToUpper(string m)
    {       
      string cm;
      if(m==&quot;&quot;)
      {
        cm=&quot;0&quot;;
      }
      else
      {
        cm=m;
      }
      Decimal d=decimal.Parse(cm);
      if (d == 0)
        return &quot;零元整&quot;;

      string je = d.ToString(&quot;####.00&quot;);
      if (je.Length &gt; 15)
        return &quot;&quot;;
      je = new String('0', 15 - je.Length) + je; //若小于15位长，前面补0 

      string stry = je.Substring(0, 4); //取得 '亿 '单元 
      string strw = je.Substring(4, 4); //取得 '万 '单元 
      string strg = je.Substring(8, 4); //取得 '元 '单元 
      string strf = je.Substring(13, 2); //取得小数部分 

      string str1 = &quot;&quot;;
      string str2 = &quot;&quot;;
      string str3 = &quot;&quot;;

      str1 = this.getupper(stry, &quot;亿&quot;); //亿单元的大写 
      str2 = this.getupper(strw, &quot;万&quot;); //万单元的大写 
      str3 = this.getupper(strg, &quot;元&quot;); //元单元的大写 


      string str_y = &quot;&quot;;
      string str_w = &quot;&quot;;
      if (je[3] == '0' || je[4] == '0') //亿和万之间是否有0 
        str_y = &quot;零&quot;;
      if (je[7] == '0' || je[8] == '0') //万和元之间是否有0 
        str_w = &quot;零&quot;;


      string ret = str1 + str_y + str2 + str_w + str3; //亿，万，元的三个大写合并 

      for (int i = 0; i &lt; ret.Length; i++) //去掉前面的 &quot;零 &quot; 
      {
        if (ret[i] != '零')
        {
          ret = ret.Substring(i);
          break;
        }

      }
      for (int i = ret.Length - 1; i &gt; -1; i--) //去掉最后的 &quot;零 &quot; 
      {
        if (ret[i] != '零')
        {
          ret = ret.Substring(0, i + 1);
          break;
        }
      }

      if (ret[ret.Length - 1] != '元') //若最后不位不是 '元 '，则加一个 '元 '字 
        ret = ret + &quot;元&quot;;

      if (ret == &quot;零零元&quot;) //若为零元，则去掉 &quot;元数 &quot;，结果只要小数部分 
        ret = &quot;&quot;;

      if (strf == &quot;00&quot;) //下面是小数部分的转换 
      {
        ret = ret + &quot;整&quot;;
      }
      else
      {
        string tmp = &quot;&quot;;
        tmp = this.getint(strf[0]);
        if (tmp == &quot;零&quot;)
          ret = ret + tmp;
        else
          ret = ret + tmp + &quot;角&quot;;

        tmp = this.getint(strf[1]);
        if (tmp == &quot;零&quot;)
          ret = ret + &quot;整&quot;;
        else
          ret = ret + tmp + &quot;分&quot;;
      }

      if (ret[0] == '零')
      {
        ret = ret.Substring(1); //防止0.03转为 &quot;零叁分 &quot;，而直接转为 &quot;叁分 &quot; 
      }

      return ret; //完成，返回 


    }

    private string getupper(string str, string strDW)
    {
      if (str == &quot;0000&quot;)
        return &quot;&quot;;

      string ret = &quot;&quot;;
      string tmp1 = this.getint(str[0]);
      string tmp2 = this.getint(str[1]);
      string tmp3 = this.getint(str[2]);
      string tmp4 = this.getint(str[3]);
      if (tmp1 != &quot;零&quot;)
      {
        ret = ret + tmp1 + &quot;仟&quot;;
      }
      else
      {
        ret = ret + tmp1;
      }

      if (tmp2 != &quot;零&quot;)
      {
        ret = ret + tmp2 + &quot;佰&quot;;
      }
      else
      {
        if (tmp1 != &quot;零&quot;) //保证若有两个零 '00 '，结果只有一个零，下同 
          ret = ret + tmp2;
      }

      if (tmp3 != &quot;零&quot;)
      {
        ret = ret + tmp3 + &quot;拾&quot;;
      }
      else
      {
        if (tmp2 != &quot;零&quot;)
          ret = ret + tmp3;
      }

      if (tmp4 != &quot;零&quot;)
      {
        ret = ret + tmp4;
      }

      if (ret[0] == '零') //若第一个字符是 '零 '，则去掉 
        ret = ret.Substring(1);
      if (ret[ret.Length - 1] == '零') //若最后一个字符是 '零 '，则去掉 
        ret = ret.Substring(0, ret.Length - 1);

      return ret + strDW; //加上本单元的单位
    }

    /// &lt;summary&gt; 
    /// 单个数字转为大写 
    /// &lt;/summary&gt; 
    /// &lt;param name= &quot;c &quot;&gt; 小写阿拉伯数字 0---9 &lt;/param&gt; 
    /// &lt;returns&gt; 大写数字 &lt;/returns&gt; 
    private string getint(char c)
    {
      string str = &quot;&quot;;
      switch (c)
      {
        case '0':
          str = &quot;零&quot;;
          break;
        case '1':
          str = &quot;壹&quot;;
          break;
        case '2':
          str = &quot;贰&quot;;
          break;
        case '3':
          str = &quot;叁&quot;;
          break;
        case '4':
          str = &quot;肆&quot;;
          break;
        case '5':
          str = &quot;伍&quot;;
          break;
        case '6':
          str = &quot;陆&quot;;
          break;
        case '7':
          str = &quot;柒&quot;;
          break;
        case '8':
          str = &quot;捌&quot;;
          break;
        case '9':
          str = &quot;玖&quot;;
          break;
      }
      return str;
    }
    public  void SetPageRowCount(DataBand data, int pageRowCount)
    {
      TableDataSource table = (TableDataSource)data.DataSource;
      table.Table.PrimaryKey = null;
      for(int i=0;i&lt;table.Table.Columns.Count;i++)
      {
        table.Table.Columns[i].AllowDBNull = true;
      }
      while(table.Table.Rows.Count%pageRowCount!=0)
      {
        DataRow row = table.Table.NewRow();
        table.Table.Rows.Add(row);
      }
    }
    public double FormatToDouble(object vText)
    {
      if (vText == null || vText.ToString() == &quot;&quot; || vText.ToString() == &quot;-&quot; || vText.ToString() == &quot;.&quot;)
        return 0;
      else
      {
        try
        {
          return double.Parse(vText.ToString());
        }
        catch
        {
          return 0;
        }
      }
    }
  }
}
</ScriptText>
  <Dictionary>
    <TableDataSource Name="main" ReferenceName="Data.main" DataType="System.Int32" Enabled="true">
      <Column Name="单号" DataType="System.String"/>
      <Column Name="经办人" Alias="经手人" 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"/>
      <Column Name="自定义" DataType="System.String"/>
      <Column Name="自定义1" DataType="System.String"/>
      <Column Name="自定义2" DataType="System.String"/>
      <Column Name="制单人" DataType="System.String"/>
      <Column Name="时间" DataType="System.String"/>
    </TableDataSource>
    <TableDataSource Name="item" ReferenceName="Data.item" DataType="System.Int32" Enabled="true">
      <Column Name="条形码" DataType="System.String"/>
      <Column Name="称重码" DataType="System.String"/>
      <Column Name="自定义" DataType="System.String"/>
      <Column Name="自定义1" DataType="System.String"/>
      <Column Name="单位" DataType="System.String"/>
      <Column Name="单价" DataType="System.String"/>
      <Column Name="金额" DataType="System.Decimal"/>
      <Column Name="生产日期" DataType="System.String"/>
      <Column Name="自定义2" DataType="System.String"/>
      <Column Name="备注" DataType="System.String"/>
      <Column Name="货品编号" DataType="System.String"/>
      <Column Name="货品名称" DataType="System.String"/>
      <Column Name="数量" DataType="System.Decimal"/>
      <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>
    <TableDataSource Name="comp" ReferenceName="Data.comp" 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"/>
      <Column Name="地址" DataType="System.String"/>
      <Column Name="备注" DataType="System.String"/>
    </TableDataSource>
    <Total Name="数量合计" Expression="[item.数量]" Evaluator="Data1"/>
  </Dictionary>
  <ReportPage Name="Page1">
    <ReportTitleBand Name="ReportTitle1" Width="718.2" Height="105.95">
      <TextObject Name="Text20" Left="19.35" Top="4.45" Width="642.6" Height="22.68" Text="[comp.公司名称]" HorzAlign="Center" VertAlign="Center" Font="宋体, 12pt, style=Bold"/>
      <TextObject Name="Text1" Left="19.35" Top="28.35" Width="642.6" Height="28.35" Text="调拨单" HorzAlign="Center" VertAlign="Center" Font="宋体, 11pt, style=Bold"/>
      <TextObject Name="Text5" Left="85.5" Top="46.25" Width="141.75" Height="18.9" Text="[main.单号]" VertAlign="Center" Font="宋体, 11pt"/>
      <TextObject Name="Text42" Left="18.45" Top="46.25" Width="75.6" Height="18.9" Text="单号：" HorzAlign="Right" VertAlign="Center" Font="宋体, 11pt"/>
      <TextObject Name="Text43" Left="604.25" Top="46.25" Width="94.5" Height="18.9" Text="[main.时间]" VertAlign="Center" Font="宋体, 11pt"/>
      <TextObject Name="Text44" Left="567.45" Top="46.25" Width="75.6" Height="18.9" Text="日期：" VertAlign="Center" Font="宋体, 11pt"/>
      <TextObject Name="Text2" Left="1.45" Top="65.15" Width="94.5" Height="22.68" Text="出货仓库：" HorzAlign="Right" VertAlign="Center" Font="宋体, 11pt"/>
      <TextObject Name="Text3" Left="85.5" Top="65.15" Width="217.35" Height="22.68" Text="[main.调出仓库]" VertAlign="Center" Font="宋体, 11pt"/>
      <TextObject Name="Text54" Left="85.5" Top="87.05" Width="614.25" Height="18.9" Text="[main.备注]" VertAlign="Center" Font="宋体, 11pt"/>
      <TextObject Name="Text55" Left="42.7" Top="87.05" Width="94.5" Height="18.9" Text="备注：" VertAlign="Center" Font="宋体, 11pt"/>
      <TextObject Name="Text56" Left="275.5" Top="65.15" Width="94.5" Height="22.68" Text="收货仓库：" VertAlign="Center" Font="宋体, 11pt"/>
      <TextObject Name="Text57" Left="341.2" Top="65.15" Width="217.35" Height="22.68" Text="[main.调入仓库]" VertAlign="Center" Font="宋体, 11pt"/>
    </ReportTitleBand>
    <PageHeaderBand Name="PageHeader1" Top="109.95" Width="718.2" Height="30.24" Guides="0">
      <TextObject Name="Text7" Left="42.8" Width="103.95" Height="30.24" Border.Lines="All" Text="货品编号" AutoShrink="FontSize" HorzAlign="Center" VertAlign="Center" Font="宋体, 11pt"/>
      <TextObject Name="Text9" Left="146.75" Width="103.95" Height="30.24" Border.Lines="All" Text="货品名称" AutoShrink="FontSize" HorzAlign="Center" VertAlign="Center" Font="宋体, 11pt"/>
      <TextObject Name="Text11" Left="250.7" Width="75.6" Height="30.24" Border.Lines="All" Text="规格" AutoShrink="FontSize" HorzAlign="Center" VertAlign="Center" Font="宋体, 11pt"/>
      <TextObject Name="Text13" Left="326.3" Width="56.7" Height="30.24" Border.Lines="All" Text="单位" AutoShrink="FontSize" HorzAlign="Center" VertAlign="Center" Font="宋体, 11pt"/>
      <TextObject Name="Text19" Left="383" Width="75.6" Height="30.24" Border.Lines="All" Text="调出数量" AutoShrink="FontSize" HorzAlign="Center" VertAlign="Center" Font="宋体, 11pt"/>
      <TextObject Name="Text49" Left="535.2" Width="178.79" Height="30.24" Border.Lines="All" Text="备注" Format="Number" Format.UseLocale="true" AutoShrink="FontSize" HorzAlign="Center" VertAlign="Center" WordWrap="false" Font="宋体, 11pt" LineHeight="11.34"/>
      <TextObject Name="Text51" Left="459.3" Width="75.6" Height="30.24" Border.Lines="All" Text="批号" AutoShrink="FontSize" HorzAlign="Center" VertAlign="Center" Font="宋体, 11pt"/>
      <TextObject Name="Text58" Left="5" Width="37.8" Height="30.24" Border.Lines="All" Text="序号" AutoShrink="FontSize" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
    </PageHeaderBand>
    <DataBand Name="Data1" Top="144.19" Width="718.2" Height="30.24" DataSource="item">
      <TextObject Name="Text6" Left="43.25" Width="103.95" Height="30.24" Border.Lines="All" Text="[item.货品编号]" AutoShrink="FontSize" HorzAlign="Center" VertAlign="Center" Font="宋体, 11pt"/>
      <TextObject Name="Text8" Left="147.2" Width="103.95" Height="30.24" Border.Lines="All" Text="[item.货品名称]" AutoShrink="FontSize" HorzAlign="Center" VertAlign="Center" Font="宋体, 11pt"/>
      <TextObject Name="Text10" Left="251.15" Width="75.6" Height="30.24" Border.Lines="All" Text="[item.货品规格]" AutoShrink="FontSize" HorzAlign="Center" VertAlign="Center" Font="宋体, 11pt"/>
      <TextObject Name="Text12" Left="326.75" Width="56.7" Height="30.24" Border.Lines="All" Text="[item.单位]" AutoShrink="FontSize" HorzAlign="Center" VertAlign="Center" Font="宋体, 11pt"/>
      <TextObject Name="Text14" Left="383.45" Width="75.6" Height="30.24" Border.Lines="All" Text="[item.数量]" AutoShrink="FontSize" HorzAlign="Center" VertAlign="Center" Font="宋体, 11pt"/>
      <TextObject Name="Text17" Left="534.65" Width="179.55" Height="30.24" Border.Lines="All" Text="[item.备注]" AutoShrink="FontSize" HorzAlign="Center" VertAlign="Center" Font="宋体, 11pt"/>
      <TextObject Name="Text50" Left="459.4" Width="75.6" Height="30.24" Border.Lines="All" Text="[item.批次]" AutoShrink="FontSize" HorzAlign="Center" VertAlign="Center" Font="宋体, 11pt"/>
      <TextObject Name="Text59" Left="5.45" Width="37.8" Height="30.24" Border.Lines="All" Text="[Row#]" AutoShrink="FontSize" HorzAlign="Center" VertAlign="Center" Font="宋体, 11pt"/>
    </DataBand>
    <ReportSummaryBand Name="ReportSummary1" Top="178.43" Width="718.2" Height="66.25">
      <TextObject Name="Text35" Left="5.45" Top="0.1" Width="37.8" Height="30.24" Border.Lines="All" Text="合计" AutoShrink="FontSize" VertAlign="Center" Font="宋体, 9pt" LineHeight="11.34"/>
      <TextObject Name="Text41" Left="43.25" Top="0.1" Width="670.95" Height="30.24" Border.Lines="All" Text="[数量合计]" Format="Number" Format.UseLocale="true" AutoShrink="FontSize" VertAlign="Center" Font="宋体, 11pt" LineHeight="11.34"/>
      <TextObject Name="Text62" Left="7.45" Top="40.35" Width="85.05" Height="18.9" Text="经手人：" VertAlign="Center" Font="宋体, 11pt"/>
      <TextObject Name="Text63" Left="54.7" Top="40.35" Width="113.4" Height="18.9" Text="[main.经手人]" VertAlign="Center" Font="宋体, 11pt"/>
      <TextObject Name="Text64" Left="177.55" Top="40.35" Width="85.05" Height="18.9" Text="制单人：" VertAlign="Center" Font="宋体, 11pt"/>
      <TextObject Name="Text65" Left="234.25" Top="40.35" Width="103.95" Height="18.9" Text="[main.制单人]" VertAlign="Center" Font="宋体, 11pt"/>
      <TextObject Name="Text66" Left="372" Top="40.35" Width="85.05" Height="18.9" Text="审核人：" VertAlign="Center" Font="宋体, 11pt"/>
      <TextObject Name="Text67" Left="427.7" Top="40.35" Width="94.5" Height="18.9" Text="[main.审核人]" VertAlign="Center" Font="宋体, 11pt"/>
      <TextObject Name="Text68" Left="546.1" Top="40.35" Width="85.05" Height="18.9" Text="审核时间：" VertAlign="Center" Font="宋体, 11pt"/>
      <TextObject Name="Text69" Left="616.25" Top="40.35" Width="94.5" Height="18.9" Text="[main.审核时间]" VertAlign="Center" Font="宋体, 11pt"/>
    </ReportSummaryBand>
    <PageFooterBand Name="PageFooter1" Top="248.68" Width="718.2" Height="18.9"/>
  </ReportPage>
</Report>
