Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Load Report Data Environment
Message
From
30/06/2021 02:23:07
 
 
To
30/06/2021 02:17:35
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
01681628
Message ID:
01681642
Views:
38
>>>>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...
>
>Once upon a time I managed to do a lot using Marc Grajower's approach (well, he was my boss at the time :), to use named ranges in an excel sheet (which would serve as a template), then either stuff values in them or do a range.select(), then .selection.paste() - and then paste the contents of what you get with vfp.datatoclip() - possibly losing the header row first. The named ranges gave us the ability to hit any cell with a value without exactly knowing its row and column - these could change at any time, columns were specially prone to insertion or move. The range where multiple rows were pasted would get a sufficient number of rows inserted first. This worked like a charm - the big and bulky insertion of multiple rows was done in about two microjiffies, and the precise filling of various cells in the header was done without needing to know their coordinates.

Interesting - I'll have to ponder how I might make use of that :)
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