SharePoint 列表计算
我想知道是否有一种方法可以在共享点中有一列,该列是当前列和前一列的总和,
就像这样
Title Value Total
entry1 10 10
entry2 20 30
entry3 20 50
I was wondering is there a way to have a column in share point that is a sum but only of the current column and the previous column
Like this
Title Value Total
entry1 10 10
entry2 20 30
entry3 20 50
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为它不可能开箱即用,但根据您的要求,可能可以创建您自己的字段类型来实现这一点。 以下是有关 SharePoint 中自定义字段类型的一些信息:http://msdn.microsoft。 com/en-us/library/ms446361.aspx
如果更改列表中的视图,该值是否会自动更改? 如果是这样,您就陷入困境了,因为列表视图中的值是使用 CAML 渲染模式计算的。 我想使用 JavaScript 可以做到这一点,但我不推荐它。
如果您始终具有相同的视图,则可以重复使用视图中的 CAML 查询来获取当前正在编辑的列表项之前的列表项。 然后,您必须设置当前列表项中的字段值并更新所有其他受影响的项目。
I dont think its possible out of the box, but depending on your requirements it might be possible to create your own field type which does it. Here's some info on custom field types in SharePoint: http://msdn.microsoft.com/en-us/library/ms446361.aspx
Should this value automatically change if you change the view in the list? If so, you're in deep water since the value in a lists view is calculated using a CAML render pattern. I guess it would be possible to do it using JavaScript, but I wouldn’t recommend it.
If you always have the same view you can reuse the CAML query from the view to get the list item just before the one you are currently editing. Then you'll have to set the value of the field in the current list item as well as updating all other affected items.
如果您对这样的显示有要求,您可能会发现根本不将其存储为列,而是使用输出表视图的 SharePoint Designer(或您选择的 Web 部件创建机制)执行数据表单 Web 部件更容易这看起来像你想要的。 我认为使用带有一两个变量的 XSLT 模板进行这种运行总计应该相对容易。
我认为没有一种有效的方法可以用实际的列来做到这一点。
If you have requirements for a display like this, you may find it easier to not store it as a column at all but just do a data form web part using SharePoint Designer (or your web part creation mechanism of choice) that outputs a table view that looks like what you want. I think it should be relatively easy to do that kind of running total with an XSLT template with a variable or two.
I don't think there is going to be an efficient way to do this with an actual column.