在组头中显示详细信息

时间:2015-10-12 17:47:17

标签: crystal-reports

我想将所有名字记录放在一个组中,并将其显示在组标题中。但是我在正确重置变量时遇到了问题。 到目前为止我正在使用

@FirstName //this formula is in the details section
global StringVar FirstName; 
If previous ({Customer.FirstName})<> ({Customer.FirstName}) Then FirstName:="";
FirstName := FirstName + {customer.FirstName};

然后..

@CompleteFirstName //this formula is in the groupheader 
global StringVar FirstName; 
FirstName;

问题是组标题显示在错误的部分, 第一个组标题为空,然后第二个组标题显示第一个组的信息

1 个答案:

答案 0 :(得分:0)

写这样的公式

SELECT * FROM ints;
+---+
| i |
+---+
| 0 |
| 1 |
| 2 |
| 3 |
| 4 |
| 5 |
| 6 |
| 7 |
| 8 |
| 9 |
+---+

SELECT DISTINCT SUBSTRING_INDEX(SUBSTRING_INDEX('1111-2222-3-4-55-12345678901234567','-',i+1),'-',-1) x FROM ints;
+-------------------+
| x                 |
+-------------------+
| 1111              |
| 2222              |
| 3                 |
| 4                 |
| 55                |
| 12345678901234567 |
+-------------------+

并将其放入群组页脚中。问题解决了。很抱歉第一次被误解了。