以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  【专业报表】专业报表中怎么实现两个表格的间隔?怎么实现关联表数据多行打印?  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=109334)

--  作者:李孝春
--  发布时间:2017/11/9 16:17:00
--  【专业报表】专业报表中怎么实现两个表格的间隔?怎么实现关联表数据多行打印?

【专业报表】专业报表中怎么实现两个表格的间隔?怎么实现关联表数据多行打印?

图片点击可在新窗口打开查看此主题相关图片如下:1.png
图片点击可在新窗口打开查看
1、这个图中的红色部分那竖线怎么取消呢?

图片点击可在新窗口打开查看此主题相关图片如下:2.png
图片点击可在新窗口打开查看
2、这个图中的红色部分怎么设定取消空白?也就是两个表格之间怎么设定间隔距离?

图片点击可在新窗口打开查看此主题相关图片如下:3.png
图片点击可在新窗口打开查看
3、如图,这个代码取消注释后会报错?怎么解决呢?
4、系统目前只能获取到第一条数据,不能获取当前所有满足条件的数据,求解,对于遍历这个部分确实是小白
麻烦各位老师多多指导下

专业报表代码:
 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:专业报表.txt


[此贴子已经被作者于2017/11/9 17:07:46编辑过]

--  作者:有点甜
--  发布时间:2017/11/9 17:02:00
--  

参考

 

Dim doc As New PrintDoc \'定义一个报表

Dim Rows As List(Of DataRow)

Dim CurRow As Row = Tables("卷宗入库").Current
Dim ndr As DataRow = DataTables("涉案款物").find("案件编号 = \'" & currow("卷宗编号") & "\'")
Dim drs1 = DataTables("入库明细").Select("卷宗编号 = \'" & currow("卷宗编号") & "\'")
Dim drs2 = DataTables("款物明细").Select("案件编号 = \'" & currow("卷宗编号") & "\'")

Dim bg As New prt.RenderTable() \'定义一个表格对象
doc.Body.Children.Add(bg)
bg.Style.GridLines.All = New prt.LineDef \'将网格线类型设为默认类型
bg.CellStyle.Spacing.All = 1 \'内容距离网格线1毫米

bg.Width = 160 \'表宽为150毫米
bg.Height = 50 \'表高为150毫米
bg.Rows.Count = 6 \'设置行数
bg.Cols.Count = 6 \'设置列数

bg.Cells(0,0).text = "贵州省瓮安县人民检察院"
bg.Cells(0,0).SpanCols = 6 \'合并第一行全部单元格,用于显示主标题
bg.Cells(0,0).Style.TextAlignHorz = prt.AlignHorzEnum.Center \'主标题居中
bg.Cells(0,0).Style.Font = New Font("宋体", 16, FontStyle.Bold) \'设置主标题字体
bg.Rows(0).Style.Borders.All = New prt.LineDef("0mm", Color.white) \'去掉第一行的网格线
\'设置副标题

bg.Cells(1,0).text = "涉案卷宗及财物二维码管理系统" \'通过左边空格数量来调整副标题位置
bg.Cells(1,0).SpanCols = 6 \'合并地二行全部单元格,用于显示副标题
bg.Cells(1,0).Style.Font = New Font("宋体", 16, FontStyle.Bold) \'设置主标题字体
bg.Cells(1,0).Style.TextAlignHorz = prt.AlignHorzEnum.Center \'副标题内容居中
bg.Rows(1).Style.Borders.All = New prt.LineDef("0mm", Color.white) \'去掉第二行的网格线
bg.Rows(1).Style.Borders.Bottom = New prt.Linedef  \'恢复第二行底端的网格线
bg.Rows(1).Height = 8 \'设置第二行的高度,拉开和表格主体的距离.
\'设置列标题


