delphidevexpresstcxgrid

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


I'm testing the printing system of DevExpress to print a Grid (cxgrid), the printing system works ok, but there is a line saying on the printed document:

<Filter is Empty>

my question is how to remove this line ?

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;

Solution

  • You can hide the filter bar from the report by setting the OptionsView.FilterBar property to False:

    dxComponentPrinter1Link1.OptionsView.FilterBar := False;
    

    In addition, if you want to hide the filter bar only when there are no filters, you could do as follows:

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