dxComponentPrinter1.Print(True,nil,dxComponentPrinter1Link1);


dxComponentPrinter1.Preview(True,dxComponentPrinter1Link1);


var
  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.Print(True, nil, dxComponentPrinter1Link1);