发现两个问题 1.在uses里加入zyprint.编译的时候提示缺少这个文件话,在tools---Environment options-Library---Library---Library Path增加这个文件的所在目录. 2.在uses里把HtGrids去掉. ========== 打印自己所需数据只要把数据填充到stringgrid里就可了,例: var tempGrid:TStringGrid; //数据表 R,C:Integer; Ds:TADODataSet; begin try tempGrid:=TStringGrid.Create(nil); tempGrid.Hint:='数据表'; Ds:=TADODataSet.Create(nil); Ds.Connection:=AdoConn; Ds.CommandText:='select * from a '; Ds.Open; //将数据填充入tempGrid if not Ds.Eof or not Ds.Bof then begin tempGrid.RowCount:=ds.RecordCount+1; tempGrid.ColCount:=ds.FieldCount; for C:=0 to ds.FieldCount -1 do begin Ds.First; tempGrid.Cells[C,0]:=ds.FieldDefs[c].Name; for R:=1 to Ds.RecordCount do begin tempGrid.Cells[c,r]:=Ds.Fields[c].AsString; ds.Next; end; end; end; //传入tempGrid调用打印 CallDllPrint('zyPrintcrt.dll',Application,AdoConn,tempGrid,nil,nil,nil,nil,nil,nil,Self.Caption,pState); finally tempGrid.Free; Ds.close; Ds.free; end; end;