DevExpress CxGrid ComponentPrinter:如何删除打印文档上的 <Filter is Empty> 行?

DevExpress CxGrid ComponentPrinter: how to remove the line <Filter is Empty> on printed document?

我正在测试DevExpress的打印系统打印一个Grid(cxgrid),打印系统工作正常,但是打印出来的文件上有一行说:

<Filter is Empty>

我的问题是如何删除这一行?

procedure TFormMain.Btn_PrintClick(Sender: TObject);
procedure ReportPageSetUp(APL          : TBasedxReportLink;
                                APaperSize   : Integer;
                                AOrientation : Integer;
                                AFitToPage   : Boolean;
                                ATitle       : String;
                                ACenterTitle : String;
                                ATitleFont   : String;
                                AFontStyle   : TFontStyles;
                                ATitleSize   : Integer);


begin
  APL.PrinterPage.DMPaper:=APaperSize;


  case AOrientation of
   0 : APL.PrinterPage.Orientation:=dxPrnDev.poPortrait;
   1 : APL.PrinterPage.Orientation:=dxPrnDev.poLandscape;
  end;


  APL.ShrinkToPageWidth:=AFitToPage;
  APL.ReportTitle.Text:=ATitle;
  APL.PrinterPage.PageHeader.LeftTitle.Clear;
  APL.PrinterPage.PageHeader.CenterTitle.Clear;
  APL.PrinterPage.PageHeader.RightTitle.Clear;
  APL.PrinterPage.PageHeader.Font.Name:=ATitleFont;
  APL.PrinterPage.PageHeader.Font.Style:=AFontStyle;
  APL.PrinterPage.PageHeader.Font.Size:=ATitleSize;
  APL.PrinterPage.PageHeader.LeftTitle.Add('username');
  APL.PrinterPage.PageHeader.CenterTitle.Add(ACenterTitle);
  APL.PrinterPage.PageHeader.RightTitle.Add('[date printed] [time printed]');


  APL.PrinterPage.ApplyToPrintDevice;
END;
var
  AOrientation: byte;
begin
  AOrientation := Integer(True);
  ReportPageSetUp(dxComponentPrinter1Link1, DMPAPER_A4, AOrientation, true,
                        'Title 1' ,
                       'Title 2',
                       'Times New Roman',[fsBold],10);

  dxComponentPrinter1.Preview(true, dxComponentPrinter1Link1);
end;

您可以通过将 OptionsView.FilterBar 属性 设置为 False:

来隐藏报告中的过滤栏
dxComponentPrinter1Link1.OptionsView.FilterBar := False;

另外,如果你只想在没有过滤器的时候隐藏过滤栏,可以如下操作:

dxComponentPrinter1Link1.OptionsView.FilterBar := not dxComponentPrinter1Link1.Grid.ActiveView.DataController.Filter.IsEmpty;