以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  表格格式  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=80277)

--  作者:kaituozhe
--  发布时间:2016/1/19 21:03:00
--  表格格式

我想设计如例子中的表格,第一行及G列的单元格不显边框,该怎么处理

 

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


--  作者:大红袍
--  发布时间:2016/1/19 21:23:00
--  

要这样做才行。

 

Dim t As Table = Tables("表A")
Dim cs1 As C1.Win.C1FlexGrid.CellStyle = t.Grid.Styles.Add("样式1")
Dim cs2 As C1.Win.C1FlexGrid.CellStyle = t.Grid.Styles.Add("样式2")
Dim cs3 As C1.Win.C1FlexGrid.CellStyle = t.Grid.Styles.Add("样式3")

For i As Integer = 0 To t.rows.count - 1
    For j As Integer = 0 To t.cols.count - 1
        If j <> 7 Then
            If i = 0 Then
                t.Grid.SetCellStyle(i + 1, j + 1, cs2)
            Else
                t.Grid.SetCellStyle(i + 1, j + 1, cs1)
            End If
        Else
            If i = 0 Then
            Else
                t.Grid.SetCellStyle(i + 1, j+1, cs3)
            End If
        End If
    Next
Next
cs1.Border.Width = 3
cs1.Border.Color = Color.Red
cs1.Border.Direction = 0
cs2.Border.Width = 3
cs2.Border.Color = Color.Red
cs2.Border.Direction = 1
cs3.Border.Width = 3
cs3.Border.Color = Color.Red
cs3.Border.Direction = 2


--  作者:kaituozhe
--  发布时间:2016/1/19 21:27:00
--  

我的意思在专业报表中设计那样的表

 


--  作者:大红袍
--  发布时间:2016/1/19 21:35:00
--  

 那你就控制好单元格的边框就行啊,参考2楼代码啊。

 

http://www.foxtable.com/help/topics/1169.htm

 


--  作者:大红袍
--  发布时间:2016/1/19 21:36:00
--  
不会做,就上传具体例子。
--  作者:kaituozhe
--  发布时间:2016/1/19 21:37:00
--  

某一行或某一个单元格的边框怎么设置


--  作者:大红袍
--  发布时间:2016/1/19 21:40:00
--  
Dim doc  As New PrintDoc  \'定义一个报表
Dim rt As New prt.RenderTable() \'定义一个表格对象
doc.Body.Children.Add(rt) \'将表格对象加入到报表中
\'下面的代码向表格中填入值
For r As Integer =  0  To  5
    For c As  Integer =  0  To  5
        rt.Cells(r, c).text = r &  "," & c  \'为文本对象设置内容
        rt.cells(r, c).Style.Borders.Bottom = New  prt.Linedef(1, Color.Green)
    Next
Next
doc.Preview() \'预览报表

--  作者:kaituozhe
--  发布时间:2016/1/19 21:45:00
--  

 rt.Style.GridLines.All = New prt.LineDef \'将网格线类型设为默认类型
rt.rows(0).Style.GridLines.bottom = New prt.LineDef

rt.cols(12).Style.GridLines.Left = New prt.LineDef

rt.cols(12).Style.GridLines.Right = New prt.LineDef

我的想法是第一行只有下边框线没有上边框及左右边框,第13列只有左右边框线没有上下边框,其他行的边框都有,上述设置对吗


--  作者:大红袍
--  发布时间:2016/1/19 22:27:00
--  

Dim doc  As New PrintDoc  \'定义一个报表
Dim rt As New prt.RenderTable() \'定义一个表格对象
doc.Body.Children.Add(rt) \'将表格对象加入到报表中
\'下面的代码向表格中填入值
For r As Integer =  0  To  5
    For c As  Integer =  0  To  5
        rt.Cells(r, c).text = r &  "," & c  \'为文本对象设置内容
        \'rt.cells(r, c).Style.Borders.all = New  prt.Linedef(1, Color.Green)
    Next
Next

rt.Style.GridLines.All = New prt.LineDef \'将网格线类型设为默认类型
rt.rows(0).Style.GridLines.Top = New  prt.Linedef(0.5, Color.White)
For c As Integer = 0 To 5
    rt.cells(0, c).Style.GridLines.left = New  prt.Linedef(0.5, Color.White)
    rt.cells(0, c).Style.GridLines.right = New  prt.Linedef(0.5, Color.White)
Next
For r As Integer = 0 To 5
    rt.cells(r, 4).Style.GridLines.top = New  prt.Linedef(0.5, Color.White)
    rt.cells(r, 4).Style.GridLines.bottom = New  prt.Linedef(0.5, Color.White)
Next
doc.Preview() \'预览报表