Foxtable(狐表)用户栏目专家坐堂 → [求助]单元格数字上面加标注


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

主题:[求助]单元格数字上面加标注

帅哥哟,离线,有人找我吗?
有点甜
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2017/9/13 15:19:00 [显示全部帖子]


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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2017/9/18 18:42:00 [显示全部帖子]

 

 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:上下标绘制.table


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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2017/9/26 16:39:00 [显示全部帖子]

Dim e = Args(0)
Dim ColName As String = Args(1)

If e.Col.Name = ColName Then
    Dim i1 As Integer
    Dim i2 As Integer
    Dim ary() As String = e.text.split("*")
    Dim swidth As Double = 0
    For i As Integer = 0 To ary.length-1
        Dim t As String = ary(i)
        Dim ts() As String = {"",""}
        If t.Contains("|")
            Dim ts2() As String = t.Split("|")
            ts(0) = ts2(0)
            ts(1) = ts2(1)
        Else
            ts(0) = t
        End If
        Dim reg As new System.Text.RegularExpressions.Regex("|[+0-9\d\./a-zA-Z→]+$")
        Dim reg1 As new System.Text.RegularExpressions.Regex("|[+0-9\d\-+./a-zA-Z→]+$")
       
        If ts.Length >= 2 AndAlso  reg.IsMatch(ts(0))  Then
            Dim RectF As RectangleF     '绘制区域
            Dim fnt1 As Font = e.Table.Grid.Cols(e.Col.Name).Style.Font.Clone()   '获取大字体
            If e.Height > fnt1.Height Then
                RectF = New RectangleF(e.x+swidth,e.y + (e.Height - fnt1.Height)/2,e.Width ,fnt1.Height)
            Else
                RectF = New RectangleF(e.x+swidth,e.y,e.Width ,e.Height)
            End If
           
            Dim FI As New C1.C1Preview.Util.FontInfo(fnt1)
            Dim fnt2 As New Font(fnt1.Name,FI.SuperscriptSize)                     '获取小字体
            Dim size As SizeF = e.Graphics.MeasureString(ts(0), fnt1)              '计算大字体的位置
           
            Dim sf As new StringFormat
            sf.Trimming = 0
            e.Graphics.DrawString(ts(0),fnt1,Brushes.Red,RectF ,sf)
            swidth += size.width
            Dim s1 As object
            If ts(1) > "" AndAlso reg1.IsMatch(ts(1)) Then
                e.Graphics.DrawString(ts(1),fnt2,Brushes.Red,new RectangleF(e.x+swidth-10,RectF.y ,RectF.Width,RectF.Height) ,sf)
                s1 = e.Graphics.MeasureString(ts(1), fnt2)
                swidth += s1.width-7
            End If
                        
            If i < ary.length-1 Then
                e.Graphics.DrawString("*",fnt1,Brushes.Red, (e.x+swidth-10), RectF.y,sf)
                size = e.Graphics.MeasureString("*", fnt1)
            End If
            e.Text = ""
        End If
    Next
End If


 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2017/11/14 17:16:00 [显示全部帖子]

导出excel报表还是专业报表?

 

excel可以用vba处理 http://www.foxtable.com/webhelp/scr/2121.htm

 

专业报表、或者文档打印的话,那没办法的。没有上标的方法。除非你用图片显示。

[此贴子已经被作者于2017/11/14 17:16:32编辑过]

 回到顶部