是这样的,我用extjs做了个考勤系统,因功能需要,我就做了个导出excel能。
当发布到iis上,直接导到iis那台服务器上了,请问怎么把他下载到访问的客户端上?
没钱了,高手解答些吧,谢谢

解决方案 »

  1.   

    啥意思呢,你生成xls文件,然后将文件的连接输出到或者直接返给客户
      

  2.   

    做一个excel模板啥,当点击到处的时候,把需要到处的数据写入excel,下载到本地就是啥,网上这类例子很多的
      

  3.   

     用response输出啊。 这是我导出优惠券用的代码。。     StringWriter sw = new StringWriter();
                    sw.WriteLine("优惠券批次号\t优惠券号码\t优惠券金额\t过期时间");                foreach (CouponItemInfo itemInfo in result)
                    {
                        string line = lotNumber + "\t" + itemInfo.ClaimCode + "\t" + coupon.DiscountValue + "\t" + coupon.ClosingTime;
                        sw.WriteLine(line);
                    }
                    sw.Close();
                    Page.Response.AddHeader("Content-Disposition", "attachment; filename=" + "CouponsInfo_" + DateTime.Now + ".xls");
                    Page.Response.ContentType = "application/ms-excel";
                    Page.Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
                    Page.Response.Write(sw);
                    Page.Response.End();