分层数据的 Excel 布局

发布于 2024-09-03 00:41:01 字数 633 浏览 5 评论 0原文

我正在开发 Excel 批量上传功能,该功能必须使用 Java API 进行解析。
我的问题是设计它的布局。数据是分层的,有 4 个级别,每个级别都有一对多关系。

1-other data for node 1
  -2-other data for node 2
   -3-other data for node 3
    -4-other data for node 4

这会重复

,例如-

Organisation id - Organisation name - Address etc...
 - Department id - Department name - etc...(multiple departments for each organisation)
   - Manager id - Manager name - etc...(multiple managers for each department)
     - Employee id - Employee name - etc...(multiple employees for each manager)

如何在Excel布局中进行设计,以便非技术用户可以轻松输入数据以及程序解析和建立父子关系?

I am working on an excel bulk upload feature which has to be parsed using Java API.
My problem is designing its layout. The data is hierarchical with 4 levels and one to many relationship at each level.

1-other data for node 1
  -2-other data for node 2
   -3-other data for node 3
    -4-other data for node 4

And this repeats

e.g. -

Organisation id - Organisation name - Address etc...
 - Department id - Department name - etc...(multiple departments for each organisation)
   - Manager id - Manager name - etc...(multiple managers for each department)
     - Employee id - Employee name - etc...(multiple employees for each manager)

How can this be designed in excel layout so that it's easy for a non technical user to input data as well as for the program to parse and establish parent child relationship?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

魔法少女 2024-09-10 00:41:01

重点支持非技术用户。有了 Java,您就有了一个强大的工具来解析最奇怪的数据源;)

假设关系是严格的一对多,我建议采用以下方法:

(1)为组织、部门、经理和员工创建四个电子表格。这些电子表格反映了数据库表

(2) 创建第五个电子表格来表示关系,例如:

 |A    |B    |C    |D    |
-+-----+-----+-----+-----+    
1| emp | mgr | dep | org |
-+-----+-----+-----+-----+
2|    v|    v|    v|    v|
-+-----+-----+-----+-----+
3|    v|    v|    v|    v|
-+-----+-----+-----+-----+

“v”字母仅表示组合框,用户可以在其中选择组织等。值来自其他电子表格,单元格将存储id 并显示可读的名称。

编辑

为了澄清 - 每行代表一个员工的数据集。我更改了列的顺序以使其更清晰。首先在四张表中输入所有实体(组织、部门……),然后使用组合框选择员工、他/她的经理、部门和组织。对我来说,这是非常直观和简单的。

Excel 支持这些类型的组合框,其中值来自电子表格。

Focus on supporting the non-technical users. With Java you have a powerful tool to parse even the weirdest data sources ;)

Assuming, the relations are strict one-to-many, I suggest the following approach:

(1) create four spreadsheets for origanisation, department, manager and employee. Those spreadsheets reflect the database tables

(2) create a fifth spreadsheet to represent the relations, like:

 |A    |B    |C    |D    |
-+-----+-----+-----+-----+    
1| emp | mgr | dep | org |
-+-----+-----+-----+-----+
2|    v|    v|    v|    v|
-+-----+-----+-----+-----+
3|    v|    v|    v|    v|
-+-----+-----+-----+-----+

the 'v' letters just represent combo boxes where the user can select organisations, etc. The values come from the other spreadsheets, the cells will store the id and display the readable name.

Edit

For clarifiction - each row represents a data set for an employee. I changed the order of the columns to make it clearer. First enter all entities (organisations, departments, ...) in the four sheets, then use the combo boxes to choose an employee, his/her manager, the department and the organisation. To me it's pretty intuitive and easy.

excel supports those types of combo boxes where the values come from a spreadsheet.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文