创建从 Excel 工作簿派生的 ASP.net 3.5 Web 表单应用程序

发布于 2024-08-04 09:10:06 字数 241 浏览 1 评论 0原文

下午好,

一位客户向我提供了他的团队用来提供产品报价的电子表格文件。该电子表格在基础工作表中包含大量数据,并将这些工作表称为报价单上众多公式的一部分。

我的任务是使该工具支持网络,以便可以在托管在共享环境中、运行 ASP.net 3.5 Web 表单的客户网站上生成报价。报价网络表单将位于网站的受限制部分,由 ASP.net 会员 API 控制。

是否有第三方工具可以很好地处理此类事情?

谢谢, 席德

Good Afternoon,

A customer has provided me with a spreadsheet file his team uses to provide quotes for a product. The spreadsheet has extensive data in underlying sheets and calls those sheets as part of the numerous formulas on the quote sheet.

I've been tasked with web-enabling this tool such that the quotes can be generated on the client's website, hosted in a shared environment, running ASP.net 3.5 webforms. The quote web form will be in a Restricted portion of the website controlled by ASP.net membership API.

Are there 3rd party tools that do well with this sort of thing?

Thanks,
Sid

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

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

发布评论

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

评论(1

捶死心动 2024-08-11 09:10:06

我曾经被要求做类似的事情。我拒绝了。其他人尝试过这一点,结果完全失败了。这是因为您的设计是基于电子表格的结构。

当我被叫回来帮助这个项目时,我把以前的代码踢进了一个大垃圾箱,这个大垃圾箱将保持关闭状态,直到地狱结冰!然后我开始分析 Excel 工作表,提取业务逻辑并将其写成文档。这使我能够创建一个良好的设计来设置新项目的第一个版本,该版本不是基于 Excel 工作表,而是基于工作表中的业务逻辑。

不要被诱惑落入这个陷阱!这听起来太简单了,但实际上,由于您将遇到的所有问题,它作为解决方案太昂贵了!


If your customer really needs to have something to use real fast, start with .NET (VS2008 with latest service packs or better) and SQL Server. First create a simple database structure to contain the quotes. Add as many relations as needed. Then, using VS2008, create a new project based on the "Dynamic Data Entities Web Application" which will use the Entity Framework to connect to the database. Make sure the entity framework is connected to your database and all data is provided to it. (By adding an "ADO.NET Entity Data Model" to it.) Compile it, put it on the web server and version 0.1 should be ready. It will allow your customer to continue data entry, although in a bit primitive way, while maintaining the data integrity of it all. It still isn't good enough to expose to the outside World but it makes it easier to get rid of the data part of the Excel spreadsheet. (And technically, it should be possible to also add a RESTful service around the entity model within an hour to allow Excel to read data from a web service instead.)

创建此起始页面后,您的客户可以习惯通过网页输入数据,同时您有时间进一步分析他们的电子表格,以优化数据模型并创建自定义逻辑和更好的数据输入页面。

基本上,这就是我使用的方法。我的客户将 Excel 工作表中的数据导出到 Access 数据库,该数据库用作其应用程序用户的只读数据。他使用 Excel 来保持数据最新。但当多个用户开始在同一个 Excel 工作表中维护数据时,他遇到了大麻烦,多次丢失 Excel 工作表的完整性和数据。

我首先使用实体​​框架/DDS 围绕 Excel 数据创建了一个简单的数据模型,以便于数据输入,然后我可以优化数据库结构,而客户只需继续修改数据。有时,我会更新数据库结构,添加更多关系并重组数据以使其更加优化,并且有一次我添加了 RESTful 服务功能,以便客户可以通过简单的 Web 请求获取 XML 数据。现在,客户已经完全忘记了 Excel 工作表,而是全职使用该网站。他已经接受了这样一个事实:将其变成一些精美的网站将花费大量时间,但目前的情况是完全可以接受的。

这种方法在之前的尝试失败的地方取得了成功,仅仅是因为我只关注数据,仅此而已。现在我可以通过一些小步骤来改进这一切。但第一步:分析 Excel 工作表并将数据转储到数据库中。实体框架将允许您围绕此快速构建简单的站点,而无需付出太多努力。

I've once been asked to do something similar. I refused. Someone else tried this and it became a complete failure. That's because your design is based upon the structure of a spreadsheet.

When I was called back to help on this project, I kicked the previous code into a large bin, which will stay closed until Hell freezes over! I then started analysing the Excel sheets, extracting the business logic and writing them down as documentation. This allowed me to create a good design to set up the first version of a new project, which wasn't based upon the Excel sheet, just on the business logic in the sheet.

Don't be tempted to fall into this trap! It sounds too easy but in reality, it's way too expensive as a solution because of all the problems that you will encounter!


If your customer really needs to have something to use real fast, start with .NET (VS2008 with latest service packs or better) and SQL Server. First create a simple database structure to contain the quotes. Add as many relations as needed. Then, using VS2008, create a new project based on the "Dynamic Data Entities Web Application" which will use the Entity Framework to connect to the database. Make sure the entity framework is connected to your database and all data is provided to it. (By adding an "ADO.NET Entity Data Model" to it.) Compile it, put it on the web server and version 0.1 should be ready. It will allow your customer to continue data entry, although in a bit primitive way, while maintaining the data integrity of it all. It still isn't good enough to expose to the outside World but it makes it easier to get rid of the data part of the Excel spreadsheet. (And technically, it should be possible to also add a RESTful service around the entity model within an hour to allow Excel to read data from a web service instead.)

When this start page has been created, your customer can get used to data entry through web pages while you have some time to analyse their spreadsheet a bit more to optimize the data model and to create custom logic and better pages for data entry.

Basically, this is the approach that I used. My customer had data in Excel sheets which was exported to an Access database which was used as read-only data for users of his application. He used Excel to keep the data up-to-date. But when multiple users started to maintain the data in the same Excel sheet, he got in big trouble, losing the integrity and data of the Excel sheets multiple times.

I first created a simple data model around the Excel data with the Entity framework/DDS for easier data entry and then I could optimize the database structure while the customer just continued to modify the data. Occasionally, I'd update the database structure, adding more relations and restructuring the data to be more optimized and at one point I added the RESTful service functionality so the customer could get the data as XML through a simple web request. Now the customer has completely forgotten about the Excel sheet and is using the website full-time. He has accepted the fact that turning it into some fancy website will cost a lot of time but the current situation is quite acceptable.

This approach succeeded where previous attempts failed simply because I only focused on the data, nothing more. Now I can improve it all using little steps. But step one: analyze the Excel sheet and dump the data in a database. The Entity framework will allow you to quickly build simple sites around this without much effort.

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