简体   繁体   English

Web表单数据结构替代

[英]Web form data structure alternatives

Once I created a form builder where user could select any number of fields for a web form. 创建完表单构建器后,用户可以在其中选择Web表单的任意数量的字段。 The tool then produced a code snippet which user could copy in the JSP. 然后,该工具生成了一个代码段,用户可以在JSP中复制该代码段。

The submitted form data was stored as a key-value pairs in the DB, so basically just two columns were required for the form specific data. 提交的表单数据作为键值对存储在数据库中,因此对于表单特定的数据基本上只需要两列。 If I remember right, the processing of the DB data was required to be done outside Java. 如果我没记错的话,则需要在Java外部进行DB数据的处理。

So creating nice excel output of this was a bit tricky. 因此,为此创建好的excel输出有点棘手。 I ended up using iReport and its crosstab functionality but it wasn't a nice experience. 我最终使用了iReport及其交叉表功能,但这并不是一个很好的体验。

Are there better ways to store such form data than just using key-value pairs? 是否有比仅使用键值对更好的存储此类表单数据的方法? Or are there some nice approaches to crosstab/pivot key-value data for reporting? 还是有一些很好的方法可以交叉表/透视键值数据进行报告?

I try to follow the The Rule of Least Power - Using the simplest structure possible for the data gives you much more flexibility in display. 我尝试遵循最小功率规则 -使用尽可能简单的数据结构为您提供更大的显示灵活性。 That said, Excel's pivot table functionality is definitely very nice for simple data structures. 也就是说,Excel的数据透视表功能对于简单的数据结构绝对非常好。 After creating one, you might want to try the pivot chart functionality connected to it to visualize the data flexibly - Any changes to the pivot table are reflected in the pivot chart automatically. 创建数据透视表后,您可能想尝试与其连接的数据透视表功能以灵活地可视化数据-对数据透视表的任何更改都会自动反映在数据透视表中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM