Maximum Number of Columns in a Report View List Box

Started by Ken Sproul, February 11, 2024, 07:38:07 AM

Previous topic - Next topic

Ken Sproul

There seems to be a limit to the number of columns a report view list box can have but I couldn't find any documentation for the limit.


I defined a list box with 267 columns. The first column is defined as S0 (not visible).
While scrolling to the right, the headings stopped scrolling at the 180th visible column.
However, the data for the remaining columns continued to scroll and display.


Is this a limit or a bug?
Is it pxplus or Windows?


Attached is a txt file containing the string used in the fmt= option.
Ken Sproul
DPI Information Service, Inc.
Pivotal Systems LLC

Mike King

There is a limit imposed by Windows itself.

Check out the note at the bottom of: https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.listview.columnheadercollection

Unexpected behavior can result when the combined width of all columns exceeds 32,768 pixels.

So depending on the column widths and the current user font you may be hitting this limit.
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

Ken Sproul

Thanks Mike! That was the issue.
I added logic to calculate the total standard column widths in pixels and scale them down by percentage when the total exceeded 32767.

Ken Sproul
DPI Information Service, Inc.
Pivotal Systems LLC

Mike King

Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com