Search code examples
sql-servercrystal-reportsduplicates

Merge duplicate rows where fields are different


These are my query results:

enter image description here

But I want to merge the MemberName column when the member is the same. But the values in the other columns still need to display separately. How can I make my report use the following format?

enter image description here


Solution

  • Create a Group for SIno at the lowest level, if you don't have one already. Suppress the header and footer of this group.

    Then add this formula to the suppression logic for SIno, Member Name, and Sanity Code:

    {SIno} = PREVIOUS({SIno})
    

    After discussing your needs in the comments, I recommend the following: Set your report such that it doesn't have any borders, and instead have the background color alternate between white and gray. Group based on SIno if you haven't already, and set the background color to:

    IF GROUPNUMBER MOD 2 = 0 THEN crWhite else crSilver
    

    I do this all the time with my reports. It looks professional, and the customers understand it:

    enter image description here