1. Shirley Sanjuan
  2. PowerBuilder
  3. Tuesday, 2 October 2018 21:20 PM UTC

How can I read an ods(Open Document Spreadsheet) File in Powerbuilder without using Excel Application(Excel is not installed in the Computer)?

Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 3 October 2018 13:39 PM UTC
  2. PowerBuilder
  3. # 1

Hi Shirley;

     PB can easily read any binary file via its FileOpen () & FileReadEx ( ) commands. The real issue is understanding the data stream and then its representation - to which, PB would have no idea about an Excel or Open Office document equivalent formats.

     Saying that, the key to visually rendering any binary data l(ike a spreadsheet) would be to have a 3rd party control that the PB app could call & feed in the binary data in order to render it. For example (just Googling around a little ...

https://www.spreadsheetgear.com/?aw=excel+control

https://www.edrawsoft.com/office-ocx.php

     Of course, why not just have the spreadsheet rendered something "generic" like a in PDF format?

HTH

Regards ... Chris

Comment
  1. Brad Mettee
  2. Wednesday, 3 October 2018 15:19 PM UTC
Chris,

I think the original poster wants to open the files to read the data from cells, not render it on screen.



ODS files are compressed in ZIP format. They contain multiple files (metadata, styles, a thumbnails in png format, content, and a few others). This means that opening and reading data requires zip file extraction, and xml parsing.



The data is in content.xml, but rows/columns are not explicitly named, so the only way to find cell C13 would be to load all of the data into a grid, and see what's there. I've looked around on the web a bit and didn't see any COM objects or DLLs that allow this access. Plenty of Python/Java/PHP scripts out there though.



The only way I can see to accomplish this would be to use a ZIP library to extract the content.xml file, and parse that with the PB XML parsing object.
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.