Hide column in DB cross-tab for FastReport

2019-07-22 13:57发布

I've been trying to hide column from a DB cross-tab in FastReport when the column header Value is 14001 ; but is not work down syntax !!!

My Report

Here's the code:

procedure DBCross2OnCalcWidth(ColumnIndex: Integer; ColumnValues: Variant;var Width: Extended);
begin 
if (VarToStr(ColumnValues[0]) = '14001') then 
    Width := 0;
end;

1条回答
老娘就宠你
2楼-- · 2019-07-22 14:30

Try add procedure trigged on print and collection HeaderValues[0]

procedure DBCross2OnPrintColumnHeader(Memo: TfrxMemoView; HeaderIndexes, HeaderValues, Value: Variant);
begin
  if (VarToStr(HeaderValues[0]) = '14001') then
  begin
    Memo.Width := 0;
    Memo.Height := 0;
    Memo.Printable := false;
    Memo.Visible := false;                          
  end;                      
end;
查看更多
登录 后发表回答