- Posts: 2
- Thank you received: 0
- Forum
- CodeTyphon Studio
- CodeTyphon Studio Components and Libraries
- Documents Development
- Auto size columns Fspreadsheet
×
Components and Libraries for Documents Development, discussions, problems and suggestions
Question Auto size columns Fspreadsheet
- Randall G Garcia C
- Topic Author
- Offline
- New Member
-
Less
More
5 years 7 months ago - 5 years 7 months ago #7792
by Randall G Garcia C
Auto size columns Fspreadsheet was created by Randall G Garcia C
this would be the correct procedure in the package pl_fpspreadsheet
the line marked in red serious which should be added
procedure TsCustomWorksheetGrid.AutoAdjustColumn(ACol: Integer);
var
gRow: Integer; // row in grid coordinates
r: Cardinal;
lastRow: Cardinal;
w, maxw: Integer;
txt: String;
begin
if Worksheet = nil then
exit;
lastRow := Worksheet.GetLastOccupiedRowIndex;
maxw := -1;
for r := 0 to lastRow do
begin
gRow := GetGridRow(r);
txt := GetCellText(ACol, gRow);
PrepareCanvas(ACol, gRow, []);
w := Canvas.TextWidth(txt);
if (txt <> '') and (w > maxw) then maxw := w;
end;
if maxw > -1 then
maxw := maxw + 2*constCellPadding
else
maxw := DefaultColWidth;
if Acol<Worksheet.GetLastOccupiedColIndex then //LINE TO FIX THE PROBLEM
ColWidths[ACol] := maxW;
HeaderSized(true, ACol);
end;
the line marked in red serious which should be added
Last edit: 5 years 7 months ago by Randall G Garcia C.
Please Log in or Create an account to join the conversation.
- Sternas Stefanos
-
- Offline
- Moderator
-
- Ex Pilot, M.Sc, Ph.D
5 years 7 months ago #7793
by Sternas Stefanos
PilotLogic Architect and Core Programmer
Replied by Sternas Stefanos on topic Auto size columns Fspreadsheet
Thanks Sir
we will test and report
we will test and report
PilotLogic Architect and Core Programmer
Please Log in or Create an account to join the conversation.
- Randall G Garcia C
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 2
- Thank you received: 0
5 years 7 months ago - 5 years 7 months ago #7796
by Randall G Garcia C
Replied by Randall G Garcia C on topic Auto size columns Fspreadsheet
Thanks, do a great job, and I have applications in production and are excellent, thanks guys
Last edit: 5 years 7 months ago by Randall G Garcia C.
Please Log in or Create an account to join the conversation.
- Sternas Stefanos
-
- Offline
- Moderator
-
- Ex Pilot, M.Sc, Ph.D
5 years 7 months ago #7797
by Sternas Stefanos
PilotLogic Architect and Core Programmer
Replied by Sternas Stefanos on topic Auto size columns Fspreadsheet
Thanks Sir
we add your fix to lab CT 5.5 ver
we add your fix to lab CT 5.5 ver
PilotLogic Architect and Core Programmer
Please Log in or Create an account to join the conversation.