0

I have developed a report using JasperReports (iReport tool), which needs to be exported to MS-Word document. I have Word-2007 on my machine and it is working fine with .docx extension (hardcoded). 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.

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).

Please let me know how this can be accomplished.

Alex K
  • 22,315
  • 19
  • 108
  • 236
JavaYouth
  • 1,536
  • 7
  • 21
  • 39
  • 2
    Why do you assume that someone has Ms-Office at all? To find installed software you'll have to look up the windows registry and it is not possible (thank gods) from javascript. – Danubian Sailor Mar 27 '13 at 11:40
  • 1
    If it MUST be export to MS Word, require that your end user have Word 2007. Otherwise, why not also export as ODT and PDF? Then at least your user could read it as PDF, even if they can't edit it in the other formats. – Lisa Mar 27 '13 at 12:17

1 Answers1

0

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; 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.

mikevdg
  • 370
  • 1
  • 7