Discussion

Read and Write MS Word,Excel

Are there any other ways to Read and Write MS Excel and Word documents using PRPC Activities rather than using Apache POI.??

**Moderation Team has archived post**

This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.

Comments

Keep up to date on this post and subscribe to comments

April 19, 2010 - 3:54am

Apache POI is the library used for reading and writing MS documents.
I am not aware of any other way, but you could wrap the main functionality you need in activities which you then can use in other activities.

Pega
April 20, 2010 - 5:54pm

Of course, if the Excel is saved as CSV format, it just a text file (no formulas, just values), and can be read by Rule-Service-File and Rule-Parse-Delimited.

http://pdn.pega.com/DevNet/PRPCv5/KB/25573.asp

And both XLS and DOC files can be saved as HTM, but the result is pretty complicated HTML.

April 21, 2010 - 2:38am

btw: if you want to create simple Excel documents, you can create html with some tables and serve it with a content type of "application/vnd.ms-excel" . This will open Excel and each table cell will be converted to an excel cell. But you will not be able to create formulars.

Another trick (which pega often uses) is to create an excel or word document which creates some macros which read in the data. Instead of sending the data directly to the client, you will send the excel sheet which (when opened) will request the data from the server.

So it really depends on your requirements...

April 30, 2010 - 5:06am

Hi,

Another method would be to convert the excel file to XML Spreadsheet (Excel 2002 or Later) and then use Parse XML rules (Rule-Parse-XML) to parse the file.

You can apply the same method in a reverse manner to create Excel files.

Thanks and Regards
Indrajith

January 14, 2013 - 11:08pm

Hi MANAMPEI,

Can you please let me know how to convert Excel sheet to a XML Spread sheet. Thansk a lot.

Karthick K

January 27, 2013 - 7:33am

Hi Karthick-2

 

You have to save the Excel sheet into XML format, to do that,

Office Button-->Save As-->Other Formats-->Save As Type(XML Spreadsheet 2003)

 

Regards

Indrajith

December 17, 2013 - 8:29am

Hi,

Is there any way the excel data can be converted to HTML. I have a URL of the excel location. How that can be converted to HTML ?

Pega
May 14, 2014 - 9:39am

You do not have to re-save Excel or Word documents as XML since these days they are, in fact, zipped XML if stored as .docx for Word and .xls for Excel.  

You can see this by right-clicking on an Excel spreadsheet, selecting 7-zip, and choosing "Open Achive".

An XSL transform can be run against xl/worksheet.xml file to simplify the format.

Apply-Parse-XML can then be executed to populate a Clipboard page.

That page can be validated.  If correct, the page can then be Obj-Saved with "Write Now" checked.

 

May 30, 2016 - 4:27am
Response to PEDEL

Hi PEDEL,

 

Can you guide me if I understood correctly.

 

So I have a filePath control to allow user to upload excel or docx file. I got the abstract path(file://...) from the pxRequestor page. Now how to transfer the .xlsx or .docx file to xml format so that I can use parse-xml on it. Please guide me. I have implemented using one pega OOTB activity (MSOParseExcel) and that one is working fine. I just got curious of your approach. Please guide.

 

Thanks,

Saikat