bg.Cells(2,0).text = "基本信息" \'通过左边空格数量来调整副标题位置
bg.Cells(2,0).SpanCols = 3 \'合并地二行全部单元格,用于显示副标题
bg.Cells(2,0).Style.Font = New Font("宋体", 10, FontStyle.Bold) \'设置主标题字体
bg.Cells(2,0).Style.TextAlignHorz = prt.AlignHorzEnum.left \'副标题内容居中
bg.Cells(2,3).text = "卷宗编号"
bg.Cells(2,3).Style.TextAlignHorz = prt.AlignHorzEnum.right \'副标题内容居中
bg.Cells(2,4).text = currow("卷宗编号")  \'通过左边空格数量来调整副标题位置
bg.Cells(2,4).SpanCols = 2 \'合并地二行全部单元格,用于显示副标题
bg.Cells(2,4).Style.Font = New Font("宋体", 10, FontStyle.Bold) \'设置主标题字体
bg.Cells(2,4).Style.TextAlignHorz = prt.AlignHorzEnum.Center \'副标题内容居中


bg.Rows(2).Style.Borders.All = New prt.LineDef("0mm", Color.white) \'去掉第二行的网格线
bg.cells(2,0).Style.Borders.All = New prt.LineDef("0mm", Color.white) \'去掉第二行的网格线
bg.cells(2,3).Style.Borders.All = New prt.LineDef("0mm", Color.white) \'去掉第二行的网格线
bg.cells(2,3).Style.Borders.Bottom = New prt.Linedef  \'恢复第二行底端的网格线
bg.cells(2,0).Style.Borders.Bottom = New prt.Linedef  \'恢复第二行底端的网格线
bg.Rows(2).Style.Borders.Bottom = New prt.Linedef  \'恢复第二行底端的网格线
bg.Rows(2).Height = 8 \'设置第二行的高度,拉开和表格主体的距离.
\'设置列标题

bg.Cols(0).Width = 20
bg.Cols(1).Width = 45
bg.Cols(2).Width = 20
bg.Cols(3).Width = 45
bg.Cols(4).Width = 20
bg.Cols(5).Width = 20
bg.Rows.Count = 4

bg.Rows(0).Height = 15
bg.Rows(1).Height = 15
bg.Rows(2).Height = 10
bg.Rows(3).Height = 10
bg.Rows(4).Height = 10
bg.Rows(5).Height = 10
bg.Rows(6).Height = 10

bg.Style.TextAlignHorz = prt.AlignHorzEnum.Center \'所有文本内容居中\'

bg.Cells(3,0).Text = "所属地州"
bg.Cells(3,1).Text = CurRow("所属地州")
bg.Cells(3,2).Text = "卷宗名称"
bg.Cells(3,3).Text = CurRow("卷宗名称")
bg.Cells(3,4).Text = "涉案款物"
bg.Cells(3,5).Text = CurRow("涉案款物")


bg.Cells(4,0).Text = "所属单位"
bg.Cells(4,1).Text = CurRow("所属单位")
bg.Cells(4,2).Text = "卷宗册数"
bg.Cells(4,3).Text = CurRow("卷宗册数")
bg.Cells(4,4).Text = "款物数量"
bg.Cells(4,5).Text = ndr("款物数量")

bg.Cells(5,0).Text = "承办部门"
bg.Cells(5,1).Text = CurRow("承办部门")
bg.Cells(5,2).Text = "承办人员"
bg.Cells(5,3).Text = CurRow("承办人")
bg.Cells(5,4).Text = "使用人员"
bg.Cells(5,5).Text = CurRow("使用人")

bg.Cells(6,0).Text = "录入时间"
bg.Cells(6,1).Text = CurRow("录入时间")
bg.Cells(6,2).Text = "联系电话"
bg.Cells(6,3).Text = CurRow("联系电话")
bg.Cells(6,4).Text = "办理状态"
bg.Cells(6,5).Text = CurRow("办理状态")

 


Dim bg1 As New prt.RenderTable() \'定义一个表格对象
doc.Body.Children.Add(bg1)
bg1.Style.GridLines.All = New prt.LineDef \'将网格线类型设为默认类型
bg1.CellStyle.Spacing.All = 1 \'内容距离网格线1毫米

