Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Load Report Data Environment
Message
From
29/06/2021 16:11:05
 
 
To
29/06/2021 15:54:48
John Ryan
Captain-Cooker Appreciation Society
Taumata Whakatangi ..., New Zealand
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
01681628
Message ID:
01681634
Views:
43
>>>It will be (somewhat) fancy-pants and I've been working with Greg Green's VFPxWorkbookXLSX class: https://github.com/ggreen86/XLSX-Workbook-Class
>
>Right. I can probably save you some time: we tried creating an xls sheet with [PLACEHOLDER] values in key cells, hoping we could just STRTRAN() values into the FILETOSTR() content for a magically updated Excel sheet- but doesn't work if the replacement isn't the same size as the replaced text, or possibly not even then. I suppose we might have considered very large [PLACEHOLDER] and padded replacement to size. If you have a few moments, might be worth an experiment depending how many cells you want to populate...

That's an imaginative but (to me) nasty-sounding hack. My guess is it would fail if the XLSX was password-protected, even if it might otherwise work. I understand XLSX is a collection of XML files in a ZIP container (but not compressed?). Even if it's not compressed, if the ZIP container has a checksum then directly modifying its contents without updating the checksum might cause issues.

I don't know if you've tried Greg's class, but it offers:

- A full set of primitives to build an XLSX from scratch (if you want), and populate and format cells
- Alternately you can open an existing XLSX you may have pre-formatted in Excel (i.e. a template), and modify/save as its contents as needed
- There are some higher-level functions for common tasks such as cursor-to-Excel

The level of control it offers feels like a good match for what I need to do.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform