使用ASP.NET将数据从数据库导出到现有的Excel工作表 [英] Export data from database to an existing excel sheet using ASP.NET

查看:372
本文介绍了使用ASP.NET将数据从数据库导出到现有的Excel工作表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个模板文件夹,其中有一张Excel表格。我想从数据库中提取数据并将其导出到Excel工作表。每次我单击导出时,应在模板文件夹中创建Excel工作表的副本,并且应将数据导出到Excel工作表的副本,并且应下载包含数据的工作表。可以在C#ASP.Net Web应用程序中完成吗?



我尝试过:



我尝试了很多东西,但我只能以网格格式下载或者模板文件夹中的excel表格得到更新,但数据应该放在excel表的副本中,应该下载。

I have an Template Folder in which i have an Excel Sheet. I want to extract data from database and export it to Excel Sheet. Every time i click Export a copy of the Excel sheet in Template folder should be made and the data should be exported to the copy of the excel sheet and the sheet with data should get downloaded. Can this be done in C# ASP.Net Web Application??

What I have tried:

I tried a lot of thing but i could get only download in grid format or the excel sheet in the template folder gets updated but instead data should go in copy of excel sheet and should get downloaded.

推荐答案

您可以配置工作表以从数据库中提取数据。谷歌是你的朋友。



excel数据连接 - Google搜索 [ ^ ]
You can configure the sheet to pull data from the database. Google is your friend.

excel data connection - Google Search[^]


我在google上进行了快速搜索,发现这个网站在ASP.NET的上下文中托管了一些与Excel相关的文章: https://www.aspsnippets.com/Categories/Excel.aspx [ ^ ]
I did a quick search at google and found this site that hosts some articles related to Excel in the context of ASP.NET: https://www.aspsnippets.com/Categories/Excel.aspx[^]


这篇关于使用ASP.NET将数据从数据库导出到现有的Excel工作表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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