Foxtable(狐表)用户栏目专家坐堂 → [求助]打印容器求助


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

主题:[求助]打印容器求助

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


加好友 发短信
等级:幼狐 帖子:105 积分:849 威望:0 精华:0 注册:2015/1/25 23:22:00
[求助]打印容器求助  发帖心情 Post By:2015/5/8 19:39:00 [只看该作者]

我新建一窗口,加一TabControl1,在第二页签添加一SplitContainer1,在第二页签添加一面板,命名为“板材”,之后会动态添加多个面板。

现在想把板材内的其他控件打印出来要怎么写代码?能实现吗?


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


加好友 发短信
等级:贵宾 帖子:35433 积分:178524 威望:0 精华:3 注册:2013/3/30 16:36:00
  发帖心情 Post By:2015/5/9 9:02:00 [只看该作者]

用专业报表吧

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


加好友 发短信
等级:幼狐 帖子:105 积分:849 威望:0 精华:0 注册:2015/1/25 23:22:00
  发帖心情 Post By:2015/5/9 21:04:00 [只看该作者]

这样代码生成的图案要怎么设置专业报表呢,并且是生成以后还会根据剩余区域继续生成,给个思路吧

Dim mc As WinForm.TextBox = e.Form.Controls("TextBox9")
Dim mcs As String = mc.text
For Each c As WinForm.Control In e.Form.Controls(""& mcs &"").children
    e.Form.removeControl(c.name)
Next
DataTables("临时").DeleteFor("[批次] = '"& mcs &"'")
Dim bl As Double = 1220 / 345
Dim chang As WinForm.TextBox = e.Form.Controls("TextBox1")
Dim kuan As WinForm.TextBox = e.Form.Controls("TextBox2")
Dim hd As WinForm.TextBox = e.Form.Controls("TextBox3")
Dim sd As WinForm.TextBox = e.Form.Controls("TextBox4")
Dim sc As WinForm.TextBox = e.Form.Controls("TextBox6")
Dim hc As WinForm.TextBox = e.Form.Controls("TextBox7")
Dim jk As WinForm.TextBox = e.Form.Controls("TextBox8")
Dim cf As WinForm.ComboBox = e.Form.Controls("ComboBox2")
Dim x As Integer = jk.text
If cf.text = "横裁" Then
    Dim i As Integer
    Dim y As Integer
    For y = 1 To sd.text
        For i = 1 To hd.text
            Dim x1 As Double = chang.text / bl
            Dim x2 As Double = kuan.text / bl
            Dim wzx As Double = (x + (i - 1) * (kuan.text + x)) / bl
            Dim wzy As Double = (x + (y - 1) * (chang.text + x)) / bl
            Dim xy As Integer = (y - 1) * hd.text + i
            Dim mcs1 As String = mcs & xy
            Dim Panel1 As WinForm.Panel
            Panel1 = e.Form.CreateControl(""& mcs1 &"", ControlTypeEnum.Panel)
            Panel1.SetBounds(wzx, wzy, x2, x1)
            e.Form.Controls(""& mcs &"").AddControl(Panel1)
            e.Form.Controls(""& mcs1 &"").BackColor = Color.Orangered
            Dim lbl As WinForm.Label
            lbl = e.Form.CreateControl(""& mcs1 &"", ControlTypeEnum.Label)
            Dim gg1 As String = chang.text & "*" & kuan.text
            lbl.Text = gg1
            lbl.Left = x2 / 2 - 30
            lbl.Top = x1 / 2 - 15
            e.Form.Controls(""& mcs1 &"").AddControl(lbl)
        Next
        Dim sy As Double = hc.text - hd.text * kuan.text - (hd.text + 1) * x
        Dim xsy As Double = (x + (hd.text * (kuan.text + x))) / bl
        Dim ysy As Double = (x + (y - 1) * (chang.text + x)) / bl
        Dim x3 As Single
        Dim x4 As Single
        x3 = sy / bl
        x4 = chang.text / bl
        Dim xy1 As Single = hd.text * sd.text + y
        Dim mcs2 As String = mcs & xy1
        Dim Panel2 As WinForm.Panel
        Panel2 = e.Form.CreateControl(""& mcs2 &"", ControlTypeEnum.Panel)
        Panel2.SetBounds(xsy, ysy, x3, x4)
        e.Form.Controls(""& mcs &"").AddControl(Panel2)
        e.Form.Controls(""& mcs2 &"").BackColor = Color.Orange
    Next
    Dim sy2 As Double = sc.text - sd.text * chang.text - (sd.text + 1) * x
    Dim xsy2 As Double = x / bl
    Dim ysy2 As Double = (x + sd.text * (chang.text + x)) / bl
    Dim x5 As Single
    Dim x6 As Single
    x5 = hc.text / bl
    x6 = sy2 / bl
    Dim xy2 As Single = hd.text * sd.text + sd.text + 1
    Dim mcs3 As String = mcs & xy2
    Dim Panel3 As WinForm.Panel
    Panel3 = e.Form.CreateControl(""& mcs3 &"", ControlTypeEnum.Panel)
    Panel3.SetBounds(xsy2, ysy2, x5, x6)
    e.Form.Controls(""& mcs &"").AddControl(Panel3)
    e.Form.Controls(""& mcs3 &"").BackColor = Color.Orange
