以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  请教:分组打印  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=64323)

--  作者:feiyu988
--  发布时间:2015/2/11 9:21:00
--  请教:分组打印

请教一下,分组打印按照工程名称、单位工程名称、锚段分组,每行数据在打印时分三行显示,但是明细数据出来的不是分组里的,而且只有一行的数据,哪位老师给看一下问题出在哪里?

 

 

 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:管理项目1.foxdb


--  作者:Bin
--  发布时间:2015/2/11 9:28:00
--  
不止一行啊
图片点击可在新窗口打开查看此主题相关图片如下:qq截图20150211092740.png
图片点击可在新窗口打开查看

--  作者:feiyu988
--  发布时间:2015/2/11 9:32:00
--  

13锚段左支柱是1、6两组数据,出来的数据不对,分组没错,明细不对,每组的明细没全打出来


--  作者:有点甜
--  发布时间:2015/2/11 9:38:00
--  
Dim doc As New PrintDoc
Dim rt As Prt.RenderTable
Dim rx As prt.RenderText
Dim tbl As Table = Tables("吊弦计算")
Dim Rows As List(Of DataRow)
Dim Datas As List(Of String()) = tbl.DataTable.GetValues("工程名称|单位工程名称|锚段",tbl.Filter)
doc.Pagesetting.LandScape = True
For Each Data As String() In Datas
    rx = New prt.RenderText
    rx.Style.FontSize = 16
    rx.Style.FontBold = True
    rx.Style.Spacing.Bottom = 5
    rx.Style.TextAlignHorz = prt.AlignHorzEnum.Center \'文本内容水平居中
    rx.Text = "吊 弦 计 算 单"
    doc.Body.Children.Add(rx)
   
    rx = New prt.RenderText
    rx.Style.FontSize = 10
    rx.Style.FontBold = False
    rx.Style.Spacing.Bottom = 2
    rx.Text = "项目: " & Data(0) & "    站区: " & Data(1) & "    锚段: " & data(2)
    doc.Body.Children.Add(rx)
   
    rt = New prt.RenderTable
    rt.Style.GridLines.All = New prt.LineDef \'将网格线类型设为默认类型
    Rows = tbl.DataTable.Select("[工程名称] = \'" & Data(0)& "\' and [单位工程名称] = \'" & Data(1)& "\' and [锚段] = \'" & Data(2)& "\'")
    \'rt.Width = 180 \'表宽为150毫米
    \'rt.Height = 30 \'表高为150毫米
    \'rt.Rows.Count = 4 \'设置行数
    \'rt.Cols.Count = 12 \'设置列数
    rt.Cells(0, 0).text = "左支柱"
    rt.Cells(0, 1).text = ""
    rt.Cells(0, 2).text = "吊弦1"
    rt.Cells(0, 3).text = "吊弦2"
    rt.Cells(0, 4).text = "吊弦3"
    rt.Cells(0, 5).text = "吊弦4"
    rt.Cells(0, 6).text = "吊弦5"
    rt.Cells(0, 7).text = "吊弦6"
    rt.Cells(0, 8).text = "吊弦7"
    rt.Cells(0, 9).text = "吊弦8"
    rt.Cells(0, 10).text = "右支柱"
    rt.Cells(0, 11).text = "备注"
   
    For r As Integer = 0 To Rows.Count -1
        Dim dr As DataRow = Rows(r)
       
        Dim i As Integer = r*3+1
        rt.Cells(1+i, 0).text = dr("左支柱")
        rt.Cells(1+i, 1).text = "间距"
        rt.Cells(1+i, 2).text = Format(dr("间距1"),"0.00")
        rt.Cells(1+i, 3).text = Format(dr("间距2"),"0.00")
        rt.Cells(1+i, 4).text = Format(dr("间距3"),"0.00")
        rt.Cells(1+i, 5).text = Format(dr("间距4"),"0.00")
        rt.Cells(1+i, 6).text = Format(dr("间距5"),"0.00")
        rt.Cells(1+i, 7).text = Format(dr("间距6"),"0.00")
        rt.Cells(1+i, 8).text = Format(dr("间距7"),"0.00")
        rt.Cells(1+i, 9).text = Format(dr("间距8"),"0.00")
        rt.Cells(1+i, 10).text = dr("右支柱")
        rt.Cells(2+i, 1).text = "吊弦长度"
        rt.Cells(2+i, 2).text = Format(dr("吊弦1长"),"0")
        rt.Cells(2+i, 3).text = Format(dr("吊弦2长"),"0")
        rt.Cells(2+i, 4).text = Format(dr("吊弦3长"),"0")
        rt.Cells(2+i, 5).text = Format(dr("吊弦4长"),"0")
        rt.Cells(2+i, 6).text = Format(dr("吊弦5长"),"0")
        rt.Cells(2+i, 7).text = Format(dr("吊弦6长"),"0")
        rt.Cells(2+i, 8).text = Format(dr("吊弦7长"),"0")
        rt.Cells(2+i, 9).text = Format(dr("吊弦8长"),"0")
        rt.Cells(3+i, 1).text = "加工长度"
        rt.Cells(3+i, 2).text = Format(dr("吊弦1加工长"),"0")
        rt.Cells(3+i, 3).text = Format(dr("吊弦2加工长"),"0")
        rt.Cells(3+i, 4).text = Format(dr("吊弦3加工长"),"0")
        rt.Cells(3+i, 5).text = Format(dr("吊弦4加工长"),"0")
        rt.Cells(3+i, 6).text = Format(dr("吊弦5加工长"),"0")
        rt.Cells(3+i, 7).text = Format(dr("吊弦6加工长"),"0")
        rt.Cells(3+i, 8).text = Format(dr("吊弦7加工长"),"0")
        rt.Cells(3+i, 9).text = Format(dr("吊弦8加工长"),"0")
        rt.Cells(1+i,0).SpanRows = 3 \'第2行第1个单元格向下合并3行
        rt.Cells(1+i,10).SpanRows = 3 \'第2行第11个单元格向下合并3行
        rt.Cells(1+i,11).SpanRows = 3 \'第2行第12个单元格向下合并3行
        rt.Style.TextAlignHorz = prt.AlignHorzEnum.Center \'所有文本内容居中
        rt.Style.TextAlignVert = prt.AlignVertEnum.Center \'垂直居中
    Next
   
   
    rt.RowGroups(0,1).Header = prt.TableHeaderEnum.All
    doc.Body.Children.Add(rt)
Next
Doc.PageSetting.LeftMargin = 15 \'设置左边距
Doc.PageSetting.RightMargin = 15 \'设置右边距
Doc.PageSetting.TopMargin = 15 \'设置上边距
Doc.PageSetting.BottomMargin = 10 \'设置下边距
doc.PageSetting.Width = 210 \'纸张宽度为100毫米
doc.PageSetting.Height = 297 \'纸张高度为120毫米
doc.preview()