You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
using System ;
using System.Collections.Generic ;
using System.Data ;
using System.IO ;
using System.Linq ;
using System.Text.RegularExpressions ;
using System.Web ;
using System.Web.UI ;
using System.Web.UI.WebControls ;
using TradeData ;
namespace TradeManage.TongJi
{
public partial class Report20 : System . Web . UI . Page
{
protected void Page_Load ( object sender , EventArgs e )
{
}
protected void Button1_Click ( object sender , EventArgs e )
{
int ChaseId = Convert . ToInt32 ( CCID . Value ) ;
var obj = new CG_ChaseData ( ) ;
var md = obj . GetPurchaseModel ( ChaseId ) ;
var list = obj . GetPurchaseTableGoods ( ChaseId ) ;
if ( md = = null | | list = = null )
return ;
Response . AppendHeader ( "Content-Disposition" , "attachment;filename=批次.xls" ) ;
//输出的应用类型
Response . ContentType = "application/vnd.ms-excel" ;
//设定编码方式, 若输出的excel有乱码, 可优先从编码方面解决
// Response.Charset = "gb2312";
Response . Charset = "gb2312" ;
Response . ContentEncoding = System . Text . Encoding . UTF8 ;
//关闭ViewState, 此属性在Page中
EnableViewState = false ;
//filenames是自定义的文件名
//content是步骤1的html, 注意是string类型
Response . Write ( Hidden1 . Value ) ;
Response . End ( ) ;
}
}
}