All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
ASP.net—Literal控件用法_[Asp.Net教程]
技巧:ASP.NET,2.0防止同一用户同时登陆_.net资料_编程技术
详细介绍:Apache+PHP+MySQL配置攻略_php资料_编程技术
如何让apache支持url_rewrite_php资料_编程技术
利用XMLHTTP无刷新添加数据之Get篇_[XML教程]
向普通人加密,用PHP程序保护数据_php资料_编程技术
ASP.NET中的FILESTREAM对象总结_[Asp.Net教程]
SQL,Server:无日志恢复数据库_[SQL,Server教程]
C#教程:创建DLL动态链接库
利用ASP.NET,2.0客户端callbacks限制postbacks_[Asp.Net教程]
Reading number is top 10 pictures
Household design comfortable contracted
Sora aoi possession photo1
看如何给单纯的少女洗脑
毛俊杰-能量永动机
The money of more than 100 countries and regions20
A cat have life principles
The real super beauty6
西游四格漫画(三)
世界五大海盗
Startling Russian girl blind date scene2
Download software ranking
Unix video tutorial12
c#程序设计案例教程
Boxer's Top ten classic battle4
打鸟视频
Prostitutes diary
XML+Web+Service开发教程
Dance with duck(male prostitution)
虚拟机汉化软件
Ashlynn Video2
Boxer Classic video2
归海一刀 published in(发表于) 2014/1/30 1:35:16 Edit(编辑)
将GridView内容导出到Excel或Word中_[Asp.Net教程]

将GridView内容导出到Excel或Word中_[Asp.Net教程]

将GridView内容导出到Excel或Word中_[Asp.Net教程]

前台页面:


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ExportDemo.aspx.cs" Inherits="ExportDemo" %>

DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>GridView导出到Excel或Word文件——周公的博客:http://blog.csdn.nettitle>
head>
<body>
<form id="form1" runat="server">
<div>
<asp:GridView ID="gvPersonList" runat="server" AutoGenerateColumns="False">
<Columns>
<asp:BoundField DataField="Id" HeaderText="编号" />
<asp:BoundField DataField="Name" HeaderText="姓名" />
<asp:TemplateField HeaderText="性别">
<ItemTemplate>
<%# Eval("Sex").ToString()=="true"?"":"" %>
ItemTemplate>
asp:TemplateField>
<asp:BoundField DataField="Age" HeaderText="年龄" />
<asp:TemplateField HeaderText="婚否">
<ItemTemplate>
<%# Boolean.Parse(Eval("Married").ToString())==true?"":"" %>
ItemTemplate>
asp:TemplateField>
Columns>
asp:GridView>
<asp:Button ID="btnToExcel" runat="server" OnClick="btnToExcel_Click" Text="导出到Excel" />
<asp:Button ID="btnToWord" runat="server" OnClick="btnToWord_Click" Text="导出到Word" />
div>
form>
body>
html>


添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.