<?xml version="1.0" encoding="utf-8"?>
<Report ScriptLanguage="CSharp" ReportInfo.Created="09/30/2020 15:44:22" ReportInfo.Modified="01/06/2021 16:42:44" 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 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_InspectReportDetail&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();
    }
  }
}
</ScriptText>
  <Dictionary>
    <MsSqlDataConnection Name="Connection" ConnectionString="rijcmlqcvzGdNOg+u96xcoUUT1grzqdxrAz8HbSDdZUBMKaDTv5l6NrjQjViC6pz/aLpMBPjXdvUuSleUxF0CYtjAgcNoaXElh+tNrDlRV3S4oVWKWn/BzW32WpvGLxuCfuOVKmKCeLqehoBJCoUv4w6eRHR+SeeXYlXvukCq8vQUQD3voihFeGV+FuAuSk/0ODpYS65BScShfuy9PBDHQiNkLW/FolCJ3MnsLi1cCOy+z1hnpuNdPY5h9tsNO9J/DIke5S">
      <TableDataSource Name="sys_InspectReport" DataType="System.Int32" Enabled="true" TableName="sys_InspectReport" SelectCommand="SELECT S.id, S.moduleId, S.toid, S.audit, S.invalid,&#13;&#10; (CASE S.InspectType WHEN '成品检验' THEN '' WHEN '来料检验' THEN 'YK/ZL-ZJ-10'  ELSE '未知' END) AS Number,&#13;&#10; S.FileNum, S.ReportNum, S.ReportDate, (select top 1 Staffs_Name from sys_manager where Staffs_Number = S.Username) as Username, S.ToReportNum, S.SupNo, S.LBatchNO, S.InspectMethod, S.SampleStandard, S.AcceptStandard, S.proId, S.proName, S.Specification, S.ReportQty, S.QualifiedQty, S.UnqualifiedQty, S.TestResults, S.Measures, S.Remarks, S.CBatchNO, S.InspectType&#13;&#10;FROM &quot;sys_InspectReport&quot; S where S.id=@Parameter&#13;&#10;">
        <Column Name="id" DataType="System.Int32"/>
        <Column Name="moduleId" DataType="System.Int32"/>
        <Column Name="toid" DataType="System.Int32"/>
        <Column Name="audit" DataType="System.Boolean" BindableControl="CheckBox"/>
        <Column Name="invalid" DataType="System.Boolean" BindableControl="CheckBox"/>
        <Column Name="FileNum" DataType="System.String"/>
        <Column Name="ReportNum" DataType="System.String"/>
        <Column Name="ReportDate" DataType="System.DateTime"/>
        <Column Name="Username" DataType="System.String"/>
        <Column Name="ToReportNum" DataType="System.String"/>
        <Column Name="SupNo" DataType="System.String"/>
        <Column Name="LBatchNO" DataType="System.String"/>
        <Column Name="InspectMethod" DataType="System.String"/>
        <Column Name="SampleStandard" DataType="System.String"/>
        <Column Name="AcceptStandard" DataType="System.String"/>
        <Column Name="proId" DataType="System.String"/>
        <Column Name="proName" DataType="System.String"/>
        <Column Name="Specification" DataType="System.String"/>
        <Column Name="ReportQty" DataType="System.Int32"/>
        <Column Name="QualifiedQty" DataType="System.Int32"/>
        <Column Name="UnqualifiedQty" DataType="System.Int32"/>
        <Column Name="TestResults" DataType="System.String"/>
        <Column Name="Measures" DataType="System.String"/>
        <Column Name="Remarks" DataType="System.String"/>
        <Column Name="CBatchNO" DataType="System.String"/>
        <Column Name="InspectType" DataType="System.String"/>
        <Column Name="Number" DataType="System.String"/>
        <CommandParameter Name="Parameter" DataType="22" Expression="Parameter"/>
      </TableDataSource>
      <TableDataSource Name="sys_InspectReportDetail" DataType="System.Int32" Enabled="true" TableName="sys_InspectReportDetail" SelectCommand="SELECT S.id, S.moduleId, S.toid, S.audit, S.invalid, S.TestType, S.SampleQty, S.TestBase, S.DefectDescript, S.TestResult, S.Remarks,S.TestRecord&#13;&#10;FROM &quot;sys_InspectReportDetail&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="audit" DataType="System.Boolean" BindableControl="CheckBox"/>
        <Column Name="invalid" DataType="System.Boolean" BindableControl="CheckBox"/>
        <Column Name="TestType" DataType="System.String"/>
        <Column Name="SampleQty" DataType="System.Int32"/>
        <Column Name="TestBase" DataType="System.String"/>
        <Column Name="DefectDescript" DataType="System.String"/>
        <Column Name="TestResult" DataType="System.String"/>
        <Column Name="Remarks" DataType="System.String"/>
        <Column Name="TestRecord" DataType="System.String"/>
        <CommandParameter Name="Parameter" DataType="22" Expression="Parameter"/>
      </TableDataSource>
    </MsSqlDataConnection>
  </Dictionary>
  <ReportPage Name="Page1">
    <ReportTitleBand Name="ReportTitle1" Width="718.2" Height="207.9">
      <TextObject Name="Text1" Left="9.45" Top="-11.45" Width="699.3" Height="37.8" Text="科技有限公司" HorzAlign="Center" VertAlign="Bottom" Font="宋体, 16pt, style=Bold"/>
      <TextObject Name="Text2" Left="290.5" Top="19.35" Width="141.75" Height="37.8" Text="来料检验报告" HorzAlign="Center" VertAlign="Bottom" Font="宋体, 12pt, style=Bold"/>
      <TextObject Name="Text3" Left="9.45" Top="24.35" Width="189" Height="37.8" Text="文件编号：YK/ZL-ZJ-10" VertAlign="Bottom" Font="宋体, 9pt"/>
      <TextObject Name="Text4" Left="538.65" Top="24.35" Width="170.1" Height="37.8" Text="编号：[sys_InspectReport.FileNum]" HorzAlign="Right" VertAlign="Bottom" Font="宋体, 9pt"/>
      <TableObject Name="Table1" Left="9.45" Top="66.15" Width="699.3" Height="141.75" Border.Lines="All">
        <TableColumn Name="Column13" Width="78.75"/>
        <TableColumn Name="Column14" Width="135.45"/>
        <TableColumn Name="Column15" Width="78.75"/>
        <TableColumn Name="Column16" Width="192.15"/>
        <TableColumn Name="Column17" Width="78.75"/>
        <TableColumn Name="Column18" Width="135.45"/>
        <TableRow Name="Row13" MinHeight="28.35" Height="28.35" AutoSize="true">
          <TableCell Name="Cell107" Border.Lines="All" Text="检验日期" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell108" Border.Lines="All" Text="[sys_InspectReport.ReportDate]" Format="Date" Format.Format="d" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell109" Border.Lines="All" Text="供应商" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell110" Border.Lines="All" Text="[sys_InspectReport.SupNo]" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell111" Border.Lines="All" Text="报验单号" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell132" Border.Lines="All" Text="[sys_InspectReport.ToReportNum]" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
        </TableRow>
        <TableRow Name="Row14" MinHeight="28.35" Height="28.35" AutoSize="true">
          <TableCell Name="Cell112" Border.Lines="All" Text="物料代码" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell113" Border.Lines="All" Text="[sys_InspectReport.proId]" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell114" Border.Lines="All" Text="物料名称" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell115" Border.Lines="All" Text="[sys_InspectReport.proName]" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell116" Border.Lines="All" Text="规格型号" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell133" Border.Lines="All" Text="[sys_InspectReport.Specification]" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
        </TableRow>
        <TableRow Name="Row15" MinHeight="28.35" Height="28.35" AutoSize="true">
          <TableCell Name="Cell117" Border.Lines="All" Text="报捡数量" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell118" Border.Lines="All" Text="[sys_InspectReport.ReportQty]" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell119" Border.Lines="All" Text="合格数量" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell120" Border.Lines="All" Text="[sys_InspectReport.QualifiedQty]" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell121" Border.Lines="All" Text="不合格数" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell134" Border.Lines="All" Text="[sys_InspectReport.UnqualifiedQty]" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
        </TableRow>
        <TableRow Name="Row16" MinHeight="28.35" Height="28.35" AutoSize="true">
          <TableCell Name="Cell122" Border.Lines="All" Text="批号" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell123" Border.Lines="All" Text="[sys_InspectReport.ReportNum]" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell124" Border.Lines="All" Text="检验方式" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell125" Border.Lines="All" Text="[sys_InspectReport.InspectType]" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell126" Border.Lines="All" Text="抽样标准" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell135" Border.Lines="All" Text="[sys_InspectReport.SampleStandard]" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
        </TableRow>
        <TableRow Name="Row17" MinHeight="28.35" Height="28.35" AutoSize="true">
          <TableCell Name="Cell127" Border.Lines="All" Text="验收标准" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell128" Border.Lines="All" Text="[sys_InspectReport.AcceptStandard]" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt" ColSpan="5"/>
          <TableCell Name="Cell129" Border.Lines="All" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell130" Border.Lines="All" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell131" Border.Lines="All" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell136" Border.Lines="All" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
        </TableRow>
      </TableObject>
    </ReportTitleBand>
    <DataBand Name="Data1" Top="211.9" Width="718.2" Height="85.05" CanGrow="true">
      <TableObject Name="Table2" Left="9.45" Width="699.3" Height="85.05" Border.Lines="All" ManualBuildEvent="Table2_ManualBuild">
        <TableColumn Name="Column19" Width="62.1"/>
        <TableColumn Name="Column20" Width="71.55"/>
        <TableColumn Name="Column21" Width="118.8"/>
        <TableColumn Name="Column22" Width="90.45"/>
        <TableColumn Name="Column23" Width="118.8"/>
        <TableColumn Name="Column24" Width="118.8"/>
        <TableColumn Name="Column25" Width="118.8"/>
        <TableRow Name="Row18" Height="28.35">
          <TableCell Name="Cell137" Border.Lines="All" Text="检验记录" HorzAlign="Center" VertAlign="Center" Font="宋体, 11pt, style=Bold" ColSpan="7"/>
          <TableCell Name="Cell138" Border.Lines="All" Font="宋体, 9pt"/>
          <TableCell Name="Cell139" Border.Lines="All" Font="宋体, 9pt"/>
          <TableCell Name="Cell140" Border.Lines="All" Font="宋体, 9pt"/>
          <TableCell Name="Cell141" Border.Lines="All" Font="宋体, 9pt"/>
          <TableCell Name="Cell152" Border.Lines="All" Font="宋体, 9pt"/>
          <TableCell Name="Cell153" Border.Lines="All" Font="宋体, 9pt"/>
        </TableRow>
        <TableRow Name="Row19" Height="28.35">
          <TableCell Name="Cell142" Border.Lines="All" Text="检验项目" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell143" Border.Lines="All" Text="抽样数量" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell144" Border.Lines="All" Text="检验依据" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell145" Border.Lines="All" Text="缺陷描述" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell146" Border.Lines="All" Text="检验记录" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell154" Border.Lines="All" Text="检验结果" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell155" Border.Lines="All" Text="备注" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
        </TableRow>
        <TableRow Name="Row20" MinHeight="28.35" Height="28.35" AutoSize="true">
          <TableCell Name="Cell147" Border.Lines="All" Text="[sys_InspectReportDetail.TestType]" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell148" Border.Lines="All" Text="[sys_InspectReportDetail.SampleQty]" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell149" Border.Lines="All" Text="[sys_InspectReportDetail.TestBase]" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell150" Border.Lines="All" Text="[sys_InspectReportDetail.DefectDescript]" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell151" Border.Lines="All" Text="[sys_InspectReportDetail.TestRecord]" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell156" Border.Lines="All" Text="[sys_InspectReportDetail.TestResult]" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell157" Border.Lines="All" Text="[sys_InspectReportDetail.Remarks]" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
        </TableRow>
      </TableObject>
    </DataBand>
    <ReportSummaryBand Name="ReportSummary1" Top="300.95" Width="718.2" Height="170.1">
      <TableObject Name="Table3" Left="9.45" Width="699.29" Height="170.1" Border.Lines="All">
        <TableColumn Name="Column26" Width="133.43"/>
        <TableColumn Name="Column27" Width="139.86"/>
        <TableColumn Name="Column28" Width="143.26"/>
        <TableColumn Name="Column29" Width="142.88"/>
        <TableColumn Name="Column30" Width="139.86"/>
        <TableRow Name="Row21" Height="28.35">
          <TableCell Name="Cell158" Border.Lines="Bottom" Text="合计" HorzAlign="Center" VertAlign="Bottom" Font="宋体, 11pt, style=Bold" ColSpan="5"/>
          <TableCell Name="Cell159" Border.Lines="Bottom" Font="宋体, 9pt"/>
          <TableCell Name="Cell160" Border.Lines="Bottom" Font="宋体, 9pt"/>
          <TableCell Name="Cell161" Border.Lines="Bottom" Font="宋体, 9pt"/>
          <TableCell Name="Cell162" Border.Lines="Bottom" Font="宋体, 9pt"/>
        </TableRow>
        <TableRow Name="Row22" Height="28.35">
          <TableCell Name="Cell163" Border.Lines="All" Text="检验结论" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell164" Border.Lines="All" Text="[sys_InspectReport.TestResults]" VertAlign="Center" Font="宋体, 9pt" ColSpan="4"/>
          <TableCell Name="Cell165" Border.Lines="All" Font="宋体, 9pt"/>
          <TableCell Name="Cell166" Border.Lines="All" Font="宋体, 9pt"/>
          <TableCell Name="Cell167" Border.Lines="All" Font="宋体, 9pt"/>
        </TableRow>
        <TableRow Name="Row23" Height="28.35">
          <TableCell Name="Cell168" Border.Lines="All" Text="不合格处理措施" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell169" Border.Lines="All" Text="[sys_InspectReport.Measures]" VertAlign="Center" Font="宋体, 9pt" ColSpan="4"/>
          <TableCell Name="Cell170" Border.Lines="All" Font="宋体, 9pt"/>
          <TableCell Name="Cell171" Border.Lines="All" Font="宋体, 9pt"/>
          <TableCell Name="Cell172" Border.Lines="All" Font="宋体, 9pt"/>
        </TableRow>
        <TableRow Name="Row24" Height="28.35">
          <TableCell Name="Cell173" Border.Lines="All" Text="检验员" HorzAlign="Center" VertAlign="Center" Font="宋体, 9pt"/>
          <TableCell Name="Cell174" Border.Lines="All" Text="[sys_InspectReport.Username]" VertAlign="Center" Font="宋体, 9pt" ColSpan="4"/>
          <TableCell Name="Cell175" Border.Lines="All" Font="宋体, 9pt"/>
          <TableCell Name="Cell176" Border.Lines="All" Font="宋体, 9pt"/>
          <TableCell Name="Cell177" Border.Lines="All" Font="宋体, 9pt"/>
        </TableRow>
        <TableRow Name="Row25" Height="56.7">
          <TableCell Name="Cell178" Border.Lines="All" Text="[sys_InspectReport.Remarks]" Font="宋体, 9pt" ColSpan="5"/>
          <TableCell Name="Cell179" Border.Lines="All" Font="宋体, 9pt"/>
          <TableCell Name="Cell180" Border.Lines="All" Font="宋体, 9pt"/>
          <TableCell Name="Cell181" Border.Lines="All" Font="宋体, 9pt"/>
          <TableCell Name="Cell182" Border.Lines="All" Font="宋体, 9pt"/>
        </TableRow>
      </TableObject>
    </ReportSummaryBand>
  </ReportPage>
</Report>
