4

我的 InfoPath 表单中有几行最初排列在一个表中。之后,我有一个由单行组成的重复部分,供用户以重复的方式逐行输入数据。每一行都需要索引,索引从上表最后一行的索引开始。

InfoPath 2010 中没有可用于自动递增的“表达式框”控件,如 Web 上的多个其他来源所述。

我不需要在提交后对表格进行编号。当用户在浏览器中填写表单时在重复部分下输入值时,我希望 ROWS 自动编号。

有没有办法解决这个问题?或者,有什么公式可以用吗?

4

2 回答 2

3

I can be done using the count function, example:

count(../preceding-sibling::*) + 1

You will need to have a field in your repeating group for the ID, then go to that field's properties and set it's default value to that function using the formula button. You'll then have to edit xpath values to set the value to that function call.

于 2012-09-12T02:12:22.090 回答
1

注意:我使用的是 InfoPath 2007,所以我不能 100% 确定这适用于 InfoPath 2010

我一直在寻找类似的东西,除了我只是想让我的重复部分显示一个数字。

@firestream 的答案几乎对我有用,但由于某种原因,第一部分没有设置。它们被编号为“空白,2,3,4,...”此外,我不需要数字在数据源中持久存在,也不想要额外的字段。

我只是创建了一个表达式框控件,并将 XPath 设置为count(preceding-sibling::*)+1

于 2013-03-29T21:21:54.033 回答