以文本方式查看主题

-  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=63240)

--  作者:bigeng
--  发布时间:2015/1/16 18:20:00
--  [求助]表标题问题
甜版,我想把凭证的表标题居中,字体变大,该如何做呢,我找了一下,没找到相关的设置。另外,日期我想弄成yyyy年MM月dd日格式,dataformat下代码如下:e.value = format(e.value,"yyyy年MM月dd日"),单并未改变。
图片点击可在新窗口打开查看此主题相关图片如下:凭证标题.jpg
图片点击可在新窗口打开查看

--  作者:Bin
--  发布时间:2015/1/17 8:57:00
--  
上例子
--  作者:bigeng
--  发布时间:2015/1/17 15:10:00
--  
Bin版,麻烦您给看一下。
 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:练习用.rar


--  作者:Bin
--  发布时间:2015/1/17 15:26:00
--  
1.你不是已经实现了么

2.想要控制格式的话,就不能用日期框控件,只能用文本框.

--  作者:bigeng
--  发布时间:2015/1/17 15:46:00
--  
(1)我是想把:摘要、会计科目、.....这一行标题居中,行高增大一些,字体弄大点,因为这样打印出来太难看了。


--  作者:bigeng
--  发布时间:2015/1/18 10:32:00
--  
甜版,给看一下。
--  作者:有点甜
--  发布时间:2015/1/18 10:50:00
--  

打印代码

 

Dim doc As PrintDoc = e.Form.GernatePrintDoc()

For Each c As object In Doc.Body.Children
    If c.Gettype.Name Like "*Table*" Then
        Dim t As prt.RenderTable = c
        t.Rows(0).Height = 30
        t.Rows(0).Style.BackColor = Color.Red
        t.Rows(0).Style.Font = New Font("宋体", 12, FontStyle.Bold) \'设置字体
        For i As Integer = 0 To t.Cols.Count - 1
            t.Cells(0,i).Style.TextAlignHorz = prt.AlignHorzEnum.Center
        Next
    End If
Next

doc.Preview


--  作者:bigeng
--  发布时间:2015/1/18 11:32:00
--  
甜版,我的上面的例子中,data控件能够转成“yyyy年MM月dd日”格式吗?
--  作者:bigeng
--  发布时间:2015/1/18 11:34:00
--  
DateTimePicker控件
--  作者:有点甜
--  发布时间:2015/1/18 11:46:00
--  

 不能,打印之前处理一下

 

Dim doc As PrintDoc = e.Form.GernatePrintDoc()

Dim d As Date
For Each c As object In Doc.Body.Children
    If c.Gettype.Name Like "*Table*" Then
        Dim t As prt.RenderTable = c
        t.Rows(0).Height = 30
        t.Rows(0).Style.BackColor = Color.Red
        t.Rows(0).Style.Font = New Font("宋体", 12, FontStyle.Bold) \'设置字体
        For i As Integer = 0 To t.Cols.Count - 1
            t.Cells(0,i).Style.TextAlignHorz = prt.AlignHorzEnum.Center
        Next
    Else If c.Gettype.name Like "*Text*" AndAlso Date.TryParse(c.text, d) Then
        c.text = Format(cdate(c.text), "yyyy年MM月dd日")
    End If
Next

doc.Preview