用流打开open office ods 文件

    string template = "Template.ods";    
    string path = Server.MapPath(System.Configuration.ConfigurationSettings.AppSettings["TemplateSavePath"].ToString().Trim()+template);
    Response.Clear();
    Response.AppendHeader("Content-Disposition", "attachment;filename=" + template);
    //Response.ContentType = "application/ms-excel"; //Excel 就用这
    Response.ContentType = "application/vnd.oasis.opendocument.spreadsheet";
    Response.WriteFile(path);//传输到客户端   
    Response.End();

posted on 2010-07-09 14:29  AndyCai  阅读(1650)  评论(0编辑  收藏  举报

导航