XLSX-Workbook-Class icon indicating copy to clipboard operation
XLSX-Workbook-Class copied to clipboard

Recommendations for printOptions

Open zulqasar opened this issue 2 years ago • 0 comments

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 

zulqasar avatar Aug 22 '22 11:08 zulqasar