Author Topic: tablestyle  (Read 1976 times)

0 Members and 1 Guest are viewing this topic.

sybold

  • Newt
  • Posts: 62
tablestyle
« on: April 16, 2013, 04:27:58 PM »
I'm having a problem with setting colors to a tablestyle when adding a new one.

I use the following code to set the colors, but when alering the table to have table breaks, the header bottom color isn't green but red.

what have i missed or did i do wrong.

Code: [Select]
                    ' TITLE ROWS
                    ts.SetGridColor(Color.FromColorIndex(ColorMethod.ByAci, 5), _
                                    CInt(GridLineType.HorizontalBottom), _
                                    CInt(RowType.TitleRow))
                    ts.SetGridColor(Color.FromColorIndex(ColorMethod.ByAci, 5), _
                                    CInt(GridLineType.HorizontalTop), _
                                    CInt(RowType.TitleRow))
                    ts.SetGridColor(Color.FromColorIndex(ColorMethod.ByAci, 5), _
                                    CInt(GridLineType.VerticalLeft), _
                                    CInt(RowType.TitleRow))
                    ts.SetGridColor(Color.FromColorIndex(ColorMethod.ByAci, 5), _
                                    CInt(GridLineType.VerticalRight), _
                                    CInt(RowType.TitleRow))
                    ' HEADER ROWS
                    ts.SetGridColor(Color.FromColorIndex(ColorMethod.ByAci, 3), _
                                    CInt(GridLineType.HorizontalBottom), _
                                    CInt(RowType.HeaderRow))
                    ts.SetGridColor(Color.FromColorIndex(ColorMethod.ByAci, 5), _
                                    CInt(GridLineType.VerticalLeft), _
                                    CInt(RowType.HeaderRow))
                    ts.SetGridColor(Color.FromColorIndex(ColorMethod.ByAci, 5), _
                                    CInt(GridLineType.VerticalRight), _
                                    CInt(RowType.HeaderRow))
                    ts.SetGridColor(Color.FromColorIndex(ColorMethod.ByAci, 3), _
                                    CInt(GridLineType.HorizontalInside), _
                                    CInt(RowType.HeaderRow))
                    ts.SetGridColor(Color.FromColorIndex(ColorMethod.ByAci, 3), _
                                    CInt(GridLineType.HorizontalInside), _
                                    CInt(RowType.HeaderRow))
                    ts.SetGridColor(Color.FromColorIndex(ColorMethod.ByAci, 1), _
                                    CInt(GridLineType.VerticalInside), _
                                    CInt(RowType.HeaderRow))

                    ' DATA ROWS
                    ts.SetGridColor(Color.FromColorIndex(ColorMethod.ByAci, 5), _
                                    CInt(GridLineType.HorizontalBottom), _
                                    CInt(RowType.DataRow))
                    ts.SetGridColor(Color.FromColorIndex(ColorMethod.ByAci, 3), _
                                    CInt(GridLineType.HorizontalTop), _
                                    CInt(RowType.DataRow))
                    ts.SetGridColor(Color.FromColorIndex(ColorMethod.ByAci, 5), _
                                    CInt(GridLineType.VerticalLeft), _
                                    CInt(RowType.DataRow))
                    ts.SetGridColor(Color.FromColorIndex(ColorMethod.ByAci, 5), _
                                    CInt(GridLineType.VerticalRight), _
                                    CInt(RowType.DataRow))
                    ts.SetGridColor(Color.FromColorIndex(ColorMethod.ByAci, 1), _
                                    CInt(GridLineType.InnerGridLines), _
                                    CInt(RowType.DataRow))

Andrey Bushman

  • Swamp Rat
  • Posts: 864
Re: tablestyle
« Reply #1 on: April 25, 2013, 05:57:22 AM »
I think the best way is the creating of the table through the necessary table style. You can create detailed settings for the table style and then apply this for the new tables. Also you can use template in your table style. You can look the detailed sample here.