Foxtable(狐表)用户栏目专家坐堂 → [求助]分组打印可否分组保存各自为图片?


  共有2755人关注过本帖树形打印复制链接

主题:[求助]分组打印可否分组保存各自为图片?

美女呀,离线,留言给我吧!
joe_xgp
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:151 积分:1306 威望:0 精华:0 注册:2013/5/13 13:28:00
[求助]分组打印可否分组保存各自为图片?  发帖心情 Post By:2016/5/10 9:10:00 [只看该作者]

查看和学习专业报表的分组打印的例子,例子是讲客户分组打印,可否分组以客户名保存为各自的jpg图片格式?

 

请高手老师指教! 非常感谢!

 

 

打印客户表,按地区分组打印,代码如下:

Dim doc As New PrintDoc
Dim
rt As Prt.RenderTable
Dim
rx As prt.RenderText
Dim
tbl As Table = Tables("客户")
Dim
Rows As List(Of DataRow)
Dim
Regions As List(Of String) = tbl.DataTable.GetValues("地区")
doc
.Pagesetting.LandScape = True
For Each
Region As String In Regions
   
rx = New prt.RenderText
   
rx.Style.FontSize = 14
   
rx.Style.FontBold = True
    rx
.Style.Spacing.Bottom =
2
   
rx.Text = "地区: " & Region
   
doc.Body.Children.Add(rx)
    rt
= New prt.
RenderTable
   
rt.Style.Font = Tables("客户").Font
   
rt.Style.TextAlignVert = prt.AlignVertEnum.Center
   
rt.Style.GridLines.All = New prt.LineDef(0.3,Color.LightGray)
    rt
.Style.Spacing.Bottom =
5
   
rt.CellStyle.Spacing.All = 1
    rt.Style.Font = tbl.Font
    Rows = tbl.Datatable.Select("[地区] = '" & Region & "'")
    For
c As integer = 0 To tbl.Cols.Count - 1
       
rt.Cells(0,c).Text = tbl.Cols(c).Name
        rt
.Cols(c).Width = tbl.Cols(c).
PrintWidth
        For
r As integer = 0 To Rows.Count -1
            rt
.Cells(r + 1, c).Text = rows(r)(tbl.Cols(c).Name
)
        Next
    Next

    rt.RowGroups(
0,1).Header = prt.TableHeaderEnum.All
   
doc.Body.Children.Add(rt)
Next

doc
.preview()


 回到顶部
帅哥哟,离线,有人找我吗?
大红袍
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/5/10 10:02:00 [只看该作者]

参考

 


Dim tbl As Table = Tables("客户")
Dim Regions As List(Of String) = tbl.DataTable.GetValues("地区")
For Each Region As String In Regions
    Dim doc As New PrintDoc
    Dim rt As Prt.RenderTable
    Dim rx As prt.RenderText
    doc.Pagesetting.LandScape = True
    Dim Rows As List(Of DataRow)
    rx = New prt.RenderText
    rx.Style.FontSize = 14
    rx.Style.FontBold = True
    rx.Style.Spacing.Bottom = 2
    rx.Text = "地区: " & Region
    doc.Body.Children.Add(rx)
    rt = New prt.RenderTable
    rt.Style.Font = Tables("客户").Font
    rt.Style.TextAlignVert = prt.AlignVertEnum.Center
    rt.Style.GridLines.All = New prt.LineDef(0.3,Color.LightGray)
    rt.Style.Spacing.Bottom = 5
    rt.CellStyle.Spacing.All = 1
    rt.Style.Font = tbl.Font
    Rows = tbl.DataTable.Select("[地区] = '" & Region & "'")
    For c As Integer = 0 To tbl.Cols.Count - 1
        rt.Cells(0,c).Text = tbl.Cols(c).Name
        rt.Cols(c).Width = tbl.Cols(c).PrintWidth
        For r As Integer = 0 To Rows.Count -1
            rt.Cells(r + 1, c).Text = rows(r)(tbl.Cols(c).Name)
        Next
    Next
    rt.RowGroups(0,1).Header = prt.TableHeaderEnum.All
    doc.Body.Children.Add(rt)
    doc.preview()
Next


 回到顶部
帅哥哟,离线,有人找我吗?
大红袍
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/5/10 10:02:00 [只看该作者]


 回到顶部
美女呀,离线,留言给我吧!
joe_xgp
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:151 积分:1306 威望:0 精华:0 注册:2013/5/13 13:28:00
  发帖心情 Post By:2016/5/10 10:08:00 [只看该作者]

非常感激大红袍老师的不厌其烦的回复!太感激了!!!

 

感谢老师指点!!!


 回到顶部