asp.net从sql数据库几个不同的表中导出在同一个Excel表格

[复制链接]
查看11 | 回复3 | 2012-4-26 12:15:19 | 显示全部楼层 |阅读模式
public bool ExportExcel(DataTable myDataTable, string saveFileName)
{
try
{
if (saveFileName.IndexOf(":") < 0) return false; //被点了取消
Excel.Application xlApp = new Excel.Application();
object missing = System.Reflection.Missing.Value;
if (xlApp == null...
回复

使用道具 举报

千问 | 2012-4-26 12:15:19 | 显示全部楼层
1.联查sql语句:select * from table1 a,table2 b where a.条件1=b.条件2将查询后生成的表格保存在一个网页中.2.导出excel在生成的页面头部加入语句:<%response.ContentType ="application/vnd.ms-excel"Response.AddHeade...
回复

使用道具 举报

千问 | 2012-4-26 12:15:19 | 显示全部楼层
1.联查sql语句:select*fromtable1a,table2bwherea.条件1=b.条件2将查询后生成的表格保存在一个网页中.2.导出excel在生成的页面头部加入语句:<%response.ContentType="application/vnd.ms-excel"Response....
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行