HTML到Word文档 [英] HTML To Word Document

查看:146
本文介绍了HTML到Word文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个ap.net网站,一次显示5个数据.我需要允许用户打印此数据(而不在页面上打印所有其他废话).我的第一个想法是使用iSharpText创建pdf文件,但是iSharpText一直存在问题,并且在任何地方都没有对它的真正(即刻)支持.

因此,我决定尝试仅将html作为Word文档发送给用户.本质上,除了一件事之外,它都可以正常工作.我需要能够创建硬分页符,以便报表的外观与他们在网页上看到的外观相似.我尝试在包含页面数据的div上使用page-break-before:always;,但是Word忽略了它.

有没有人暗示我该如何处理?

在您提出建议之前,不可能使用MS Office COM对象,Crystal Reports也不能.如果有人可以引导我获得良好的资源,我也不会完全拒绝使用iTextSharp.

I have a ap.net web that displays data 5 items at a time. I need to allow the user to print this data (without printing all the other crap on the page). My first thought was to use iSharpText to create a pdf file, but iSharpText has been problematic and there''s no real (immediate) support for it anywhere.

So, I decided to try just sending the html to the user as a word document. Essentially, it''s working fine except for one thing. I need to be able to create hard page breaks so that the report will be similar in appearance to what they see on the web page. I''ve tried using page-break-before:always; on the div containing a page''s worth of data, but Word is ignoring that.

Does anyone have any hints as to how I might approach it?

Before you suggest it, using the MS Office COM objects is not possible, and neither is Crystal Reports. I''m not entirely shut off to using iTextSharp either if someone can steer me to a good resource.

推荐答案

我发现了一条路".

我创建一个.HTML文件,而不是创建一个.DOC文件,并以这种方式进行传输.此时,用户可以使用IE进行打印.
I found "a way".

Instead of creating a .DOC file, I create a .HTML file, and transfer it that way. At that point, the user can use IE to print it.


这篇关于HTML到Word文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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