FlexReport - Merge same value cells

Posted by: mary431982 on 13 November 2019, 8:01 pm EST

  • Posted 13 November 2019, 8:01 pm EST

    is it possible to merge cells with same value in FlexReport column in detail?

  • Replied 13 November 2019, 10:24 pm EST


    Though direct merging is not possible, you can hide the duplicate values using script, as explained in the blog link below:

    Hope it helps.

  • Replied 14 November 2019, 8:45 pm EST


    I used to use property HideDuplicates in C1 which also exists in FlexReport but its not working. Why I must use your script instead of property HideDuplicates?

  • Replied 14 November 2019, 10:28 pm EST

  • Replied 17 November 2019, 8:00 pm EST


    This field that you refer to, is a Legacy Field. It is the field based on the Field class (as in C1Report), instead of the FieldBase class. However, I understand that the HideDuplicates property of this field should work as expected and hence, I have escalated this issue to the concerned team [Internal Tracking ID: 407641]. Will get back to you when I receive any update.
    Specifically FlexReport related TextFields do not have this property and for using them, scripts can used (as previously mentioned).

  • Replied 26 December 2019, 1:31 am EST

    Hello, did your team solved this? Regards
  • Replied 26 December 2019, 10:29 pm EST


    I have requested the team for an update. Will get back to you once I receive any information.

  • Replied 2 January 2020, 4:21 pm EST


    Just for our information, do you use C1.web.api.report here as well?

  • Replied 2 January 2020, 8:07 pm EST

    :) Yes.
  • Replied 5 January 2020, 8:49 pm EST

    Thank you for the information.
    The issue will be fixed with 2020v1 release.

  • Replied 17 March 2020, 9:56 pm EST


    I am glad to inform you that the issue has been fixed in the latest build (i.e. 2020v1). You can get it from here:

  • Replied 28 July 2020, 11:31 pm EST

    Hello, I would like to use the script that you have mentioned here but I need to know how to use the script in a dynamically created report. I am building the report dynamically in code setting up the report header, page header, detail, and page footer. I need to know how to add script dynamically also so it can use the script when the report is built to omit duplicates.
  • Replied 29 July 2020, 8:00 pm EST

    Hi Bernard,

    You can use the OnFormat or OnPrint property of the Section class of the FlexReport to write your script.
    The links for the same is given below:


    If you need any other help, please let me know.

    Prabhat Sharma.
  • Replied 30 July 2020, 11:08 pm EST

    The URLs you provided respond with an Invalid URL message. And I did see the OnFormat property but didn't know how to set this property. I need to know how I can add multiple lines of script so a full If condition can be interjected.
  • Replied 3 August 2020, 4:54 pm EST

    Hi Bernard,

    Sorry for the invalid URLs.
    I have attached a demo sample which shows how you can write scripts via code at runtime, please take a look.
    You can also go through the following links which demonstrate the same:


    Prabhat Sharma.
  • Replied 4 August 2020, 12:20 am EST

    I tried a few options here and I can get the ForeColor of a field to change based on the values of fields in the Detail but I can seem to change the BackColor. I found a sample where someone is using a count and the mod function to check for every other line and set the background color but it won't work. Can you tell me what I am doing wrong?

    Public LineColor As String = "cnt = cnt + 1" & vbCrLf & _
    "If cnt Mod 2 = 0 Then" & vbCrLf & _
    " Detail.BackColor = RGB(211,211,211)" & vbCrLf & _
    "Else" & vbCrLf & _
    " Detail.BackColor = vbWhite" & vbCrLf & _
    "End If"

    ' Create the Detail section
    s = C1FlexReport1.Sections(SectionTypeEnum.Detail)
    s.Name = "Detail"
    s.Height = 500
    s.Visible = True
    s.AutoHeight = AutoSizeBehavior.GrowAndShrink
    s.Border = New Border(2, Color.Black, DashStyle.Solid)
    s.OnFormat = LineColor

  • Marked as Answer

    Replied 4 August 2020, 7:22 pm EST

    Hi Bernard,

    Please use the code snippet given below to do the same:

    c1FlexReport1.OnOpen = "_styleCtr = 0";
    c1FlexReport1.Sections.Detail.OnPrint = "detail.BackColor = iif(_styleCtr mod 2 = 0, rgb(211, 211, 211), vbWhite)_styleCtr = _styleCtr + 1";

    Prabhat Sharma.
  • Replied 5 August 2020, 12:10 am EST

    Okay, that works! Thanks!
Need extra support?

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

Learn More

Forum Channels