K ko Unregistered / Unconfirmed GUEST, unregistred user! 2004-01-06 #1 我想将查询表单的内容逐行输出到打印机(以便控制报表的格式)。不知如何实现????
W whhtao Unregistered / Unconfirmed GUEST, unregistred user! 2004-01-07 #3 将记录按需要的格式写到PRINTER的CANVAS上。
K ko Unregistered / Unconfirmed GUEST, unregistred user! 2004-01-07 #4 to whhtao: 如何写到PRINTER的CANVAS上???可简单举个例吗?
S shaga Unregistered / Unconfirmed GUEST, unregistred user! 2004-01-07 #5 你用打印控件啊,DateSet为一条记录,用QReport或fastReport打印就行了
W whhtao Unregistered / Unconfirmed GUEST, unregistred user! 2004-01-07 #6 save_font:=Tfont.Create; time_string:='打印日期: '+inttostr(yearof(now))+'年'+inttostr(monthof(now))+'月'+inttostr(dayof(now))+'日'; try y_temp:=y; save_font.Assign(printer.Canvas.Font); printer.Canvas.Font.Assign(Atitlefont); x_temp:=Awidth div 2-printer.Canvas.TextWidth(Atitle) div 2; printer.Canvas.TextOut(x_temp,y_temp,Atitle); y_temp:=y_temp+printer.Canvas.TextHeight(Atitle)+printer.Canvas.TextHeight(Atitle) div 2; btextfont.Size:=bottom_text_size; printer.Canvas.Font.Assign(Btextfont); printer.Canvas.TextOut(x,y_temp,time_string); printer.Canvas.Font.Assign(save_font); finally save_font.Free; end; 自己在帮助中查一下TCANVAS类,有很多方法。
save_font:=Tfont.Create; time_string:='打印日期: '+inttostr(yearof(now))+'年'+inttostr(monthof(now))+'月'+inttostr(dayof(now))+'日'; try y_temp:=y; save_font.Assign(printer.Canvas.Font); printer.Canvas.Font.Assign(Atitlefont); x_temp:=Awidth div 2-printer.Canvas.TextWidth(Atitle) div 2; printer.Canvas.TextOut(x_temp,y_temp,Atitle); y_temp:=y_temp+printer.Canvas.TextHeight(Atitle)+printer.Canvas.TextHeight(Atitle) div 2; btextfont.Size:=bottom_text_size; printer.Canvas.Font.Assign(Btextfont); printer.Canvas.TextOut(x,y_temp,time_string); printer.Canvas.Font.Assign(save_font); finally save_font.Free; end; 自己在帮助中查一下TCANVAS类,有很多方法。
J jackchin Unregistered / Unconfirmed GUEST, unregistred user! 2004-01-07 #7 基本上,你要用报表的控件,例如QuickRep 如果只用Printer.Canvas,那很难,你要做很多事情 用Printer,基本的框架是 选择,设置Printer的各项参数 Printer.BeginDoc; 画吧,用Printer.Canvas Printer.EndDoc;
基本上,你要用报表的控件,例如QuickRep 如果只用Printer.Canvas,那很难,你要做很多事情 用Printer,基本的框架是 选择,设置Printer的各项参数 Printer.BeginDoc; 画吧,用Printer.Canvas Printer.EndDoc;