gpt4 book ai didi

delphi - DevExpress CxGrid 组件打印机 : how to remove the line on printed document?

转载 作者:行者123 更新时间:2023-12-02 02:11:02 28 4
gpt4 key购买 nike

我正在测试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;

关于delphi - DevExpress CxGrid 组件打印机 : how to remove the line <Filter is Empty> on printed document?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56056709/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com