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);
 
Ïà¹ØÎĵµ£º
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="LeftMenu.aspx.cs" Inherits="_Default" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xht ......
Asp.NetÖм¸ÖÖÏàËƵıê¼Ç·ûºÅ: < %=...%>< %#... %>< % %>< %@ %>½âÊͼ°Ó÷¨
´ð: < %#... %>: ÊÇÔڰ󶨿ؼþDataBind()·½·¨Ö´ÐÐʱ±»Ö´ÐУ¬ÓÃÓÚÊý¾Ý°ó¶¨
Èç: < %# Container.DataItem("tit") %>
< %= %>: ÔÚ³ÌÐòÖ´ÐÐʱ±»µ÷Ó㬿ÉÒÔÏÔʾºǫ́±äÁ¿Öµ
Èç:
*.aspx ......
¶þ¡¢Ïò ASP.NET ÍøÒ³Ìí¼Ó HTML ·þÎñÆ÷¿Ø¼þ
HTML ·þÎñÆ÷¿Ø¼þÊÇÄú¿ÉÒÔ¶ÔÆä½øÐÐÅäÖÃÒÔ±ã¿ÉÒÔʹÓ÷þÎñÆ÷´úÂë¶ÔÆä½øÐбà³ÌµÄ HTML ÔªËØ¡£
1¡¢ÈçºÎ£ºÊ¹Óà ASP.NET Óï·¨ÏòÍøÒ³Ìí¼Ó HTML ·þÎñÆ÷¿Ø¼þ
Ìí¼Ó HTML ·þÎñÆ÷¿Ø¼þºÍÌí¼ÓÈÎÒâ HTML ÔªËØÀàËÆ£¬²»Í¬Ö®´¦ÔÚÓÚ ......
Æß¡¢ASP.NET Web ·þÎñÆ÷¿Ø¼þºÍ CSS Ñùʽ
Äú¿ÉÒÔͨ¹ýÉèÖø÷ÖÖÍâ¹ÛÊôÐÔ£¨Èç ForeColor¡¢BackColor¡¢Height ºÍ Width£©À´¿ØÖÆ ASP.NET ·þÎñÆ÷¿Ø¼þµÄÍâ¹Û¡£´ËÍ⣬²¿·Ö¿Ø¼þÖ§³Ö¹«¿ª¸½¼ÓÑùʽÏà¹ØÉèÖõÄÑùʽ¶ÔÏó¡£
˵Ã÷£º ASP.NET ÍøÒ³ÔÚÔËÐÐʱ¿ÉÒÔµ±×÷ HTML Ò³¡£ÄúÒò´Ë¿ÉÒÔÊ ......