ggreen86 / XLSX-Workbook-Class

VFP Class to Create an XLSX Workbook without Excel Automation or Installed
45 stars 16 forks source link

feature request / SaveTablesToWorkBook #50

Open lscheffler opened 3 years ago

lscheffler commented 3 years ago

SaveTablesToWorkBook and SaveTablesToWorkBookEx do a great job. Except I can not adress the location. It will create a new sheet and start on A1. What I like would the possibility to (optionally) address:


Parameters like:

LPARAMETERS tcAlias, tnWB, tlFreeze, tlSaveWB,;
tvSheet, toHeaderLoc, toDataLoc

where

tvSheet

Type Char

as existing tcSheetName

Type Num

number (Id) of existing sheet to write to

Locs

toHeaderLoc and toDataLoc could be an empty object like

toHeaderLoc and toDataLoc are used for tvSheet as number only, only for existing tnWB too.


In this way I could fill data into an existing workbook / template and should be able to keep existing formats etc. As far as I see the write would work with existing sheets/cells.

ggreen86 commented 3 years ago

Will look into adding this feature request. The SaveTablesToWorkBookEx() method is designed to write directly to a new spreadsheet file; so there is not an existing sheet to write to. Method SaveTablesToWorkBook() could be enhanced to selectively create a new sheet or write to an existing sheet. Both methods could have optional parameters for the starting column and row. However, the checking of existing data in the cells would add considerable overhead and then what to do if found? So I don't think this would be feasible.

lscheffler commented 3 years ago

Sorry for the delay. First full of work, then vacation. :D
What I like to have for SaveTablesToWorkBook:

Sure, it could be an additional method, what keeps SaveTablesToWorkBook as simple and fast.