<?xml version="1.0" encoding="utf-8"?>
<Report ScriptLanguage="CSharp" ReportInfo.Created="12/16/2016 09:45:09" ReportInfo.Modified="04/03/2018 13:59:55" ReportInfo.CreatorVersion="2016.1.0.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 System.Data.SqlClient;
using FastReport;
using FastReport.Data;
using FastReport.Dialog;
using FastReport.Barcode;
using FastReport.Table;
using FastReport.Utils;

namespace FastReport
{
  public class ReportScript
  {
    public   int x=1; 
    private void Table2_ManualBuild(object sender, EventArgs e)
    {
      DataSourceBase rowData = Report.GetDataSource(&quot;sys_salesProducts&quot;);
      rowData.Init();
      
  
      Table2.PrintRow(0);
      Table2.PrintColumns();
      Table2.PrintRow(1);
      Table2.PrintColumns();
      x=1; 
      while (rowData.HasMoreRows)
      {
        Table2.PrintRow(2);
        Table2.PrintColumns();
        rowData.Next();
        x++;
      }
      Table2.PrintRow(3);
      Table2.PrintColumns();
      
     
    }

 

    private void ReportTitle1_AfterData(object sender, EventArgs e)
    {
      
    }
    
    

   
  }
}
</ScriptText>
  <Dictionary>
    <MsSqlDataConnection ConnectionString="rijcmlqLrsFCkq0pbnlrNLcvFVkCVz36UnLxRHvgKV5wrWz7Lvg1IFOQ9D9BrCqMoSCZSFsH4ojIy4nLXCN88PM+DUOuI0OzfGIQHMJPhtVMNqtlSG3BfpPatnrQVr91HI8qUh3dD8AYiq4uvxnq/FIfd6+dP2gj96o5lQdN+6U0jxEOgo=">
      <TableDataSource Name="sys_sales" DataType="System.Int32" Enabled="true" TableName="sys_sales" SelectCommand="SELECT S.id, S.moduleId, S.toid, S.sales_id, S.sales_time, S.sales_remark, S.sales_ChanPinZongJia, S.sales_JiaGeDiaoJian, S.sales_ShiShouJiaGe, S.sales_KeHuMingCheng, S.sales_KeHuBianHao, S.status, S.sales_WeiKuan, S.sales_payTime, S.sales_FuKuanFangShi, S.sales_JieDanYuan, S.sales_LiRun, S.sales_KeHuDengJi, S.sales_YanGuangShi, S.sales_PeiJingShi, S.sales_LiPin, S.sales_ZheKou&#13;&#10;FROM &quot;sys_sales&quot; S where S.id =  @Parameter">
        <Column Name="id" DataType="System.Int32"/>
        <Column Name="moduleId" DataType="System.Int32"/>
        <Column Name="toid" DataType="System.Int32"/>
        <Column Name="sales_id" DataType="System.String"/>
        <Column Name="sales_time" DataType="System.DateTime"/>
        <Column Name="sales_remark" DataType="System.String"/>
        <Column Name="sales_ChanPinZongJia" DataType="System.Decimal"/>
        <Column Name="sales_JiaGeDiaoJian" DataType="System.Decimal"/>
        <Column Name="sales_ShiShouJiaGe" DataType="System.Decimal"/>
        <Column Name="sales_KeHuMingCheng" DataType="System.String"/>
        <Column Name="sales_KeHuBianHao" DataType="System.String"/>
        <Column Name="status" DataType="System.String"/>
        <Column Name="sales_WeiKuan" DataType="System.Decimal"/>
        <Column Name="sales_payTime" DataType="System.DateTime"/>
        <Column Name="sales_FuKuanFangShi" DataType="System.String"/>
        <Column Name="sales_JieDanYuan" DataType="System.String"/>
        <Column Name="sales_LiRun" DataType="System.Decimal"/>
        <Column Name="sales_KeHuDengJi" DataType="System.String"/>
        <Column Name="sales_YanGuangShi" DataType="System.String"/>
        <Column Name="sales_PeiJingShi" DataType="System.String"/>
        <Column Name="sales_LiPin" DataType="System.Decimal"/>
        <Column Name="sales_ZheKou" DataType="System.String"/>
        <CommandParameter Name="Parameter" DataType="22" Expression="[Parameter]"/>
      </TableDataSource>
      <TableDataSource Name="Table9" Alias="sys_user" DataType="System.Int32" Enabled="true" SelectCommand="SELECT [information_MingCheng]&#13;&#10;      ,[title]&#13;&#10;      ,[information_LianXiDianHua]&#13;&#10;      ,[information_LianXiDiZhi]&#13;&#10;      ,[companyName],[information_FuKuanFangShi]&#13;&#10;  FROM [sys_information]">
        <Column Name="information_MingCheng" DataType="System.String"/>
        <Column Name="title" DataType="System.String"/>
        <Column Name="information_LianXiDianHua" DataType="System.String"/>
        <Column Name="information_LianXiDiZhi" DataType="System.String"/>
        <Column Name="companyName" DataType="System.String"/>
        <Column Name="information_FuKuanFangShi" DataType="System.String"/>
      </TableDataSource>
      <TableDataSource Name="Table10" Alias="sys_optometry" DataType="System.Int32" Enabled="true" SelectCommand="SELECT S.id, S.moduleId, S.toid, S.Optometry_YanGuangShi, S.Optometry_YanGuangDan, S.Optometry_YanGuangShiJian, s1.id, s1.sales_KeHuBianHao, s2.id, s2.Clients_Number&#13;&#10;FROM &quot;sys_optometry&quot; S, &quot;sys_sales&quot; s1, &quot;sys_clients&quot; s2 where s1.id =  @Parameter and s2.Clients_Number = s1.sales_KeHuBianHao and s.toid = s2.id order by s.id desc">
        <Column Name="id" DataType="System.Int32"/>
        <Column Name="moduleId" DataType="System.Int32"/>
        <Column Name="toid" DataType="System.Int32"/>
        <Column Name="Optometry_YanGuangShi" DataType="System.String"/>
        <Column Name="Optometry_YanGuangDan" DataType="System.String"/>
        <Column Name="Optometry_YanGuangShiJian" DataType="System.DateTime"/>
        <Column Name="id1" DataType="System.Int32"/>
        <Column Name="sales_KeHuBianHao" DataType="System.String"/>
        <Column Name="id2" DataType="System.Int32"/>
        <Column Name="Clients_Number" DataType="System.String"/>
        <CommandParameter Name="Parameter" DataType="22" Expression="[Parameter]"/>
      </TableDataSource>
      <TableDataSource Name="Table" Alias="sys_salesProducts" DataType="System.Int32" Enabled="true" SelectCommand="SELECT S.id, S.moduleId, S.toid, S.prod_id, S.salesproducts_ChanPinMingCheng, S.salesproducts_DanJia, S.salesproducts_ShuLiang, S.salesproducts_ZongJia, S.salesproducts_FenLei, S.salesproducts_BeiZhu, S.salesproducts_KaiGongShiJian, S.salesproducts_WanGongShiJian, S.salesproducts_ShiGongRenYuan, S.salesproducts_PinPai, S.salesproducts_GuiGe, S.sales_TianJiaShiJian, S.type, S.checkList_PanYingPanKui, S.sales_LingQuRen, S.sales_LingQuShiJian, S.purchaseList_ShouJia, S.salesproducts_LiPin, S.sales_DuiYingDingDanHao&#13;&#10;FROM &quot;sys_salesProducts&quot; S where s.toid = @Parameter&#13;&#10;">
        <Column Name="id" DataType="System.Int32"/>
        <Column Name="moduleId" DataType="System.Int32"/>
        <Column Name="toid" DataType="System.Int32"/>
        <Column Name="prod_id" DataType="System.String"/>
        <Column Name="salesproducts_ChanPinMingCheng" DataType="System.String"/>
        <Column Name="salesproducts_DanJia" DataType="System.Decimal"/>
        <Column Name="salesproducts_ShuLiang" DataType="System.Int32"/>
        <Column Name="salesproducts_ZongJia" DataType="System.Decimal"/>
        <Column Name="salesproducts_FenLei" DataType="System.String"/>
        <Column Name="salesproducts_BeiZhu" DataType="System.String"/>
        <Column Name="salesproducts_KaiGongShiJian" DataType="System.String"/>
        <Column Name="salesproducts_WanGongShiJian" DataType="System.String"/>
        <Column Name="salesproducts_ShiGongRenYuan" DataType="System.String"/>
        <Column Name="salesproducts_PinPai" DataType="System.String"/>
        <Column Name="salesproducts_GuiGe" DataType="System.String"/>
        <Column Name="sales_TianJiaShiJian" DataType="System.DateTime"/>
        <Column Name="type" DataType="System.Int32"/>
        <Column Name="checkList_PanYingPanKui" DataType="System.String"/>
        <Column Name="sales_LingQuRen" DataType="System.String"/>
        <Column Name="sales_LingQuShiJian" DataType="System.String"/>
        <Column Name="purchaseList_ShouJia" DataType="System.Decimal"/>
        <Column Name="salesproducts_LiPin" DataType="System.String"/>
        <Column Name="sales_DuiYingDingDanHao" DataType="System.String"/>
        <CommandParameter Name="Parameter" DataType="22" Expression="[Parameter]"/>
      </TableDataSource>
    </MsSqlDataConnection>
    <Parameter Name="Parameter" DataType="System.String"/>
  </Dictionary>
  <ReportPage Name="Page1">
    <ReportTitleBand Name="ReportTitle1" Width="718.2" Height="103.95" AfterDataEvent="ReportTitle1_AfterData">
      <TextObject Name="Text1" Left="9.45" Width="368.55" Height="28.35" Text="[sys_user.companyName]-销售单" VertAlign="Center" Font="微软雅黑, 18pt, style=Bold"/>
      <TextObject Name="Txt_totalPages" Left="-9450" Top="-9468.9" Width="37.8" Height="18.9" Text="第[Page#]页 共[TotalPages#]页 打印日期：[Date]" HorzAlign="Right" VertAlign="Center"/>
      <BarcodeObject Name="Barcode1" Left="510.3" Width="318.75" Height="37.8" Anchor="Top, Right" Text="[sys_sales.sales_id]" AllowExpressions="true" Barcode="Code128" Barcode.AutoEncode="true"/>
      <TextObject Name="Text40" Left="-9450" Top="-9450" Width="708.75" Height="18.9" Text="1、是否有托修人支付费用更换的旧配件：□ 旧配件已确认，并由托修方收回 □ 旧配件已确认，托修方声明放弃 □ 无旧配件" HorzAlign="Center" Font="宋体, 9pt"/>
      <TableObject Name="Table6" Left="9.45" Top="37.8" Width="689" Height="66.15" Border.Lines="All" Border.Width="2">
        <TableColumn Name="Column30"/>
        <TableColumn Name="Column31" Width="94.5"/>
        <TableColumn Name="Column32" Width="188.15"/>
        <TableColumn Name="Column33" Width="160.65"/>
        <TableColumn Name="Column34" Width="179.55"/>
        <TableRow Name="Row21" Height="22.05">
          <TableCell Name="Cell123" Border.Lines="All" Text="客户名称：" HorzAlign="Right" VertAlign="Center" Font="宋体, 9pt" ColSpan="2"/>
          <TableCell Name="Cell103" Border.Lines="All" HorzAlign="Right" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell104" Border.Lines="All" Text="[sys_sales.sales_KeHuMingCheng]" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell111" Border.Lines="All" Text="客户编号：" HorzAlign="Right" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell112" Border.Lines="All" Text="[sys_sales.sales_KeHuBianHao]" VertAlign="Center" Font="宋体, 9pt"/>
        </TableRow>
        <TableRow Name="Row22" Height="22.05">
          <TableCell Name="Cell124" Border.Lines="All" Text="客户等级：" HorzAlign="Right" VertAlign="Center" Font="宋体, 9pt" ColSpan="2"/>
          <TableCell Name="Cell106" Border.Lines="All" HorzAlign="Right" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell107" Border.Lines="All" Text="[sys_sales.sales_KeHuDengJi]" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell113" Border.Lines="All" Text="开单时间：" HorzAlign="Right" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell114" Border.Lines="All" Text="[sys_sales.sales_time]" VertAlign="Center" Font="宋体, 9pt"/>
        </TableRow>
        <TableRow Name="Row23" Height="22.05">
          <TableCell Name="Cell125" Border.Lines="All" Text="备注：" HorzAlign="Right" VertAlign="Center" Font="宋体, 9pt" ColSpan="2"/>
          <TableCell Name="Cell109" Border.Lines="All" HorzAlign="Right" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell110" Border.Lines="All" Text="[sys_sales.sales_remark]" VertAlign="Center" Font="宋体, 9pt" ColSpan="3"/>
          <TableCell Name="Cell115" Border.Lines="All" HorzAlign="Right" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell116" Border.Lines="All" VertAlign="Center" Font="宋体, 9pt"/>
        </TableRow>
      </TableObject>
    </ReportTitleBand>
    <DataBand Name="Data1" Top="107.95" Width="718.2" Height="122.85">
      <TableObject Name="Table2" Left="9.45" Top="9.45" Width="689.85" Height="113.4" Border.Lines="All" Border.Width="2" ManualBuildEvent="Table2_ManualBuild">
        <TableColumn Name="Column6"/>
        <TableColumn Name="Column7" Width="330.75"/>
        <TableColumn Name="Column8" Width="56.7"/>
        <TableColumn Name="Column9" Width="85.05"/>
        <TableColumn Name="Column10" Width="56.7"/>
        <TableColumn Name="Column11" Width="94.5"/>
        <TableRow Name="Row9" Height="28.35">
          <TableCell Name="Cell44" Text="销售清单" HorzAlign="Center" VertAlign="Center" Font="宋体, 10.5pt, style=Bold" ColSpan="6"/>
          <TableCell Name="Cell45" Font="宋体, 9pt"/>
          <TableCell Name="Cell46" Font="宋体, 9pt"/>
          <TableCell Name="Cell47" Font="宋体, 9pt"/>
          <TableCell Name="Cell48" Font="宋体, 9pt"/>
          <TableCell Name="Cell49" Font="宋体, 9pt"/>
        </TableRow>
        <TableRow Name="Row6" Height="28.35">
          <TableCell Name="Cell26" Border.Lines="All" Text="序号" HorzAlign="Center" VertAlign="Center" Font="宋体, 10.5pt, style=Bold"/>
          <TableCell Name="Cell27" Border.Lines="All" Text="项目名称" HorzAlign="Center" VertAlign="Center" Font="宋体, 10.5pt, style=Bold"/>
          <TableCell Name="Cell28" Border.Lines="All" Text="礼品" HorzAlign="Center" VertAlign="Center" Font="宋体, 10.5pt, style=Bold"/>
          <TableCell Name="Cell29" Border.Lines="All" Text="单价" HorzAlign="Center" VertAlign="Center" Font="宋体, 10.5pt, style=Bold"/>
          <TableCell Name="Cell30" Border.Lines="All" Text="数量" HorzAlign="Center" VertAlign="Center" Font="宋体, 10.5pt, style=Bold"/>
          <TableCell Name="Cell41" Border.Lines="All" Text="总价" HorzAlign="Center" VertAlign="Center" Font="宋体, 10.5pt, style=Bold"/>
        </TableRow>
        <TableRow Name="Row7" Height="37.8">
          <TableCell Name="Cell31" Border.Lines="All" Text="[x]" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell32" Border.Lines="All" Text="[sys_salesProducts.salesproducts_ChanPinMingCheng] [sys_salesProducts.salesproducts_GuiGe]" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell33" Border.Lines="All" Text="[sys_salesProducts.salesproducts_LiPin]" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell34" Border.Lines="All" Text="[sys_salesProducts.salesproducts_DanJia]" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell35" Border.Lines="All" Text="[sys_salesProducts.salesproducts_ShuLiang]" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell42" Border.Lines="All" Text="[sys_salesProducts.salesproducts_ZongJia]0" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
        </TableRow>
        <TableRow Name="Row8">
          <TableCell Name="Cell36" Border.Lines="All" Text="合计:" HorzAlign="Right" Font="宋体, 9pt" ColSpan="5"/>
          <TableCell Name="Cell37" Border.Lines="All" HorzAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell38" Border.Lines="All" HorzAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell39" Border.Lines="All" HorzAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell40" Border.Lines="All" HorzAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell43" Border.Lines="All" Text="[Sum(Cell42)]" HorzAlign="Center" Font="宋体, 9pt"/>
        </TableRow>
      </TableObject>
    </DataBand>
    <ReportSummaryBand Name="ReportSummary1" Top="234.8" Width="718.2" Height="103.95" Guides="122.85">
      <TableObject Name="Table7" Left="9.45" Width="688.74" Height="28.35">
        <TableColumn Name="Column35" Width="48.64"/>
        <TableColumn Name="Column36" Width="95.89"/>
        <TableColumn Name="Column37" Width="48.64"/>
        <TableColumn Name="Column38" Width="76.99"/>
        <TableColumn Name="Column39" Width="48.64"/>
        <TableColumn Name="Column40" Width="86.44"/>
        <TableColumn Name="Column49" Width="56.7"/>
        <TableColumn Name="Column50" Width="85.05"/>
        <TableColumn Name="Column51" Width="47.25"/>
        <TableColumn Name="Column52" Width="94.5"/>
        <TableRow Name="Row24" Height="28.35">
          <TableCell Name="Cell117" Text="优惠：" HorzAlign="Right" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell118" Text="[sys_sales.sales_JiaGeDiaoJian]" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell119" Text="折扣：" HorzAlign="Right" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell120" Text="[sys_sales.sales_ZheKou]" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell121" Text="礼品：" HorzAlign="Right" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell122" Text="[sys_sales.sales_LiPin]" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell144" Text="实收：" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell145" Text="[sys_sales.sales_ShiShouJiaGe]" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell146" Text="尾款：" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell147" Text="[sys_sales.sales_WeiKuan]" VertAlign="Center" Font="宋体, 9pt"/>
        </TableRow>
      </TableObject>
      <TableObject Name="Table4" Left="9.45" Top="37.8" Width="689.07" Height="22.05">
        <TableColumn Name="Column24" Width="94.06"/>
        <TableColumn Name="Column25" Width="137.96"/>
        <TableColumn Name="Column26" Width="99.32"/>
        <TableColumn Name="Column41" Width="131.83"/>
        <TableColumn Name="Column42" Width="94.05"/>
        <TableColumn Name="Column43" Width="131.85"/>
        <TableRow Name="Row15" MaxHeight="689.09" Height="22.05">
          <TableCell Name="Cell80" Text="销售员：" HorzAlign="Right" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell81" Text="[sys_sales.sales_JieDanYuan]" HorzAlign="Right" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell82" Text="验光师：" HorzAlign="Right" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell126" Text="[sys_sales.sales_YanGuangShi]" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell127" Text="配镜师：" HorzAlign="Right" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell128" Text="[sys_sales.sales_PeiJingShi]" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
        </TableRow>
      </TableObject>
      <TextObject Name="Text42" Left="444.15" Top="66.15" Width="94.5" Height="28.35" Text="客户签字：" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
    </ReportSummaryBand>
    <PageFooterBand Name="PageFooter1" Top="342.75" Width="718.2" Height="28.35">
      <LineObject Name="Line1" Left="9.45" Width="689.85" Anchor="Bottom, Left" Diagonal="true"/>
      <TextObject Name="Text28" Left="387.45" Top="9.45" Width="321.3" Height="18.9" Anchor="Bottom, Right" Text="第[Page#]页 共[TotalPages#]页 打印日期：[Date]" HorzAlign="Right" VertAlign="Center"/>
    </PageFooterBand>
  </ReportPage>
</Report>
