简体   繁体   English

如何在客户端计算机上标识MS-Word的版本以将报告导出到Word文档

[英]How to identify the version of MS-Word on client machine to export report to Word document

I have developed a report using JasperReports ( iReport tool), which needs to be exported to MS-Word document. 我已经使用JasperReportsiReport工具)开发了一个报告,该报告需要导出到MS-Word文档。 I have Word-2007 on my machine and it is working fine with .docx extension (hardcoded). 我的计算机上安装了Word-2007,并且以.docx扩展名(硬编码)可以正常工作。 However if any machine has MS-Word 1997-2003 installed which takes .doc version, it will cause problem as I am using harcoded value .docx . 但是,如果安装了.doc版本的MS-Word 1997-2003,则将导致问题,因为我使用的是编码后的值.docx

Is there any way to handle this? 有什么办法可以解决这个问题?

If knowing the word version on client machine is the only option how can i know the version installed? 如果知道客户端计算机上的版本是唯一的选择,我怎么知道安装的版本? I think this part of code should be in javascript/jQuery (to know MS-Word version on client machine). 我认为这部分代码应该在javascript / jQuery中(以了解客户端计算机上的MS-Word版本)。

Please let me know how this can be accomplished. 请让我知道如何实现。

You can't inspect the contents of somebody's machine from a browser. 您无法从浏览器检查某人机器的内容。 That would be a severe security risk. 那将是严重的安全风险。

Give them the choice. 给他们选择。 JasperReports can export in lots of formats; JasperReports可以多种格式导出; give the user multiple options and, if necessary, add a brief explanation to each option. 为用户提供多个选项,并在必要时为每个选项添加简要说明。 Alternatively, give the user a .doc file, which the latest versions of MS word and OpenOffice can also open. 或者,为用户提供一个.doc文件,也可以打开MS Word和OpenOffice的最新版本。

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

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