asp.netµÄcom·½Ê½µ¼³öexcel
×î½ü×ö¸öÏîÄ¿£¬ÐèÒªµ¼³öexcel£¬ÒªÖ÷´Ó±íÒ»Æðµ¼³öµÄ£¬¾Í´óÖÂдÁËÒ»¸ö·½·¨£¬¿ÉÄܸñʽ·½Ã滹ÊÇ»á½øÐÐÐ޸ģ¬ÏÈÌù³öÀ´·½±ãÒÔºó²é¿´
ÏîÄ¿ÒýÓÃ΢ÈíexcelµÄcomµÄdll¼´¿É
/// <summary>
/// ¹¦ÄÜ£ºµ¼³öÎļþ£¨Í¨¹ýÊý¾ÝÔ´µ¼³ö,¿ÉÖ÷´Ó±íµ¼³ö£©
/// </summary>
/// <param name="strTitle">ÎļþÃû×Ö</param>
/// <param name="mainDT">Ö÷±íÊý¾ÝÔ´</param>
/// <param name="dtParams">´Ó±íÊý¾ÝÔ´¼¯ºÏ</param>
public static void Export(string strTitle, System.Data.DataTable mainDT, params System.Data.DataTable[] dtParams)
{
GC.Collect();
Application oApp = new Application();
Workbooks oBooks = oApp.Workbooks;
Workbook oBook = oBooks.Add(true);
Worksheet oSheet = (Worksheet)oBook.ActiveSheet;
int _rowIndex = 4;//ÐÐË÷Òý
int _cellIndex = 1;//ÁÐË÷Òý
int _maxCellIndex = 1;//×î´óÁÐË÷Òý
int _mainRowIndex = 4;//Ö÷±íÐÐË÷Òý
//»æÖƱêÌâ
oSheet.Cells[2, 2] = strTitle;
//»æÖÆÖ÷±íÊý¾Ý
foreach (DataColumn col in mainDT.Columns)
{
_cellIndex++;
//ÉèÖÃÒ»ÐÐÁ½ÁÐ
if (_cellIndex > 17)
{
_rowIndex++;
_cellIndex = 2;
}
oSheet.Cells[_rowIndex, _cellIndex] = col.ColumnName+":";
oSheet.get_Range(oSheet.Cells[_rowIndex, _cellIndex], oSheet.Cells[_rowIndex, _cellIndex + 2]).Select();
oSheet.get_Range(oSheet.Cells[_rowIndex, _cellIndex], oSheet.Cells[_rowIndex, _cellIndex + 2]).HorizontalAlignment = XlHAlign.xlHAlignCenterAcrossSelection;
_cellIndex = _cellIndex + 3;
if (col.DataType == System.Type.GetType("System.DateTime"))// ÈÕÆÚ¸ñʽ
{
oSheet.Cells[_rowIndex, _cellIndex] =Convert.ToDateTime(mainDT.R
Ïà¹ØÎĵµ£º
Ò³Ãæµ¼³öExcelʱ£¬³£ÓõÄÖ±½ÓRenderControlµÄ·½·¨£¬Èç¹û±í¸ñÖÐÓÐÊý×Ö£¬ÔÚExcelÖÐÍùÍù¸ñʽ»áÂÒ£¬±ÈÈçÇ°ÃæÓÐ0£¬µ«ÏÔʾ³öÀ´ºó0¶¼±»È¥µôÁË¡£
Òò´ËÒªÔÚ°ó¶¨Êý×ÖµÄʱºò£¬ÊÖ¶¯Ö¸¶¨Ò»Ï´ËÁеĸñʽ£¬ÈÃÊý×ÖÒÔÎı¾·½Ê½ÏÔʾ¾ÍÐÐÁË
protected void myGridView_RowDataBound(object sender, GridViewRowEventArgs e)
{
......
Ç°ÑÔ
ASP.NET MVC×÷Ϊ΢Èí¹Ù·½µÄ.NETƽ̨ÏÂMVC½â¾ö·½°¸£¬×Ôµ®ÉúÆð¾ÍÎüÒýÁËÖÚ¶à.NETƽ̨¿ª·¢ÈËÔ±µÄÑÛÇò¡£ÔÚ¾ÀúÁËÂþ³¤Previewºó£¬ÉϸöÔÂ΢ÈíÖÕÓÚ·¢²¼ÁËÆäbeta°æ¡£Ó¦¸Ã˵£¬Í¨¹ýÎÒÇ×Éíʵ¼ù£¬ÎÒÈÏΪÕâ¸ö¿ò¼ÜµÄÉè¼Æ»¹ÊÇÏ൱ÓÅÐãµÄ£¬ÖÁÉÙ´ÓÒ×ÓÃÐÔÀ´Ëµ£¬ASP.NET MVCÒªÓÅÓÚJavaƽ̨ÉϵÄStrutsºÍStr ......
Ëæ×ÅÍøÂç¼¼ÊõµÄ·¢Õ¹£¬Ä¿Ç°¹úÄÚCMSµÄ¿ª·¢ÉÌÔ½À´Ô½¶à£¬¸÷×Ô¶¼ÓÐÆä¶ÀÌصÄÓÅÊÆ£¬´ó¼ÒÔÚÑ¡ÔñµÄʱºò¾õµÃÑÛ»¨çÔÂÒ£¬²»ÖªµÀÑ¡ÔñÄĸö±È½ÏºÃ£¬ÎÒ¸öÈËÈÏΪ¿ªÔ´µÄCMS»¹ÊÇÊʺÏÎÒÃÇѧϰ¼°Ñо¿Ê¹Óã¬Ï±߾ͼ¸¸ö¹úÄÚµÄasp.net¿ªÔ´CMS½øÐмòµ¥½éÉÜ¡£
1.We7 CMS
We7 CMSÊÇÓÉÎ÷²¿¶¯Á¦¿ª·¢µÄÒ»¿î³ä·Ö·¢¾ò»¥ÁªÍøWeb2.0£¨È粩¿Í¡¢RSSµÈ£©µÄÐÅÏ¢× ......
ÔÚa.aspxÌøתµ½b.aspx
ͨ¹ýServer.Transfer("b.aspx") ÓëResponse.Redirect("b.aspx")µÄÇø±ð
Èç¹ûÊÇͨ¹ýͨ¹ýServer.Transfer()ÔÚa.aspxÌøתµ½b.aspxµÄ£¬ÔòÔÚb.aspxÒ³Ã棬¿ÉÒÔ²éÕÒµ½±£´æÔÚa.aspxÒ³ÃæÖÐµÄ ¿Ø¼þÖеÄÖµ£¬Èç¹ûÊÇResponse.Redirect(),ÔòµÃ²»µ½µ½a.aspxÒ³ÃæÖпؼþµÄÖµ¡£
Èç¹ûÊÇͨ¹ýServer.Transfer("b.aspx" ......
дÁËÒ»¸ö´´½¨ÐéÄâĿ¼µÄ WebService ³ÌÐò£¬ÔÚ²âÊÔÔËÐÐʱ¿ÉÒԳɹ¦´´½¨£¬µ«ÆäËü³ÌÐòµ÷ÓÃʱ£¬ÌáʾûÓÐȨÏÞ´´½¨¡£
²éÁËһЩ×ÊÁÏ£¬ÔÚweb.configÀïÃæµÄ<system.web>ºó¼ÓÉÏÅäÖãº
<identity impersonate="true" userName="²Ù×÷ϵͳÓû§Ãû" password="Óû§¶ÔÓ¦µÄÃÜÂë" />
ÎÊÌâ½â¾ö¡£Ìش˼Ǽ£¬È¨ ......