1.需要添加引用Aspose.Cells.dll

2.这是代码压缩包下载地址:自定义Excel模板导出数据.rar

3.前台界面

 1 <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="daochu.aspx.cs" Inherits="Oceansoft.Net.CeSWeb.Module.导出Excel_通过模板_.daochu" %>
 2 
 3 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 4 
 5 <html xmlns="http://www.w3.org/1999/xhtml">
 6 <head runat="server">
 7     <title></title>
 8 </head>
 9 <body>
10     <form id="form1" runat="server">
11     <div>
12        <asp:Button ID="btnDaochu" runat="server" Text="Excel自定义模板填充数据导出" OnClick="btnDaochu_ServerClick" />
13     </div>
14     </form>
15 </body>
16 </html>
View Code

相关文章: