Page类型下提供了多种绘图方法,比如以下代码:
- Private Sub SectionReport1_ReportEnd(sender As System.Object, e As System.EventArgs) Handles MyBase.ReportEnd
- Dim dt As System.Data.DataTable
- dt = DirectCast(DataSource, System.Data.DataTable)
- Dim b As New GrapeCity.ActiveReports.Border
- b.BottomColor = System.Drawing.Color.Black
- b.BottomStyle = GrapeCity.ActiveReports.BorderLineStyle.ThickSolid
- b.LeftColor = System.Drawing.Color.Black
- b.LeftStyle = GrapeCity.ActiveReports.BorderLineStyle.ThickSolid
- b.RightColor = System.Drawing.Color.Black
- b.RightStyle = GrapeCity.ActiveReports.BorderLineStyle.ThickSolid
- b.TopColor = System.Drawing.Color.Black
- b.TopStyle = GrapeCity.ActiveReports.BorderLineStyle.ThickSolid
- For index = 0 To (dt.Rows.Count / 2)
- Me.Document.Pages(0).DrawBorder(b, 6.5, 0.58 + 0.2 * index, 1, 0.2)
- Next
- End Sub
复制代码
关于分栏中第一栏和第二栏格式不一样的问题,可以在Detail的Format事件中根据当前行的行号来进行控制,比如一页最多打印50行,如果当前行是30行则是第一栏中的样式,如果当前行是60行则是第二栏中的样式;
或者根据行号的奇偶来判断。
- Dim page As Integer
- Private Sub Detail1_Format(sender As System.Object, e As System.EventArgs) Handles Detail1.Format
- page = page + 1
- If page Mod 2 = 0 Then
- TextBox4.Border.TopColor = Color.Red
- Else
- TextBox4.Border.TopColor = Color.Black
- End If
- End Sub
复制代码 |