以文本方式查看主题 - Foxtable(狐表) (http://www.foxtable.com/bbs/index.asp) -- 专家坐堂 (http://www.foxtable.com/bbs/list.asp?boardid=2) ---- 请教IL接头跟踪单输出结果问题 (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=171471) |
||||||||
-- 作者:edisontsui -- 发布时间:2021/8/31 14:42:00 -- 请教IL接头跟踪单输出结果问题
附件里面有三个档案。一个是数据表、一个是代码、一个是代码输出结果。我想在输出结果的“侧盖板组件”下面显示侧盖板组件代号(比如:45216-683-50)、在输出结果的“螺丝包”下面显示螺丝包代号(比如:45132-001-59)。但是在代码那个档案的红色代码那里不知道怎么写代码。特此请教。谢谢。
|
||||||||
-- 作者:有点蓝 -- 发布时间:2021/8/31 15:11:00 -- 和填入数量的用法差不多,使用Find函数,通过箱号和产品型号查询获取对应行的侧盖板组件代号 |
||||||||
-- 作者:edisontsui -- 发布时间:2021/8/31 17:39:00 -- 可以了。谢谢。 |
||||||||
-- 作者:edisontsui -- 发布时间:2021/9/1 15:56:00 -- \'-----填入物料清单 Dim filter As String = Tables("IL接头任务单").filter If filter > "" Then filter = filter & " and " \'填入物料编号 Dim Products As List(Of String) = DataTables("IL接头任务单").GetValues("产品型号",filter & " SO号与箱号 =\'" & ctn(s-1) & "\'") Dim idx As Integer = 1 Dim qty As Integer = 0 For Each sss As String In Products \'填入物料代号 rt = new prt.RenderText rt.text = sss re.Rows(idx).Height = 8 re.cells(idx,0).renderObject = rt re.Style.Font = New Font("Arial", 18) \'填入侧盖板组件代号 rt = new prt.RenderText Dim dr99 As DataRow dr99 = DataTables("IL接头任务单").find("SO号与箱号 =\'" & ctn(s-1) & "\' and 产品型号=\'" & sss & "\' ") rt.text = dr99("侧盖板组件") re.Rows(idx).Height = 8 re.cells(idx,3).RenderObject = rt re.Style.Font = New Font("Arial", 14) \'填入数量个 rt = new prt.RenderText Dim qty1 As Integer = Tables("IL接头任务单").Compute("sum(数量个)","SO号与箱号 =\'" & ctn(s-1) & "\' and 产品型号=\'" & sss & "\'") \' rt.text = Tables("IL接头任务单").Compute("sum(数量个)","SO号与箱号 =\'" & ctn(s-1) & "\' and 产品型号=\'" & sss & "\'") rt.text = qty1 re.Rows(idx).Height = 8 re.cells(idx,1).RenderObject = rt re.Style.Font = New Font("Arial", 18) \' idx +=1 qty = qty + qty1 \'填入螺丝包代号 rt = new prt.RenderText Dim dr98 As DataRow dr98 = DataTables("IL接头任务单").find("SO号与箱号 =\'" & ctn(s-1) & "\' and 产品型号=\'" & sss & "\' ") rt.text = dr98("螺丝包") re.Rows(idx).Height = 8 re.cells(idx,5).RenderObject = rt re.Style.Font = New Font("Arial", 14) idx +=1 Next ra.children.add(re) 上述代码的输出结果是按照“产品型号”来排序的。但是,我希望按照“侧盖板组件”来排序,请问应该怎么改代码?谢谢。
|
||||||||
-- 作者:有点蓝 -- 发布时间:2021/9/1 16:01:00 -- 参考:http://www.foxtable.com/webhelp/topics/2747.htm |
||||||||
-- 作者:edisontsui -- 发布时间:2021/9/2 8:44:00 -- 谢谢。 |
||||||||
-- 作者:edisontsui -- 发布时间:2021/9/6 13:30:00 --
\'-----填入物料清单 Dim filter As String = Tables("IL接头任务单").filter If filter > "" Then filter = filter & " and " \'填入物料编号 Dim Products As List(Of String) = DataTables("IL接头任务单").GetValues("产品型号与回路号",filter & " SO号与箱号 =\'" & ctn(s-1) & "\'", "侧盖板组件") \'按侧盖板组件进行排序 Dim idx As Integer = 1 Dim qty As Integer = 0 For Each sss As String In Products \'填入物料代号 rt = new prt.RenderText Dim dr90 As DataRow dr90 = DataTables("IL接头任务单").find("SO号与箱号 =\'" & ctn(s-1) & "\' and 产品型号与回路号=\'" & sss & "\' ") \' rt.text = sss rt.text = dr90("产品型号") re.Rows(idx).Height = 8 re.cells(idx,0).renderObject = rt re.cells(idx,0).Style.GridLines.bottom = New prt.Linedef(0.5, color.black,DashStyle.Dot) re.Style.Font = New Font("Arial", 18) re.cells(1,0).Style.GridLines.Top = New prt.Linedef(0.5, color.black) re.cells(1,1).Style.GridLines.Top = New prt.Linedef(0.5, color.black) re.cells(1,2).Style.GridLines.Top = New prt.Linedef(0.5, color.black) re.cells(1,3).Style.GridLines.Top = New prt.Linedef(0.5, color.black) re.cells(1,4).Style.GridLines.Top = New prt.Linedef(0.5, color.black) re.cells(1,5).Style.GridLines.Top = New prt.Linedef(0.5, color.black) re.cells(1,6).Style.GridLines.Top = New prt.Linedef(0.5, color.black) \'填入侧盖板组件代号 rt = new prt.RenderText Dim dr99 As DataRow dr99 = DataTables("IL接头任务单").find("SO号与箱号 =\'" & ctn(s-1) & "\' and 产品型号与回路号=\'" & sss & "\' ") rt.text = dr99("侧盖板组件") re.Rows(idx).Height = 8 re.cells(idx,3).RenderObject = rt re.cells(idx,3).Style.GridLines.bottom = New prt.Linedef(0.5, color.black,DashStyle.Dot) re.Style.Font = New Font("Arial", 14) re.cells(idx,2).Style.GridLines.bottom = New prt.Linedef(0.5, color.black,DashStyle.Dot) re.cells(idx,4).Style.GridLines.bottom = New prt.Linedef(0.5, color.black,DashStyle.Dot) \'填入数量个 rt = new prt.RenderText Dim qty1 As Integer = Tables("IL接头任务单").Compute("sum(数量个)","SO号与箱号 =\'" & ctn(s-1) & "\' and 产品型号与回路号=\'" & sss & "\'") \' rt.text = Tables("IL接头任务单").Compute("sum(数量个)","SO号与箱号 =\'" & ctn(s-1) & "\' and 产品型号与回路号=\'" & sss & "\'") rt.text = qty1 re.Rows(idx).Height = 8 re.cells(idx,1).RenderObject = rt re.cells(idx,1).Style.GridLines.bottom = New prt.Linedef(0.5, color.black,DashStyle.Dot) re.Style.Font = New Font("Arial", 18) \' idx +=1 qty = qty + qty1 \'填入螺丝包代号 rt = new prt.RenderText Dim dr98 As DataRow dr98 = DataTables("IL接头任务单").find("SO号与箱号 =\'" & ctn(s-1) & "\' and 产品型号与回路号=\'" & sss & "\' ") rt.text = dr98("螺丝包") re.Rows(idx).Height = 8 re.cells(idx,5).RenderObject = rt re.cells(idx,5).Style.GridLines.bottom = New prt.Linedef(0.5, color.black,DashStyle.Dot) re.Style.Font = New Font("Arial", 14) \'填入回路号 rt = new prt.RenderText Dim dr97 As DataRow dr97 = DataTables("IL接头任务单").find("SO号与箱号 =\'" & ctn(s-1) & "\' and 产品型号与回路号=\'" & sss & "\' ") rt.text = dr97("回路号") re.Rows(idx).Height = 8 re.cells(idx,6).RenderObject = rt re.cells(idx,6).Style.GridLines.bottom = New prt.Linedef(0.5, color.black,DashStyle.Dot) re.Style.Font = New Font("Arial", 14) idx +=1 Next ra.children.add(re) 附件是一个按钮的全部代码。上面贴出的是其中一段代码。早上这段代码都可以运行的,下午再测试时就有警告“未将对象引用设置到对象的实例”。我估计就是上面这段代码的问题。但是又找不出是什么问题。特此请教。谢谢。这里我曾经将getvalues 后面的 “产品型号”改为了“产品型号与回路号”。
|
||||||||
-- 作者:有点蓝 -- 发布时间:2021/9/6 13:40:00 -- http://www.foxtable.com/webhelp/topics/0396.htm,看看示例三说明 |
||||||||
-- 作者:edisontsui -- 发布时间:2021/9/6 17:35:00 --
上面的数据表和条形码代码,如果不加条形码的话,就是输出7张标签。如果加上条形码的话,那么第一张输出结果是对的,而第2到第7张标签就重叠在一起了,总共才有2张标签了。请教是什么原因?谢谢。
|
||||||||
-- 作者:有点蓝 -- 发布时间:2021/9/6 20:38:00 -- 去掉这句 Doc.Stacking = prt.StackingRulesEnum.InlineLeftToRight
|