How to Merge columns in crystal report

故事扮演 提交于 2019-12-11 08:59:18

问题


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 ''



来源:https://stackoverflow.com/questions/20856721/how-to-merge-columns-in-crystal-report

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!