bg1.Width = 160 \'表宽为150毫米
\'bg1.Height = 50 \'表高为150毫米
bg1.Rows.Count = 3 \'设置行数
bg1.Cols.Count = 4 \'设置列数

bg1.Cells(0,0).text = "卷宗分册信息"
bg1.Cells(0,0).SpanCols = 4 \'合并第一行全部单元格,用于显示主标题
bg1.Cells(0,0).Style.TextAlignHorz = prt.AlignHorzEnum.left \'主标题居中
bg1.Cells(0,0).Style.Font = New Font("宋体", 10, FontStyle.Bold) \'设置主标题字体
bg1.Rows(0).Style.Borders.All = New prt.LineDef("0mm", Color.white) \'去掉第一行的网格线
bg1.Rows(0).Style.Borders.Bottom = New prt.Linedef  \'恢复第一行底端的网格线
bg1.Rows(0).Height = 10 \'设置第一行的高度,拉开和表格主体的距离.
bg1.Rows(1).Height = 5
bg1.Rows(2).Height = 10

bg1.Cols(0).Width = 50
bg1.Cols(1).Width = 20
bg1.Cols(2).Width = 20
bg1.Cols(3).Width = 20


bg1.Style.TextAlignHorz = prt.AlignHorzEnum.Center \'所有文本内容水平居中\'
bg1.Style.TextAlignVert = prt.AlignVertEnum.Center \'所有文本内容垂直居中\'

bg1.Cells(1,0).Text = "卷宗名称"
bg1.Cells(1,1).Text = "卷宗册数"
bg1.Cells(1,2).Text = "分册编号"
bg1.Cells(1,3).Text = "二维码"

For i As Integer = 0 To drs1.count-1
    Dim ndr1 = drs1(i)
    Dim rm As New prt.RenderImage()
    rm.Image = GetImage(ndr1("二维码")) \'请改为实际的图标名称和路径
    rm.Style.ImageAlign.AlignHorz = prt.ImageAlignHorzEnum.Center \'图片水平居中
    rm.Style.ImageAlign.AlignVert = prt.ImageAlignVertEnum.Center \'图片垂直居中
    rm.Style.ImageAlign.StretchHorz = False \'禁止水平方向扩展图片
    rm.Style.ImageAlign.StretchVert = False \'禁止垂直方向扩展图片
    bg1.Cells(2+i,2).RenderObject = rm \'将单元格内容设置为图片对象rm
   
    bg1.Rows(2+i).Height = 10
   
   
    bg1.Cells(2+i,0).Text = ndr1("卷宗名称")
    bg1.Cells(2+i,1).Text = ndr1("卷宗册数")
    bg1.Cells(2+i,2).Text = ndr1("分册编号")
    bg1.Cells(2+i,3).Image = GetImage(ndr1("二维码"))
   
Next

bg1.Style.Spacing.Top = 30


Dim bg2 As New prt.RenderTable() \'定义一个表格对象
doc.Body.Children.Add(bg2)
bg2.Style.GridLines.All = New prt.LineDef \'将网格线类型设为默认类型
bg2.CellStyle.Spacing.All = 1 \'内容距离网格线1毫米

bg2.Width = 160 \'表宽为150毫米
\'bg2.Height = 50 \'表高为150毫米
bg2.Rows.Count = 3 \'设置行数
bg2.Cols.Count = 4 \'设置列数

bg2.Cells(0,0).text = "款物序号信息"
bg2.Cells(0,0).SpanCols = 4 \'合并第一行全部单元格,用于显示主标题
bg2.Cells(0,0).Style.TextAlignHorz = prt.AlignHorzEnum.left \'主标题居中
bg2.Cells(0,0).Style.Font = New Font("宋体", 10, FontStyle.Bold) \'设置主标题字体
bg2.Rows(0).Style.Borders.All = New prt.LineDef("0mm", Color.white) \'去掉第一行的网格线
bg2.Rows(0).Style.Borders.Bottom = New prt.Linedef  \'恢复第一行底端的网格线
bg2.Rows(0).Height = 10 \'设置第一行的高度,拉开和表格主体的距离.
bg2.Rows(1).Height = 5

