在页面上创建Word文档

在页面上创建Word文档

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

问题描述

我找到了一些代码,展示了如何将html

表单转换为Word。消息说只需在Page_load中放入以下



Response.ContentType =" application / ms-word"

Response.AddHeader(" content-disposition"," inline;

filename = BP_CaseStatus.doc")


现在我只需要如果我打算在浏览器中显示它,那就像创建页面一样。




我在浏览器中使用类似的代码创建文档

以下内容:

Response.Write("< table width ="" 100%"">")

Response.Write("< tr height = 1>< td align = right>< img

src ="" images \ bp_white2_icon.ico"" >< / tr>")

Response.Write("< tr>< td align = center>< font size = + 3> My

报告< / font>< / tr>")

Response.Write("< tr>< td align = center>< font size = + 3> BP

案例状态报告< / font>< / tr>")


''============= =================================

''主表

''============================================= =

Response.Write(" < tr>< td>")

Response.Write(" table border = 0 width ="" 100%""

CELLSPACING = 3 CELLPADDING = 0>")

回复于("< TR BGCOLOR =#BBBBBB>< TD>铅

原告< TD>管辖权< TD>阁< TD>在内务

律师< Pltfs<的#; TD> TD>状态< TD> BP帐单

击穿< / TR>" )

Response.Write("< / table>")

Response.Write("< / tr>")

''============================================= =

''主表

''=========================== ===================

Response.Write("< / table>")

页面加载正常,直到我尝试将其作为Word

文档加载。我知道有人在那里做过。


有人可以帮忙吗?


谢谢

enak


I have found some code that shows how to convert an html
form to Word. The message said to simply put the following
in the Page_load:

Response.ContentType = "application/ms-word"
Response.AddHeader("content-disposition", "inline;
filename=BP_CaseStatus.doc")

Now all I should have to do is create the page just like I
would if I were going to display it in the browser.

I create the document in the browser using code similar to
the following:
Response.Write("<table width=""100%"">")
Response.Write(" <tr height=1><td align=right><img
src=""images\bp_white2_icon.ico""></tr>")
Response.Write(" <tr><td align=center><font size=+3>My
Report</font></tr>")
Response.Write(" <tr><td align=center><font size=+3>BP
Cases Status Report</font></tr>")

''==============================================
''MAIN TABLE
''==============================================
Response.Write(" <tr><td>")
Response.Write(" <table border=0 width=""100%""
cellspacing=3 cellpadding=0>")
Response.Write(" <tr bgcolor=#bbbbbb><td>Lead
Plaintiff<td>Jurisdiction<td>Court<td>In-House
Counsel<td># of Pltfs<td>Status<td>BP Billing
Breakdown</tr>")
Response.Write(" </table>")
Response.Write(" </tr>")
''==============================================
''MAIN TABLE
''==============================================
Response.Write("</table>")
The page loads fine until I try to load it as a Word
document. I know that someone out there has done this.

Can anyone help?

Thanks
enak


推荐答案




放在Page_load中的


following







放在Page_load中的


following


likeI

likeI

to


to





这篇关于在页面上创建Word文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-31 07:44