Rss & SiteMap
Foxtable(狐表) http://www.foxtable.com
Dim doc As New PrintDoc '定义一个报表
Dim rt As New prt.RenderTable()
doc.Body.Children.Add(rt)
rt.Style.GridLines.All = prt.Linedef.Default
For r As integer = 0 to 150
For c As integer = 0 to 5
Dim rx As New prt.RenderText
rx.Text = r & "," & c
rt.Cells(r, c).RenderObject = rx
Next
Next
Dim rt1 As New prt.RenderTable()
doc.PageHeader = rt1
rt1.cells(0,0).text = "[PageNo]"
rt1.cells(0,1).text = "[Pagecount]"
dim a1 as string = "[PageNo]"
dim a2 as string = "[Pagecount]"
if a1 = a2 then
rt1.cells(0,2).text = "显示"
else
rt1.cells(0,2).text = "不显示"
end if
doc.Preview() '预览报表
虽a1变量和a2变量在每页的页眉是有效果,但用命令窗口看下变量值,确分别是[PageNo],[Pagecount]
所以等式一直不成立!
继续用帮助中的例子说明情况--
有试过的方法:
1、增加RenderText 文本对像 用精确定位,不行。会和内容重叠(当记录刚好到达那个位置时)
2、用页脚。
建议用二个报表?怎么样做行数的判断啊?
下载信息 [文件大小: 下载次数: ] | |
点击浏览该文件:管理项目1.rar |
Dim doc As New Printdoc
Dim rx As prt.RenderText
Dim rt As prt.RenderTable
rx = New prt.RenderText
rx.Style.FontSize = 14
rx.Style.FontBold = True
rx.Style.Spacing.Bottom = 5
rx.Text = "类别: " & Tables("类别").Current("类别名称")
doc.pageheader = rx
rt = New prt.RenderTable
rt.Style.TextAlignHorz = prt.AlignHorzEnum.Center
rt.Style.TextAlignVert = prt.AlignVertEnum.Center
rt.RowGroups(0,1).Header = prt.TableHeaderEnum.All
rt.CellStyle.Spacing.All = 1
rt.Cols.Count = 4
rt.Cells(0,0).Text = "产品名称"
rt.Cells(0,1).Text = "单价"
rt.Cells(0,2).Text = "库存量"
rt.Cells(0,3).Text = "订购量"
rt.Cells(0,4).Text = "再订购量"
rt.Cells(0,5).Text = "中止"
rt.rows(0).Style.Borders.Top = New prt.LineDef(1,Color.LightGray)
rt.rows(0).Style.Borders.Bottom = New prt.LineDef(1,Color.LightGray)
With Tables("类别.产品")
For r As integer = 0 To .Rows.Count - 1 '遍历关联表每一行
rt.Cells(r+1,0).Text = .rows(r)("产品名称")
rt.Cells(r+1,1).Text = .rows(r)("单价")
rt.Cells(r+1,2).Text = .rows(r)("库存量")
rt.Cells(r+1,3).Text = .rows(r)("订购量")
rt.Cells(r+1,4).Text = .rows(r)("再订购量")
If .rows(r)("中止") = True Then
Dim rm As New prt.RenderImage
rm.Image = getImage("Check.Ico")
rm.Style.ImageAlign.AlignHorz = prt.ImageAlignHorzEnum.Center
rm.Style.ImageAlign.StretchHorz = False
rm.Style.ImageAlign.StretchVert = False
rt.Cells(r+1,5).RenderObject = rm
End If
Next
End With
doc.Body.Children.Add(rt)
Dim rx1 As prt.RenderText
rx1 = New prt.RenderText
rx1.Style.FontSize = 14
rx1.Style.FontBold = True
rx1.Style.Spacing.Bottom = 5
rx1.Text = "说明: " & Tables("类别").Current("说明")
doc.pagefooter = rx1
doc.Preview
要求是:说明这一列的内容在第一页不显示,在第二页显视。(如果有4页,前3页不显视,在第4页显视)
(不用页脚,用其他办法也行,能做到所需的要求就行了)
你可以分成三段循环来打印,假定每页打印30行:
首先加入一个页眉,接着打印前30行,接着插入换页符。
然后插入页眉,打印31到60行,接着插入换页。
然后用一个循环,打印所有剩余的行。
三段代码是一样的,只是循环的起始值和终止值不同。