FlexReport - Merge same value cells

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

  • Posted 13 November 2019, 8:01 pm EST

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

    Thanx
  • Replied 13 November 2019, 10:24 pm EST

    Hello,

    Though direct merging is not possible, you can hide the duplicate values using script, as explained in the blog link below:
    https://www.grapecity.com/blogs/flexreport-tips-and-tricks#duplicatevalues

    Hope it helps.

    Regards,
    Esha
  • Replied 14 November 2019, 8:45 pm EST

    Hello,

    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?

    http://helpcentral.componentone.com/nethelp/FlexReport/C1.Win.FlexReport.4~C1.Win.FlexReport.Field~HideDuplicates.html
  • Replied 14 November 2019, 10:28 pm EST

    FlexReport.zip
  • Replied 17 November 2019, 8:00 pm EST

    Hello,

    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).

    Thanks,
    Esha
  • Replied 26 December 2019, 1:31 am EST

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

    Hello,

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

    Regards.
  • Replied 2 January 2020, 4:21 pm EST

    Hello,

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

    Thanks.
  • 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.

    Regards,
    Esha
  • Replied 17 March 2020, 9:56 pm EST

    Hi,

    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:
    http://prerelease.componentone.com/dotnet452/c1winform/2020-t1/C1WinForms-452_4.5.20201.416.zip

    Thanks,
    Pragati
  • 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:

    https://www.grapecity.com/componentone/docs/win/online-flexreport/C1.Win.FlexReport.4.5.2~C1.Win.FlexReport.Section~OnFormat.html
    https://www.grapecity.com/componentone/docs/win/online-flexreport/C1.Win.FlexReport.4.5.2~C1.Win.FlexReport.Section~OnPrint.html

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

    Regards,
    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:

    https://www.grapecity.com/componentone/docs/win/online-flexreport/HidingaSectionIfthereisNoData.html
    https://www.grapecity.com/componentone/docs/win/online-flexreport/ShowingorHidingaFieldDependingonaValue.html

    Regards,
    Prabhat Sharma.
    FlexReportRunTimeDemo.zip
  • 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";

    Regards,
    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