''' '********报表************ 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()
|