Hi Larsa,
I try to create a row group with initialized row status = "collapsed".
For example:
"Xls[0].GroupRows(firstGroupRow, lastGroupRow, true);"
But ACollapsed Parameter in TXLSWorksheet.Grouprows don’t works, rows are allways expanded
What's wrong? Could you help please?
Thanks in advance
Michael
Row Groups
Re: Row Groups
Hi Michael,
I do the same task like this:
It works fine
I do the same task like this:
Code: Select all
Xls[0].GroupRows(firstGroupRow, lastGroupRow, [b]False[/b]);
Xls[0].Rows.ToggleGrouped(lastGroupRow+1);
Re: Row Groups
Hi!
I run into the same problem.
As far as I can see in the source code in procedure TXLSWorksheet.GroupRows there is just one line missing
in order to make
"Xls[0].GroupRows(firstGroupRow, lastGroupRow, true);
work properly:"
procedure TXLSWorksheet.GroupRows(const ARow1, ARow2: integer; ACollapsed: boolean);
var
i,Level: integer;
Row: TXLSRow;
begin
for i := ARow1 to ARow2 do begin
Row := FRows;
Level := Row.OutlineLevel;
Inc(Level);
if Level > 7 then
raise XLSRWException.Create('Row grouping level more than 7.');
Row.OutlineLevel := Level;
Row.CollapsedOutline := ACollapsed;
// MISSING
Row.Hidden := ACollapsed;
end;
end;
A similar fix can be done in
TXLSWorksheet.GroupColumns:
just add
Col.Hidden := ACollapsed;
at the end
@Larsa:
If this is correct, could you please add fix this in the next version? Thank you.
I run into the same problem.
As far as I can see in the source code in procedure TXLSWorksheet.GroupRows there is just one line missing
in order to make
"Xls[0].GroupRows(firstGroupRow, lastGroupRow, true);
work properly:"
procedure TXLSWorksheet.GroupRows(const ARow1, ARow2: integer; ACollapsed: boolean);
var
i,Level: integer;
Row: TXLSRow;
begin
for i := ARow1 to ARow2 do begin
Row := FRows;
Level := Row.OutlineLevel;
Inc(Level);
if Level > 7 then
raise XLSRWException.Create('Row grouping level more than 7.');
Row.OutlineLevel := Level;
Row.CollapsedOutline := ACollapsed;
// MISSING
Row.Hidden := ACollapsed;
end;
end;
A similar fix can be done in
TXLSWorksheet.GroupColumns:
just add
Col.Hidden := ACollapsed;
at the end
@Larsa:
If this is correct, could you please add fix this in the next version? Thank you.