Else
    Dim i As Integer
    Dim y As Integer
    For i = 1 To hd.text
        For y = 1 To sd.text
            Dim x1 As Double = chang.text / bl
            Dim x2 As Double = kuan.text / bl
            Dim wzx As Double = (x + (i - 1) * (kuan.text + x)) / bl
            Dim wzy As Double = (x + (y - 1) * (chang.text + x)) / bl
            Dim xy As Integer = (y - 1) * hd.text + i
            Dim mcs1 As String = mcs & xy
            Dim Panel1 As WinForm.Panel
            Panel1 = e.Form.CreateControl(""& mcs1 &"", ControlTypeEnum.Panel)
            Panel1.SetBounds(wzx, wzy, x2, x1)
            e.Form.Controls(""& mcs &"").AddControl(Panel1)
            e.Form.Controls(""& mcs1 &"").BackColor = Color.Orangered
            Dim lbl As WinForm.Label
            lbl = e.Form.CreateControl(""& mcs1 &"", ControlTypeEnum.Label)
            Dim gg1 As String = chang.text & "*" & kuan.text
            lbl.Text = gg1
            lbl.Left = x2 / 2 - 30
            lbl.Top = x1 / 2 - 15
            e.Form.Controls(""& mcs1 &"").AddControl(lbl)
        Next
        Dim sy As Double = sc.text - sd.text * chang.text - (sd.text + 1) * x
        Dim xsy As Double = (x + (i - 1) * (kuan.text + x)) / bl
        Dim ysy As Double = (x + sd.text * (chang.text + x)) / bl
        Dim x3 As Single
        Dim x4 As Single
        x3 = kuan.text / bl
        x4 = sy / bl
        Dim xy1 As Single = hd.text * sd.text + i
        Dim mcs2 As String = mcs & xy1
        Dim Panel2 As WinForm.Panel
        Panel2 = e.Form.CreateControl(""& mcs2 &"", ControlTypeEnum.Panel)
        Panel2.SetBounds(xsy, ysy, x3, x4)
        e.Form.Controls(""& mcs &"").AddControl(Panel2)
        e.Form.Controls(""& mcs2 &"").BackColor = Color.Orange
    Next
    Dim sy2 As Double = hc.text - hd.text * kuan.text - (hd.text + 1) * x
    Dim xsy2 As Double = (x + hd.text * (kuan.text + x)) / bl
    Dim ysy2 As Double = x / bl
    Dim x5 As Single
    Dim x6 As Single
    x5 = sy2 / bl
    x6 = sc.text / bl
    Dim xy2 As Single = hd.text * sd.text + sd.text + 1
    Dim mcs3 As String = mcs & xy2
    Dim Panel3 As WinForm.Panel
    Panel3 = e.Form.CreateControl(""& mcs3 &"", ControlTypeEnum.Panel)
    Panel3.SetBounds(xsy2, ysy2, x5, x6)
    e.Form.Controls(""& mcs &"").AddControl(Panel3)
    e.Form.Controls(""& mcs3 &"").BackColor = Color.Orange
End If


Dim ggbh As WinForm.TextBox = e.Form.Controls("TextBox10")
Dim nd As DataRow = DataTables("临时").addnew
nd("规格编号") = ggbh.text
nd("数量") = hd.text * sd.text
nd("批次") = mcs

 回到顶部
帅哥哟,离线,有人找我吗?
大红袍
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2015/5/10 9:48:00 [只看该作者]

  循环窗口各个控件,循环容器各个控件,生成对应的专业报表的对象。

 回到顶部