bg2.Cols(0).Width = 50
bg2.Cols(1).Width = 20
bg2.Cols(2).Width = 20
bg2.Cols(3).Width = 20


bg2.Style.TextAlignHorz = prt.AlignHorzEnum.Center \'所有文本内容水平居中\'
bg2.Style.TextAlignVert = prt.AlignVertEnum.Center \'所有文本内容垂直居中\'

bg2.Cells(1,0).Text = "款物名称"
bg2.Cells(1,1).Text = "款物数量"
bg2.Cells(1,2).Text = "款物序号"
bg2.Cells(1,3).Text = "二维码"

For i As Integer = 0 To drs2.count-1
    Dim ndr11 = drs2(i)
    bg2.Rows(2+i).Height = 10
    bg2.Cells(2+i,0).Text = ndr11("款物名称")
    bg2.Cells(2+i,1).Text = ndr11("款物数量")
    bg2.Cells(2+i,2).Text = ndr11("款物序号")
    bg2.Cells(2+i,3).Image = GetImage(ndr11("二维码"))
Next
bg2.Style.Spacing.Top = 30

\'设置页眉
Dim rx As New prt.RenderTable
rx.Cells(0,0).Text = Date.Today
rx.Cells(0,1).Text = " "
rx.Cells(0,2).Text = "第[PageNo]页,共[PageCount]页"
rx.Cols(0).Style.TextAlignHorz = prt.AlignHorzEnum.Left
rx.Cols(1).Style.TextAlignHorz = prt.AlignHorzEnum.Center
rx.Cols(2).Style.TextAlignHorz = prt.AlignHorzEnum.right
rx.Style.Borders.Bottom = New prt.LineDef \'设置底边框
rx.CellStyle.Spacing.Bottom = 0.5 \'底端内容缩进0.5毫米
rx.Style.FontSize = 8 \'字体大小为8磅
Doc.PageHeader = rx \'作为页眉使用

doc.Preview() \'预览


--  作者:李孝春
--  发布时间:2017/11/9 17:07:00
--  回复:(有点甜)参考 Dim doc As New Print...
老师 谢谢  还得麻烦一下  表格与表格之间空格悬殊太大了  有没有办法调整啊

图片点击可在新窗口打开查看此主题相关图片如下:1.png
图片点击可在新窗口打开查看


--  作者:有点甜
--  发布时间:2017/11/9 18:39:00
--  

你要看懂代码

 

bg2.Style.Spacing.Top = 30


--  作者:李孝春
--  发布时间:2017/11/10 12:37:00
--  回复:(有点甜)你要看懂代码?bg2.Style.Sp...
谢谢有点甜老师
多个表格之间 怎么判断一个表格在当前页面没有显示完毕呢?如果没有显示完毕,那么下一页中继续显示这个表格的话  先显示表标题 再显示表格内容

图片点击可在新窗口打开查看此主题相关图片如下:2.png
图片点击可在新窗口打开查看

[此贴子已经被作者于2017/11/10 12:37:44编辑过]

--  作者:有点甜
--  发布时间:2017/11/10 14:24:00
--  

看看

 

http://www.foxtable.com/webhelp/scr/2735.htm

 


--  作者:李孝春
--  发布时间:2017/11/10 16:14:00
--  回复:(有点甜)看看 http://www.foxtable....
一个表肯定没有问题 按照帮助  多个表都在一个报表里面  就要进行判断了吧


--  作者:有点甜
--  发布时间:2017/11/10 16:21:00
--  
以下是引用李孝春在2017/11/10 16:14:00的发言:
一个表肯定没有问题 按照帮助  多个表都在一个报表里面  就要进行判断了吧

 

不需要。关键代码

 

表格.RowGroups(0,4).Header = prt.TableHeaderEnum.All  \'前四行作为表头


--  作者:李孝春
--  发布时间:2017/11/10 16:46:00
--  回复:(有点甜)以下是引用李孝春在2017/11/10 16:14...
谢谢