TXLSWorksheet.GroupRows does not work
Posted: Wed Mar 13, 2013 10:24 am
Hi.
I'm trying to group several rows in an Excel sheet I generated using XLSReadWriteII V5 (5.10.03).
I created a new sheet, generated some content in it and then used GroupRows(<minRow>, <maxRow>, True) to generate a colapsable/expandalbe group of rows.
It seems like this procedure does not do anything, since the exported sheet looks equal with or without calling this function (no row group was generated).
I then looked into the source and found the reason for this issue.
Reason seems to be the setter of the TXLSRow propery OutlineLevel:
This code will not set/modify FRowItem.OutlineLevel in case it was already assigned before.
Changing the code to the following fixed this issue:
With this code the row groups are generated correctly.
I'm not sure if this modification may have any negative side effects, so here my questions:
1. From our view: Could this modification cause any side effects?
2. Will you apply this (or any other kind of) fix in the next version?
Another issue is, that when I pass True for parameter ACollapsed (TXLSWorksheet.GroupRows) it does not seem to have any effect.
The row group is still expanded.
Is this a known issue?
Thanks in advance and best regards!
Ajoschi
I'm trying to group several rows in an Excel sheet I generated using XLSReadWriteII V5 (5.10.03).
I created a new sheet, generated some content in it and then used GroupRows(<minRow>, <maxRow>, True) to generate a colapsable/expandalbe group of rows.
It seems like this procedure does not do anything, since the exported sheet looks equal with or without calling this function (no row group was generated).
I then looked into the source and found the reason for this issue.
Reason seems to be the setter of the TXLSRow propery OutlineLevel:
Code: Select all
procedure TXLSRow.SetOutlineLevel(const Value: integer);
begin
if FRowItem <> Nil then
FRowItem.Height := Value
else if Value <> 0 then begin
FRowItem := FOwner.FCells.AddRow(FIndex,XLS_STYLE_DEFAULT_XF);
FRowItem.OutlineLevel := Value;
end;
end;
Changing the code to the following fixed this issue:
Code: Select all
procedure TXLSRow.SetOutlineLevel(const Value: integer);
begin
if FRowItem <> Nil then
FRowItem.Height := Value
else
FRowItem := FOwner.FCells.AddRow(FIndex,XLS_STYLE_DEFAULT_XF);
if Value <> 0 then begin
FRowItem.OutlineLevel := Value;
end;
end;
I'm not sure if this modification may have any negative side effects, so here my questions:
1. From our view: Could this modification cause any side effects?
2. Will you apply this (or any other kind of) fix in the next version?
Another issue is, that when I pass True for parameter ACollapsed (TXLSWorksheet.GroupRows) it does not seem to have any effect.
The row group is still expanded.
Is this a known issue?
Thanks in advance and best regards!
Ajoschi