How to Merge columns in crystal report

2019-07-28 07:46发布

问题:

I am working on crystal report in visual studio 2008. In crystal report i have two field BranchName and Types. What i want is if BranchName and Types are same then merge all columns for that specific row and display only BranchName with Bold style in that row.

--------------------------------------
Branch Name  |  Types   |   Status   |
--------------------------------------
    abc      |    abc   |            |
--------------------------------------
    xyz      |    mnl   |            |
--------------------------------------

and i want it as

--------------------------------------
Branch Name  |  Types   |   Status   |
--------------------------------------
               abc                   |
------------------------------------- 
    xyz      |   mnl    |            |
--------------------------------------

How can i do this?

回答1:

I did bit similar functionlity through supress field by condition ..

right click on field palced on report and click on button next to "supress" check box then add condition if "Branch Name" and "Types" value are same return true else false

apply this condition for Branch Name and Status fields

this will not print value for Branch Name and Status when condition match



回答2:

I don't think merging is possible in crystal report but you can achive this using supress condition.

  1. Create filed that extends from Branch name to Status.
  2. Now create 3 filds individually for all 3 columns
  3. Now write a supress condition for 3 individual columns as

    If Branch name==Types true else false

  4. Create a similar condition for 3 individual columns as

    If Branch name<>Types true else false



回答3:

for merging in crystal report we need dynamic lines,but lines cant suppress in crystal report, there for we use a Text Object with border as a line, then you can use this condition for suppressing your line:

if BranchName = Types then true else false

you can suppress BranchName and Types same as suppressing the line which i said befor and finally u can create a formula and write this in it:

if BranchName = Types then BranchName else ''