-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Assuming Header name is Header1 #102
Comments
Doug—
Can you provide the line number of the places where you are referencing the code that you provided in the original issue report. The code block you reference does not match the code block that I have in Release 39 as shown:
![image](https://github.com/ggreen86/XLSX-Workbook-Class/assets/28057069/072f3593-d230-4c10-bde3-fd5a63a59142)
I see where I can apply your suggestion at line 216 above. Please provide your line number ranges.
Greg
From: Doug Hennig ***@***.***>
Sent: Monday, December 4, 2023 2:15 PM
To: ggreen86/XLSX-Workbook-Class ***@***.***>
Cc: Subscribed ***@***.***>
Subject: [ggreen86/XLSX-Workbook-Class] Assuming Header name is Header1 (Issue #102)
There are a few places that assume the Header object of a column is named Header1 but it may not be. Here's the fix:
* SaveGridToWorkbook:
IF toGrid.HeaderHeight > 0 && Change recommendation by Doug Hennig (if no headers, start in first row)
lnRow = 1
FOR lnCol=1 TO lnColCount
loColumn = toGrid.Columns(laColOrder[lnCol, 2])
*** DH 2023-12-04: don't assume the header object is named Header1
* this.SetCellValue(lnWB, lnSh, 1, lnCol, loColumn.Header1.Caption)
loHeader = loColumn.Controls[1]
this.SetCellValue(lnWB, lnSh, 1, lnCol, loHeader.Caption)
*** DH 2023-12-04: end of change
this.SetCellStyle(lnWB, lnSh, 1, lnCol, loGrid.Columns(laColOrder[lnCol, 2]).HeaderStyleId)
this.SetColumnWidth(lnWB, lnSh, lnCol, this.ConvertPixelsToExcelUnits(loColumn.Width))
ENDFOR
* GetColumnObject:
*** DH 2023-12-04: don't assume the header object is named Header1
*ADDPROPERTY(loColumn, "HeaderCaption", toGridColumn.Header1.Caption)
*ADDPROPERTY(loColumn, "HeaderFontBold", toGridColumn.Header1.FontBold)
*ADDPROPERTY(loColumn, "HeaderFontItalic", toGridColumn.Header1.FontItalic)
*ADDPROPERTY(loColumn, "HeaderFontName", toGridColumn.Header1.FontName)
*ADDPROPERTY(loColumn, "HeaderFontSize", toGridColumn.Header1.FontSize)
loHeader = toGridColumn.Controls[1]
ADDPROPERTY(loColumn, "HeaderCaption", loHeader.Caption)
ADDPROPERTY(loColumn, "HeaderFontBold", loHeader.FontBold)
ADDPROPERTY(loColumn, "HeaderFontItalic", loHeader.FontItalic)
ADDPROPERTY(loColumn, "HeaderFontName", loHeader.FontName)
ADDPROPERTY(loColumn, "HeaderFontSize", loHeader.FontSize)
*** DH 2023-12-04: end of change
* SaveMultiGridToWorkbookEx: I didn't make the change but it's the same fix (two places)
—
Reply to this email directly, view it on GitHub<#102>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AGWB33KMBQXVQ4326JEXHVLYHYOKZAVCNFSM6AAAAABAGPOJPOVHI2DSMVQWIX3LMV43ASLTON2WKOZSGAZDINJUGA3DMNQ>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.******@***.***>>
|
Here's the code for version 39.
Merry Christmas to you and your family! |
I still see this issue in version 44. |
I believe I have added the code fix for the header1 to R46. I will be sending you a test version directly. I will be releasing initially as a beta. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There are a few places that assume the Header object of a column is named Header1 but it may not be. Here's the fix:
The text was updated successfully, but these errors were encountered: