简体   繁体   English

如何在Crystal Report中合并行?

[英]How to Merge Rows in Crystal Report?

i am using Crystal Report Version=10.2 , Visual Studio 2008 and displaying the result of stored procedure in crystal report my stored procedure returns output as shown below 我正在使用Crystal Report Version = 10.2,Visual Studio 2008并在crystal report中显示存储过程的结果我的存储过程返回输出,如下所示

在此输入图像描述

but i want to display in report as shown below 但我想在报告中显示如下所示

在此输入图像描述

thanks in advance 提前致谢

Use group for Com No. and put the details of Sub - Status and Date in the details section. 使用组Com No. ,并在详细信息部分中输入子状态和日期的详细信息。

Initially it will look like 最初它看起来像

---------------------------------------------
Com No.  |  Desc.    |   Status  |  Date     |
---------------------------------------------
   1     |   a       |
                     |    sub    | 01/01/2012|
                     |    ack    | 02/01/2012|
                     |    inv    | 03/01/2012|
---------------------------------------------

Then: 然后:

Use the section expert and set overlay on for the group. 使用专家部分并为该组设置叠加。 So you will get the following: 所以你会得到以下内容:

---------------------------------------------
Com No.  |  Desc.    |   Status  |  Date     |
---------------------------------------------
   1     |   a       |    sub    | 01/01/2012|
                     |    ack    | 02/01/2012|
                     |    inv    | 03/01/2012|
---------------------------------------------

Putting the value of Com No and Desc in the middle of the box is tricky. Com NoDesc的值放在框的中间是很棘手的。 If you know the number of rows in the detail section, you can increase the height of the group header in proportion can give you the result: 如果你知道详细信息部分中的行数,你可以按比例增加组头的高度,可以得到结果:

---------------------------------------------
Com No.  |  Desc.    |   Status  |  Date     |
---------------------------------------------
                     |    sub    | 01/01/2012|
   1     |   a       |    ack    | 02/01/2012|
                     |    inv    | 03/01/2012|
---------------------------------------------

First step 第一步

  1. create running total 创建运行总计
  2. select com no 选择com no
  3. summary will be count 总结将算一算
  4. for each record. 对于每条记录。
  5. reset select on change group 重置选择更改组
  6. save the running total as rtotal 将运行总计保存为rtotal

2nd step 第二步

  1. create a formula name will be total 创建公式名称将是总计
  2. add this "ceiling(count(Status,ComNo)/2)" this formula will find the middle point. 添加这个“天花板(count(Status,ComNo)/ 2)”这个公式将找到中间点。
  3. save the formula 保存公式

Third step 第三步

  1. create another formula name will be isSupress 创建另一个公式名称将是isSupress
  2. add this "if(#rtotal=total) then false else true" 添加这个“if(#rtotal = total)然后false,否则为true”
  3. save the formula 保存公式

4th step 第四步

  1. select com no. 选择com no。
  2. format object->suppress->formula format object-> suppress-> formula
  3. just place issupress formula 只是放置issupress公式
  4. save the suppress formula. 保存抑制公式。

Run the report. 运行报告。

或者,您可以使用交叉表来显示数据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM