Foxtable(狐表)用户栏目专家坐堂 → [求助] 模板打印问题


  共有1839人关注过本帖树形打印复制链接

主题:[求助] 模板打印问题

帅哥哟,离线,有人找我吗?
sanny
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:三尾狐 帖子:799 积分:5921 威望:0 精华:0 注册:2018/11/3 8:24:00
[求助] 模板打印问题  发帖心情 Post By:2018/12/5 15:49:00 [只看该作者]

版主,请帮忙一下,以下代码不知道错在哪儿,我点选Box no打印时,选中的箱号打不出来,老是打出来空白,不知道为什么?

 

这是按钮代码:

 

DataTables("Shipment").DataCols("ShippingNo").RaiseDataColChanged()

Dim Book As New XLS.Book(ProjectPath & "Attachments\manuf shipping mark.xlsx")
Dim fl As String = ProjectPath & "manufacturing\"&Tables("shipment.packinglist").current("shippingNo")&"\Box\"& "ShippingNo_"& Tables("shipment.packinglist").current("shippingNo") & "  BoxNo_" &Tables("shipment.packinglist").current("boxno") & ".xlsx"
Dim Result As DialogResult

Dim Proc As New Process '打开工作簿

Dim r1 As Row = Nothing
Dim cn1 As Integer = 0
Dim cn2 As Double = 0
Dim cn3 As Double = 0
For i As Integer = 0 To Tables("Shipment.Packinglist").Rows.Count - 1

    Dim r As Row = Tables("Shipment.Packinglist").Rows(i)
    If r("boxno") = r.Table.current("boxno") AndAlso (r1 Is Nothing OrElse r("ShippingNo") & r("BoxNo") <> r1("ShippingNo") & r1("BoxNo"))
        cn1 += 1
        cn2 += r("Volume_CBM")
        cn3 += r("Gross_weight")

        r1 = r
    End If
Next


vars("总箱数") = cn1
vars("总立方") = cn2
vars("总毛重") = cn3

Dim Sheet As XLS.Sheet = Book.Sheets(0)
sheet(5,14).value = "<BoxNo='" & Tables("Shipment.Packinglist").current("boxno") & "'>"
Book.Build() '生成细节区

sheet = Book.Sheets(0)

 

If FileSys.FileExists(ProjectPath & "manufacturing\"&Tables("shipment.packinglist").current("shippingNo")&"\Box\"& "ShippingNo_"& Tables("shipment.packinglist").current("shippingNo") & "  BoxNo_" &Tables("shipment.packinglist").current("boxno") & ".xlsx")  Then
    Result = Messagebox.Show(Tables("shipment.packinglist").current("shippingNo") & "  BoxNo_" &Tables("shipment.packinglist").current("boxno") & ".xlsx"&" 文件已经存在,是否要覆盖?","提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
    If Result = DialogResult.Yes Then
       
        Book.Save(fl) '保存工作簿
        Proc.File = fl
        Proc.Start()
      End If
Else
Book.Save(fl) '保存工作簿
Proc.File = fl
Proc.Start()
End If

 

 

这是表单属性代码:

 

Dim r1 As Row = Nothing
Dim cn1 As Integer = 0
Dim cn2 As Double = 0
Dim cn3 As Double = 0
Tables("Shipment.Packinglist").sort = "BoxNo"
For i As Integer = 0 To Tables("Shipment.Packinglist").Rows.Count - 1
    Dim r As Row = Tables("Shipment.Packinglist").Rows(i)
    If r1 Is Nothing OrElse r("ShippingNo") & r("BoxNo") <> r1("ShippingNo") & r1("BoxNo")
        cn1 += 1
        r1 = r
    End If
Next

 

 

 


此主题相关图片如下:捕获.png
按此在新窗口浏览图片

 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/12/5 17:35:00 [只看该作者]

做个对应的例子发上来测试。说明在哪里,怎么测试。

 回到顶部