以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  专业报表的日期格式  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=44254)

--  作者:石四
--  发布时间:2013/12/26 14:59:00
--  专业报表的日期格式

帮助文件事例:分组打印,将客户表换成订单表,按日期分组打印.

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()

 

 

前几天分组日期格式已捣鼓好了,没有及时做笔记,今天怎么都捣鼓不回去.帮帮忙:

 rx.Text = "日期: " & Region
怎么格式化?


--  作者:Bin
--  发布时间:2013/12/26 15:05:00
--  
分组不就是这样吗?    格式化?  格式化日期?   
--  作者:石四
--  发布时间:2013/12/26 15:10:00
--  
要去掉日期后面的尾巴:
图片点击可在新窗口打开查看此主题相关图片如下:88.jpg
图片点击可在新窗口打开查看

--  作者:Bin
--  发布时间:2013/12/26 15:13:00
--  
rx.Text = "日期: " & Region.split(" ")(0)
--  作者:石四
--  发布时间:2013/12/26 15:20:00
--  
以下是引用Bin在2013-12-26 15:13:00的发言:
rx.Text = "日期: " & Region.split(" ")(0)

这个用法第一次看到,谢谢!