Formatting cells in groupfooter

Posted by: tosch on 8 September 2017, 5:21 am EST

  • Posted 8 September 2017, 5:21 am EST

    How can I format the cells in a group footer?

    When I use an aggregate function to sum all the values in a column for a group the sum is displayed left aligned, but I want number to be right aligned. Can I also change the font or backcolor?

     

     

  • Replied 8 September 2017, 5:21 am EST

    Hello Tosch,


    You can format the text in ColumnFooter using appropriate properties like HorizontalAlignment ,Font and BackColor etc. Here is the code to achieve the same:


    <BLOCKQUOTE>

                Font fn = new Font("Ms Sans Sarif", 8.25F, FontStyle.Bold);
                fpSpread1.Sheets[0].ColumnFooter.Columns[2].HorizontalAlignment = FarPoint.Win.Spread.CellHorizontalAlignment.Right;
                fpSpread1.Sheets[0].ColumnFooter.Columns[2].Font = fn;
                fpSpread1.Sheets[0].ColumnFooter.Columns[2].BackColor = Color.Red;

    </BLOCKQUOTE>

    Thanks.

  • Replied 8 September 2017, 5:21 am EST

    Nothing happens when I do this. I have inserted your code in then Grouped event and also tried to insert it after setting I make GroupBarInfo visible.

     I'm using Spread 5.0.3503.2008.

  • Replied 8 September 2017, 5:21 am EST

    Hello Tosch,


    If you have applied the formatting in the Grouped event than you will be able to get that once grouping will be done. And in case you want the formatting in ColumnFooter as soon as form loads then set it in FormLoad event. Please have a look at the sample and let us know your observations on the same.


    Thanks.


    2010/06/GroupFooterV5-2.zip
  • Replied 8 September 2017, 5:21 am EST

    ok, I think I got confused with groupfooter and columnfooter.

     

    I
    want to apply the formatting to the <b>groupfooter</b>.

    Please
    see my other thread regarding aggregate sums on different levels for an image of what I want.
  • Replied 8 September 2017, 5:21 am EST

    Hello Tosch,

    Your post has been answered here.

    Thanks.

  • Replied 21 November 2017, 4:26 am EST

    I'm getting an Error 404 when trying to use the link in Reeva's reply of
    8 September 2017, 2:21 pm EST

    http://www.clubfarpoint.com/Forums/forums/90198/ShowThread.aspx#90198

    I need to format a GroupFooter (not a ColumnFooter).

    For example, see blue rows in attachment.

    I need to make them Black and Bold.

    Any help with which you can provide me would be deeply appreciated.

  • Replied 22 November 2017, 9:36 am EST

    Found it in:

    2015/10/GroupFooterSpread.zip

    FarPoint.Win.Spread.GroupInfo gi = new FarPoint.Win.Spread.GroupInfo();
    gi.FooterBackColor = Color.Plum;
    gi.FooterForeColor = Color.Black;
    gi.FooterFont = fn;

    gi.FooterForeColor = Color.Black;
    gi.FooterFont = fn;
  • Replied 11 February 2021, 2:07 am EST

    When fpspread is dragged from the toolbox the groupfooter backcolor does not work, but when created through the initialization the backcolor does work. What is the setting that is preventing this when using the grid from the toolbox.

    2015/10/GroupFooterSpread.zip works

    2010/06/GroupFooterV5-2.zip only shows lines no colors
  • Marked as Answer

    Replied 14 February 2021, 9:17 pm EST

    Hi Mark,

    We don't see the difference in behavior on using the toolbox or code, at our end. To set the appearance of the group rows, you need to use the GroupInfo. Please refer to the sample attached. For information please visit: https://www.grapecity.com/spreadnet/docs/v14/online-win/spwin-group-appear.html .

    Regards.
    Avnish.
    SpreadFooterBColor.zip
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels