AsPose.Cell 处理Excel No Problem

来源:互联网 发布:ui需要的软件 编辑:程序博客网 时间:2024/05/22 00:31

 

一直困扰着自己的Excel处理,在最近对AsPose.Cell 的研究后终于把以前没有完成的功能都做完了,尤其是把Html转成Excel,Excel转成Html

有了AsPose.Cell 处理So Easy.

StringBuilder sb = new StringBuilder();
            sb.Append("<table><tr><td>adfd</td></tr></table>");
            byte[] array = Encoding.UTF8.GetBytes(sb.ToString());
            MemoryStream ms = new MemoryStream(array);
            LoadOptions lo = new LoadOptions(LoadFormat.Html);
            Workbook book = new Workbook(ms,lo);
            book.Save(Response, "my.xlsx", ContentDisposition.Attachment, new XlsSaveOptions(SaveFormat.Xlsx));