简体   繁体   English

如何从浏览器中将Word文档作为模板启动?

[英]How to launch Word documents as templates from a browser?

I work for a non-profit who uses MS Access 2003 to keep track of donations and benefactors. 我为一个使用MS Access 2003的非营利组织工作,以跟踪捐赠和捐助者。 Someone, a long time ago, wrote a huge VBA application inside access to keep track of everything, but we've outgrown Access's limitations. 很久以前,有人在访问中编写了一个巨大的VBA应用程序以跟踪所有内容,但我们已经超出了Access的限制。 We're looking at replacing it with a web application (Java/MySQL), perhaps created with Wavemaker , but one feature which is very useful is the ability to launch a Word document (I don't know the name of the feature exactly), based on a template, that populates the template with some data from the Access DB. 我们正在寻找用Web应用程序(Java / MySQL)替换它,可能是用Wavemaker创建的,但是一个非常有用的功能是能够启动Word文档(我不知道该功能的名称) ,基于模板,使用Access DB中的一些数据填充模板。 For example, a "Thank You" letter for a benefactor which is populated with their name and address. 例如,一封“感谢你”的信件,其中包含一个名人和地址。

I have no idea how to mimic this feature in a web application, and I'm open to any suggestions (even the abhored ActiveX controls). 我不知道如何在Web应用程序中模仿这个功能,我对任何建议(甚至是有效的ActiveX控件)都持开放态度。 Any ideas? 有任何想法吗?

Thanks in advance! 提前致谢!

The general approach is not to automate client side. 一般方法不是自动化客户端。 So you generate a PDF or word or perhaps even a rich text file server side then THEN provide a URL/link for the user to click on. 因此,您生成PDF或单词,甚至可能生成富文本文件服务器端,然后提供用户单击的URL /链接。

The user can then click on that URL (file) and the local client side software (either browser or word) can then open + render that file. 然后,用户可以单击该URL(文件),然后本地客户端软件(浏览器或单词)可以打开+渲染该文件。

So a browser is quite happy to allows one to open a PDF or word (rtf) file FROM server side in the client side. 因此,浏览器非常乐意允许用户在客户端打开来自服务器端的PDF或word(rtf)文件。 And this includes opening such files with Word. 这包括用Word打开这些文件。

Attempting to launch CLIENT side software from a browser is not only a “high” risk adventure but if you setup such computers to allow the browser to create + launch + run + use such files client side then you open a security hole the size of a barn door. 尝试从浏览器启动CLIENT端软件不仅是一个“高”风险冒险,但如果您设置此类计算机以允许浏览器创建+启动+运行+使用此类文件客户端然后您打开一个大小为a的安全漏洞谷仓门。

What is to say with such security holes being opened the next site will not open or scan or look for files like “banking” or personal finance? 如果打开这样的安全漏洞,下一个网站将无法打开或扫描或查找“银行”或个人理财等文件? So you really do not want nor can you attempt to automate client side software from a web browser. 所以你真的不想也不能尝试从网络浏览器自动化客户端软件。

However creating a PDF or even using some kind of web based report writer, they often have a “web export” option that creates a PDF or even Word format file that can be opened local. 无论是创建PDF还是使用某种基于Web的报表编写器,它们通常都有一个“Web导出”选项,可以创建可以在本地打开的PDF或甚至Word格式文件。 For example SQL server reporting services has a great PDF and Word export feature. 例如,SQL Server报告服务具有出色的PDF和Word导出功能。

In fact if you using Access web services (that is Access web publishing for 2010), then the Access web reports render these reports near “perfect” in word and in fact Web Access Reports render better in Word then do client based Access applications! 事实上,如果您使用Access Web服务(即2010年的Access Web发布),那么Access Web报告会将这些报告呈现为“完美”的字样,实际上Web Access报表在Word中呈现得更好,然后执行基于客户端的Access应用程序!

So for example, looking at an Access Web based Report, you see this option: 例如,查看基于Access Web的报告,您会看到以下选项:

在此输入图像描述

If you click on actions then you get this option in the web browser: 如果单击操作,则在Web浏览器中获得此选项:

在此输入图像描述

Now, when you click on that, you can choose PDF or Word and your LOCAL client opens + renders the report. 现在,当您单击它时,您可以选择PDF或Word,并打开LOCAL客户端+呈现报告。 Really nice is all graphics and formatting is preserved in the web report (unlike client reports that loose their graphics). 非常好的是,所有图形和格式都保留在Web报告中(与松散其图形的客户端报告不同)。

The above of course is using Access Web publishing which just so happens to use SQL server reporting services. 上面当然是使用Access Web发布,恰好使用SQL服务器报告服务。 The “key” suggesting here DESPITE the fact that you don't have or may not have SQL reporting services is that the creating + rendering of the document occurs SERVER side, and THEN the client can simply “open” or consume the report as PDF or in this case as above shows Word. 这里的“密钥”表明你没有或者没有SQL报告服务的事实是文档的创建+呈现发生在SERVER端,然后客户端可以简单地“打开”或以PDF格式使用报告或者在这种情况下如上所示显示Word。 Once again this means no client side automaton is required. 这再次意味着不需要客户端自动机。

So create the document or template 100% server side. 因此,创建100%服务器端的文档或模板。 Depending on the reporting system and Web development tools you adopt then such tools might have built in Word creating system. 根据您采用的报告系统和Web开发工具,这些工具可能内置了Word创建系统。 In above I ONLY used MS Access to create this web site and the Access Web development tools are based on SQL reporting services which has the PDF and Word export built in as per above shows. 在上面我只使用MS Access来创建这个网站,Access Web开发工具基于SQL报告服务,它具有内置的PDF和Word导出,如上所示。

If you don't have a report system you can still adopt a PDF format system or even use a common format like Rich Text which CLIENT side MS Word handles and opens quite well. 如果您没有报告系统,您仍然可以采用PDF格式系统,甚至可以使用像Rich Text这样的通用格式,客户端MS Word可以处理和打开。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM