以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 请教专业报表的合并单元格。 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=25878) |
||||
-- 作者:gdtgl -- 发布时间:2012/11/19 11:31:00 -- 请教专业报表的合并单元格。 希望按键1达到的效果:
此主题相关图片如下:效果13(行).jpg [此贴子已经被作者于2012-11-19 11:33:18编辑过]
|
||||
-- 作者:lihe60 -- 发布时间:2012/11/19 11:32:00 -- Dim doc As New PrintDoc \'定义一个报表 |
||||
-- 作者:gdtgl -- 发布时间:2012/11/19 11:32:00 --
|
||||
-- 作者:lin_hailun -- 发布时间:2012/11/19 13:11:00 -- \'\'\' \'********报表************ Dim doc As New Printdoc \'报表内容 Dim rt As prt.RenderTable rt = New prt.RenderTable rt.Style.GridLines.All = prt.Linedef.Default \'网格线为默认类型 rt.Style.TextAlignHorz = prt.AlignHorzEnum.Center \'设置字体居中 rt.CellStyle.Spacing.All = 1 \'行与行之间的间隔 \'------------------------------------------------------------------------------------------------------------------------------ Dim dr As Row =Tables("原始记录分类.原始记录three").current Dim ycfn As String = dr("分类序号") Dim tb As DataTable = DataTables("原始记录") Dim tbrows As List(of DataRow) = tb.Select("[受理编号] = \'" & dr("受理编号") & "\' and [分类序号] = \'" & ycfn & "\'", "采样地点") rt.Cells(0,0).Text = "采样地点" rt.Cells(0,1).Text = "检验项目" rt.Cells(0,2).Text = "测定值(ug/L)" rt.Cells(0,3).Text = "报告值(mg/L)" rt.Cells(1,0).Text = tbrows(0)("采样地点") rt.Cells(1,1).Text = tbrows(0)("检验项目") Dim FirstRow As Integer = 1 For bci As Integer = 1 To tbrows.count -1 If tbrows(bci)("采样地点") = tbrows(bci -1)("采样地点") Then rt.Cells(firstRow,0).SpanRows = rt.Cells(firstRow, 0).SpanRows + 1 rt.Cells(bci+1,1).Text = tbrows(bci)("检验项目") Else rt.Cells(bci+1,0).Text = tbrows(bci)("采样地点") rt.Cells(bci+1,1).Text = tbrows(bci)("检验项目") rt.Cells(bci+1,0).SpanRows = 1 firstRow = bci+1 End If Next doc.Body.Children.Add(rt) \'--------------------------------------------------------------------------------------------------------------------- doc.Preview() |