0

我一直试图在 FastReport 的交叉表中隐藏行,但我找不到方法。

当我隐藏 MemoViews 时,它给我留下了一个空白空间,我不知道如何摆脱它。

这是代码:

procedure DBCross1OnPrintCell(Memo: TfrxMemoView; RowIndex, ColumnIndex, CellIndex: Integer; RowValues, ColumnValues, Value: Variant);
begin
       if (cellindex = 1) and (rowindex = 1) then begin
               memo.visible := false;
               memo.height  := 0;    
       end;                                  
end;

procedure DBCross1OnPrintRowHeader(Memo: TfrxMemoView; HeaderIndexes, HeaderValues, Value: Variant);
begin                                           
  if (trim(memo.memo.text) = 'HORA') and ( HeaderIndexes[0] = 1 ) then begin              
       memo.visible:=false;
       memo.height  := 0;           
  end;                                  
  if (trim(memo.memo.text) = 'individual') then begin
       memo.height  := memo.height /2;               
  end;
end;
4

2 回答 2

0

Use event OnCalcHeight on DBCross

于 2013-06-24T11:19:57.503 回答
0

我找到了解决这个问题的一种方法。您必须在交叉表中禁用自动调整大小,并在您已经获得的相同过程中从脚本中管理单元格的大小和位置。

像这样的东西

*

*procedure DBCross1OnPrintCell(Memo: TfrxMemoView; RowIndex, ColumnIndex, CellIndex: Integer; RowValues, ColumnValues, Value: Variant);
begin

if (checkbox1.checked = false) and (cellindex = 0) then begin
memo.width := 0;    
memo.visible := false;
memo.printable := false;          
end; if (checkbox1.checked = false) and (cellindex <> 0) then begin
memo.left := memo.left - ((columnindex+1)*100);
end;
end;
procedure DBCross1OnPrintColumnHeader(Memo: TfrxMemoView; HeaderIndexes, HeaderValues, Value: Variant);
begin

if (checkbox1.checked = false) and (trim(memo.memo.text) = 'Первичные пациенты') then begin
memo.width := 0; memo.text := '';memo.visible := false;memo.printable := false; end;          

if (checkbox1.checked = false) and (HeaderIndexes[0] >= 0) and (memo.width > 100) then begin
memo.width := memo.width - 100; end;    

end;
end;*

*

于 2018-01-25T06:42:23.677 回答