你可以将stringgrid做成一个控件,就像dbgrid一样,可以连接数据库,这样就可以用Quickreport
例如:
type
Tssgrid = class(TStringGrid)
procedure ssmousedown(Sender: TObject;
Button: TMouseButton;
Shift: TShiftState;
X, Y: Integer);
procedure ssmouseup(Sender: TObject;
Button: TMouseButton;
Shift: TShiftState;
X, Y: Integer);
procedure beforeopen(sender: tdataset);
procedure afteropen(sender: tdataset);
private
{ Private declarations }
fdatasetname: string;
fsql: string;
protected
procedure ffdatasetname(const value: string);
procedure ffsql(const value: string);
{ Protected declarations }
public
ccol: integer;
query: tquery;
constructor create(aowner: tcomponent);
override;
destructor destroy;
override;
{ Public declarations }
published
property SQL: string read fsql write ffsql;
property DataSetName: string read fdatasetname write ffdatasetname;
{ Published declarations }
end;
再来打印
如果你想要一些打印的话,我发邮件给你。