Note that there are some explanatory texts on larger screens.

plurals
  1. POExport Lotus Notes rich-text mime content into Word/Excel via Apache-POI
    primarykey
    data
    text
    <p>I created a webpage and want to allow the users to export the content of the pages. For that I used the Apache-POI libs. That works fine for text. But how can I export mime content? If I change the rich-text properties to 'Store content as html/mime' (because I want to format the content in Notes and sometimes the content contains an image). If that is not possible what are useable alternatives in a xpage?</p> <p>The code below will be executed as a xAgent.</p> <p>Thanks Armin</p> <pre><code>importPackage(java.io); importPackage(org.apache.poi.hwpf); importPackage(org.apache.poi.hwpf.usermodel); importPackage(org.apache.poi.poifs.filesystem); var docID = sessionScope.contentUNID; var nv:NotesView = database.getView("(allByKey)"); var doc:NotesDocument = nv.getDocumentByKey(docID, true); var fs:POIFSFileSystem = new POIFSFileSystem(new FileInputStream("empty.doc")); var wdoc:HWPFDocument = new HWPFDocument(fs); var wdRange:Range = wdoc.getRange(); wdRange.insertBefore(doc.getItemValueString("title")); wdRange.insertAfter(doc.getMIMEEntity("content")); !!!doesn'twork var extCont = facesContext.getExternalContext(); var pageResponse = extCont.getResponse(); var pageOutput = pageResponse.getOutputStream(); pageResponse.setContentType("application/vnd.ms-word"); pageResponse.setHeader("Cache-Control", "no-cache"); pageResponse.setHeader("Content-Disposition","inline; filename=export.doc"); wdoc.write(pageOutput); pageOutput.flush(); pageOutput.close(); facesContext.responseComplete(); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload