如何在水晶报表中记录为空时删除新行

时间:2015-07-08 12:06:54

标签: crystal-reports

很抱歉,如果它重复或等等。

我想在Crystal Report中显示记录,如

String1 | String2 | String3 | String4 |

------------------| 12345  |

------------------| 12345  |

String3包含4个fieldfield1-4

但是我的代码不像那样

String1 | String2 | String3 | String4 |

------------------|  12345 |

------------------|  12345 |

------------------|--------|

------------------|--------|

我想要做的是显示记录,当它有一些数据,我有4条记录,如果一条或多条记录包含一些数据,那么其他记录不会创建新行,所以不会占用空间。

if {Table.Field1} = "0" then 
""
else if {Table.Field2} = "0" then
""
else if {Table.Field3} = "0" then 
""
else if {Table.Field4} = "0" then 
""
else
{Table.Field1} & "<br>" & {Table.Field2} & "<br>" & {Table.Field3} & "<br>" & {Table.Field4}

在Crystal Report上使用Can Grow和文字解释HTML Text

1 个答案:

答案 0 :(得分:0)

一个方法是使用启用了背景颜色的文本字段。

基本思想是将文本字段放在与报告匹配的背景中,并为文本字段写下supress条件,以便在没有数据时显示else supress。

这将确保在没有数据的情况下,文本字段将覆盖该行,这将给出不打印行的印记。

编辑---------------------------------------------- -----------------

现在在下面的图片中,我在行之间放置了一个文本字段,并将背景颜色设置为与我的预览相匹配的白色。

enter image description here 检查行尾

的矩形突出显示部分

现在在预览中,您可以看到没有放置文本字段的行。

enter image description here

相关问题