是否所有的浏览器都支持Excel的回应? [英] Do all browsers support excel respond?

查看:164
本文介绍了是否所有的浏览器都支持Excel的回应?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发Python的Web应用程序。
但是,客户端想要一个工具,出口当前页面脱颖而出。
所以,我不得不写在每一个页面(视图)一个额外的code的转换表使用xlwt(Python模块)脱颖而出。

I'm developing web application on python. But the client wants a tool that exports current page to excel. So I had to write an extra code in every pages (views) that converts the table to excel using xlwt (python module).

但我有一个更好的解决方案。它发出了一个当前页面的HTML内容的服务器,服务器会回应这个HTML表格为Excel类型。
像这样的:

But I have a better solution. It sends a current page's content html to the server and the server would respond this html table as excel type. Like this:

response['Content-Type'] = 'application/vnd.ms-excel; charset=utf-8'
Response.ContentType = "application/vnd.ms-excel" 

本著作颇丰。但我很好奇每一个浏览器是否支持这个Excel回应!?!?!

This works quite good. But I'm curious about whether every browser supports this excel respond!?!?!

如果不是这将是一个很大的问题对我说:(

If not it would be a big problem to me :(

或者,如果安装在客户端计算机上仅MS Excel或OpenOffice做浏览器的支持呢?

Or do browsers support it if only MS Excel or OpenOffice is installed on the client computer?

其他任何全球性的解决方案或想法?

推荐答案

得当转换成实际的Excel文件,肯定会是最好的一段路要走。

Properly converting it into an actual Excel file would definitely be the best way to go.

也就是说,如果


  • 您给的文件名.xls扩展

  • 沿着正确的MIME类型发送

  • Excel或注册后处理XLS文件一些其他的程序安装在用户的计算机上

假HTML为Excel的方法应该能正常运行。我从来没有试图掩盖开在OpenOffice的XML格式的HTML文件,但 - 你一定要尝试了这一点,看看它与它

the "fake HTML as Excel" method should work fine. I have never tried opening a HTML file masked as XML in OpenOffice, though - you should definitely try that out and see what it does with it.

这篇关于是否所有的浏览器都支持Excel的回应?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