cxgrid打印

  begintime,endtime:string;
begin
  begintime := FormatDateTime('yyyy-MM-dd 00:00:00',dtp_begin.DateTime);
  endtime := FormatDateTime('yyyy-MM-dd 23:59:59',dtp_end.DateTime);
  dxComponentPrinter1Link1.ReportTitle.Text := '日期:' + begintime + '至' + endtime;
  dxComponentPrinter1Link1.ReportTitle.Font.Size := 10;
  dxComponentPrinter1Link1.ReportTitle.Font.Name := '宋体';
  dxComponentPrinter1Link1.PrinterPage.PageHeader.CenterTitle.Text := '科室收入统计';
  dxComponentPrinter1Link1.PrinterPage.PageHeader.Font.Size := 14;
  dxComponentPrinter1Link1.PrinterPage.PageHeader.Font.Name := '宋体';

  dxComponentPrinter1.Preview(True,dxComponentPrinter1Link1);

//dxComponentPrinter1.Print(True,nil,dxComponentPrinter1Link1);

你可能感兴趣的:(打印,cxgrid)