ADF - Groovy for Total Sum of a Column in a Table - adf表格加合计

ADF - Groovy for Total Sum of a Column in a Table - adf表格加合计,第1张

概述We will be looking in this article as how we can add Total of a column in a table. Very often we require to have total of a column in a table. For example , we might need total sum of Salary column in We will be looking in this article as how we can add Total of a column in a table. Very often we require to have total of a column in a table. For example,we might need total sum of Salary column in the table.
We will be Leveraging power of Groovy in accomplishing this task.
So lets see how we can do this.
Use Case :- Add a Total Salary Attribute below Salary column in Employees table.

Model Project
ConsIDering that we have EmployeesVIEw VO object which is based on Employees EO,go to attributes of VO and click add new attribute. Select "Add new Attribute". It will by default be transIEnt. Give this attribute  name as TotalSal.



Now go to VIEw Accessors tab and click on green + sign to create new VIEw Accessor.
Select EmployeesVIEw from the first window and shuttle it so that you can see like below.



Do ok and it should be like below screenshot.



Now go to attributes tab and select the new transIEnt attribute (TotalSal). Give its Default value as Expression and give Groovy Expression as EmployeesVIEw1.sum("Salary") .



VIEw Project Create a new page. Drag and Drop EmployeesVO from data control and create a new read only table "without" TotalSal Attribute.
Now go to Salary Column in Structure and do a right click and select footer from facet as shown below.



Now from EmployeesVIEw1 in DataControl,drag and drop TotalSal column in this new footer facet.




Now go to bindings and create a new binding for this variable.



And change the value of footer output text with this binding.



Save all and run this page.



Hope this was useful.
Happy Learning !! 总结

以上是内存溢出为你收集整理的ADF - Groovy for Total Sum of a Column in a Table - adf表格合计全部内容,希望文章能够帮你解决ADF - Groovy for Total Sum of a Column in a Table - adf表格加合计所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/langs/1265375.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-08
下一篇 2022-06-08

发表评论

登录后才能评论

评论列表(0条)

保存