Skip to content
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

Fix index out of range on Export to Excel when more than 26 columns #491

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nachoalonsoportillo
Copy link

@nachoalonsoportillo nachoalonsoportillo commented May 19, 2024

Fix defect reported via Export to excel more than 26 columns error "string index out of range Code: 0"

string.ascii_uppercase produces an array of 26 characters. Trying to reference anything beyond that, throws the error reported.

The write() method supports two forms of notation to designate the position of cells: row-column notations and A1 notation. My suggestion is that

self._worksheet.write(string.ascii_uppercase[index] + '1', column.column_name, bold)

is changed to:

self._worksheet.write(0, index, column.column_name, bold)

@nachoalonsoportillo nachoalonsoportillo requested a review from a team as a code owner May 19, 2024 10:07
Copy link

@jojohnso-msft jojohnso-msft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

straightforward low risk fix for a customer issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants