View Code
string file = Server.MapPath(
"
Library/现场服务商评价日报.xls
");
Workbook workbook = new Workbook(file);
HtmlSaveOptions option = new HtmlSaveOptions(SaveFormat.Html);
System.IO.MemoryStream stream = new System.IO.MemoryStream();
workbook.Save(stream, SaveFormat.Html);
string html = System.Text.Encoding.UTF8.GetString(stream.ToArray());
HttpContext.Current.Response.ContentType = " text/html; charset=utf-8 ";
HttpContext.Current.Response.Write(html);
HttpContext.Current.Response.Flush();
HttpContext.Current.Response.End();
Workbook workbook = new Workbook(file);
HtmlSaveOptions option = new HtmlSaveOptions(SaveFormat.Html);
System.IO.MemoryStream stream = new System.IO.MemoryStream();
workbook.Save(stream, SaveFormat.Html);
string html = System.Text.Encoding.UTF8.GetString(stream.ToArray());
HttpContext.Current.Response.ContentType = " text/html; charset=utf-8 ";
HttpContext.Current.Response.Write(html);
HttpContext.Current.Response.Flush();
HttpContext.Current.Response.End();
View Code
string fullpath = Server.MapPath(
"
Document/Template/a.doc
");
Document doc = new Document(fullpath, LoadFormat.Doc, null);
doc.Save( " a.mhtml ", SaveFormat.Mhtml, SaveType.OpenInBrowser, HttpContext.Current.Response);
Document doc = new Document(fullpath, LoadFormat.Doc, null);
doc.Save( " a.mhtml ", SaveFormat.Mhtml, SaveType.OpenInBrowser, HttpContext.Current.Response);