Asp.netÖÐExcelµ¼³ö
¶ÔÓÚasp.net µÄExcelµ¼³ö£¬ÓжàÖÖ·½·¨£¬µ½Ä¿Ç°£¬¸öÈËÈÏΪ£¬ÀûÓÃmyxlsµ¼³öExcel»¹ÊDZȽϺÃÓõģ¬¿ÉÒԺܺõÄÉèÖÃExcelµÄ¸ñʽ¡£¡£¡£
ʹÓúܷ½±ã£¬ÏÂÔØorg.in2bits.MyXls.dll£¬ÒýÈëÃüÃû¿Õ¼ä¼´¿É
ÏÂÃæÊÇÒ»¸öʹÓôúÂëʾÀý£º
private void ExcelExport(IList< LineLossInfo > lossListExcel)
{
XlsDocument xls = new XlsDocument();
xls.FileName = "LineLossMonthDetail.xls";//Ö¸¶¨ÎļþÃû
Worksheet sheet = xls.Workbook.Worksheets.Add("LineLossMonthDetail");
#region ÉèÖø÷Êý¾ÝÁеĴóС
ColumnInfo colInfo1 = new ColumnInfo(xls, sheet);
colInfo1.ColumnIndexStart = 0;
colInfo1.ColumnIndexEnd = 1;
colInfo1.Width = 15 * 256;
sheet.AddColumnInfo(colInfo1);
ColumnInfo colInfo2 = new ColumnInfo(xls, sheet);
colInfo2.ColumnIndexStart = 2;
colInfo2.ColumnIndexEnd = 2;
colInfo2.Width = 15 * 256;
sheet.AddColumnInfo(colInfo2);
ColumnInfo colInfo3 = new ColumnInfo(xls, sheet);
colInfo3.ColumnIndexStart = 3;
colInfo3.ColumnIndexEnd = 3;
colInfo3.Width = 15 * 256;
sheet.AddColumnInfo(colInfo3);
ColumnInfo colInfo4 = new ColumnInfo(xls, sheet);
colInfo4.ColumnIndexStart = 4;
colInfo4.ColumnIndexEnd = 4;
colInfo4.Width = 15 * 256;
sheet.AddColumnInfo(colInfo4);
 
Ïà¹ØÎĵµ£º
using System;
using System.Collections.Specialized;
using System.Data;
using System.Configuration;
using System.Collections;
using System.IO;
using System.Threading;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebC ......
Default.aspx CSÎļþ´úÂë
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class _De ......
AtlasÊÇʲô£¿
atlas 2006-12-12 09:48 ÔĶÁ69 ÆÀÂÛ0
×ֺţº ´ó´ó ÖÐÖРСС
AtlasÊÇʲô£¿
ASP.NET”Atlas”ÊÇÒ»¸öеÄWeb¼¼Êõ¿ª·¢°ü£¬Ëü¼¯³ÉÁËÒ»Ì׷dz£´óµÄ¿Í»§¶Ë½Å±¾¿âʹµÃÓ빦ÄܷḻµÄ¡¢»ùÓÚ·þÎñÆ÷¿ª·¢Æ½Ì¨µÄASP.NET2.0½áºÏÔÚÒ»Æð£¬&rdq ......
Ê®¡¢ÒÔ±à³Ì·½Ê½·ÃÎÊ ASP.NET ¿Ø¼þ
1¡¢Web ´°Ìå¿Ø¼þ±êʶ
ASP.NETÍøÒ³ÉϵÄÿһ¸ö¿Ø¼þ¶¼±ØÐëÊÇ¿ÉΨһ±êʶµÄ¡£Í¨³££¬Îª¿Ø¼þµÄ ID ÊôÐÔ·ÖÅäÒ»¸öÖµÀ´Î¨Ò»±êʶ¸Ã¿Ø¼þ¡£¸ÃÖµ½«³ÉΪ¿Ø¼þµÄʵÀýÃû³Æ£¨¼´£¬ÔÚ´úÂëÖÐÒýÓÿؼþËùÒÀ¾ÝµÄÃû³Æ£©¡£ÀýÈ磬Èç¹û½« TextBox ¿Ø¼þµÄ ID ÊôÐÔÉèÖÃΪ Text1£¬Ôò¿ÉÒÔÔ ......
ÈçºÎͨ¹ýASP.NETÀ´ÏÂÔØÎļþ£¬Õâ¸öÎÊÌâÎÒÃǾ³£Óöµ½£¬°Ñ³£Óõķ½·¨×ܽᵽһÆð£¬Ñ§Ï°Ñ§Ï°¡£µ±ÎÒÃÇÒªÈÃÓû§ÏÂÔØÒ»¸öÎļþ£¬×î¼òµ¥µÄ·½Ê½ÊÇͨ¹ýResponse.RedirectÖ¸Á
Response.Redirect("test.doc")
Äú¿ÉÒÔ°ÑÉÏÃæÕâÐÐÖ¸Áî·ÅÔÚButtonµÄClickʼþµ±ÖУ¬µ±Óû§µã»÷°´Å¥Ö®ºó£¬ÍøÒ³¾Í»á±»×ªÖ·µ½¸Ãwordµµ£¬Ôì³ÉÏÂÔصÄЧ¹û¡ ......