PxPlus User Forum

Twitter Twitter Twitter

Author Topic: Maximum Number of Columns in a Report View List Box  (Read 1246 times)

Ken Sproul

  • Gold Member
  • ****
  • Posts: 60
    • View Profile
Maximum Number of Columns in a Report View List Box
« on: February 11, 2024, 07:38:07 AM »
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

  • Diamond Member
  • *****
  • Posts: 3818
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: Maximum Number of Columns in a Report View List Box
« Reply #1 on: February 12, 2024, 11:08:54 AM »
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

  • Gold Member
  • ****
  • Posts: 60
    • View Profile
Re: Maximum Number of Columns in a Report View List Box
« Reply #2 on: February 14, 2024, 02:00:05 AM »
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

  • Diamond Member
  • *****
  • Posts: 3818
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: Maximum Number of Columns in a Report View List Box
« Reply #3 on: February 14, 2024, 10:10:12 AM »
Glad to have helped.
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com