XLSX-Workbook-Class
XLSX-Workbook-Class copied to clipboard
Recommendations for printOptions
Another need I came across was center horizontally and vertically. I made the following changes in my code to accommodate this.
*-- createWorkingCursors method
*- added 2 columns/fields to xl_sheets cursor
centerH L
centerV L
*-- Added a new method called setprintoptions
lparameters tnWb, tnSh, tlCenterH, tlCenterV
if this.GetSheetRecord(tnWb, tnSh)
replace centerH with tlCenterH, centerV with tlCenterV in xl_sheets
endif
Lastly in writeSheetxmls method before sheet margin /pageMargins code, add this code
if xl_sheets.centerH or xl_sheets.centerV
write(lhShFile, '<printOptions')
if xl_sheets.centerH
write(lhShFile, ' horizontalCentered="1"')
endif
if xl_sheets.centerV
write(lhShFile, ' verticalCentered="1"')
endif
fwrite(lhShFile, '/>')
endif