导出/导入到Excel与组合框 [英] Export/import to Excel with combo box

查看:131
本文介绍了导出/导入到Excel与组合框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我仍然有我的方案挣扎。我到处找一个解决方案,并不能找到一个解决方案。我使用C#和ASP.NET,我需要将数据导出到Excel US preadsheet。

I'm still struggling with my scenario. I have looked everywhere for a solution and cannot find a solution. I am using C# and ASP.NET and I need to export data to an Excel spreadsheet.

我有一个包含应用程序对象的应用程序列表。每个应用对象都有一个状态ID。当我出口这些应用程序到Excel,然后我需要一个列有一个下拉/组合框在里面。在此下拉/组合框应当从数据库中的所有的状态的列表。然后我需要的状态被选中,该应用程序的状态ID的。

I have a list of applications that contains Application objects. Each Application object has a status ID. When I export these applications to Excel then I need a column with a drop down/combo box in it. In this drop down/combo box should be a list of all the statuses from the database. And then I need the status to be selected to that of the application's status ID.

另一个问题也与关于上述场景。当用户下载Excel文档,那么用户可以通过选择在下拉菜单中不同的值更改下来每个应用程序的状态。我需要上传经行此S preadsheet和回路,并获得列的值和所选项目的下拉/组合框的值。你会怎么做呢?这可能吗?

Another question is also with regards to the above scenario. When the user downloads the Excel document then the user can change the status of each application by selecting a different value in the drop down. I will need to upload this spreadsheet and loop through the rows and get the values of the columns and the value of the selected item in the drop down/combo box. How would you do this? Is this possible?

我可能不会使用COM组件,所以我试图去EPPlus或NPOI(它没有成为这些2),但它似乎并不像他们支持我的方案。我怎么能够实现我的方案?再次,它没有充分利用EPPlus和NPOI的。工作的例子是AP preciated:)

I may not use COM components, so I tried to go with EPPlus or NPOI (it does not have to be these 2) but it doesn't seem like they support my scenario. How would I be able to achieve my scenario? Once again, it doesn't have to make use of EPPlus and NPOI. Working examples would be appreciated :)

感谢

布兰登

推荐答案

您是否尝试过使用NPOI模板?当我想复杂US preasheets出口与NPOI,我创建了一个XLS文档中的数据通过C#作为模板使用,并填写。

Have you tried using a template in NPOI? When I want to export complex spreasheets with NPOI, I create a XLS document to use as a template, and fill in the data via C#.

这篇关于导出/导入到Excel与组合框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