正在装载数据…… 当安装了Crystal Reports 9后,在delphi的Data Access页中显示Tcrpe和TCrpeDS两个控件, 1)选择报表控件crpe1:Tcrpe和数据源控件qryRptPath:TSQLDataSet及打印设置控件PrintDialog1: TPrintDialog 2)在窗体初始化事件中 var CurrentDir:string; CFGIniFiles: TIniFile; begin //获取报表的数据库连接信息; CurrentDir:=ExtractFileDir(Application.ExeName); try CFGIniFiles:=TIniFile.Create(CurrentDir +'\'+ 'dbxmtsconf.ini'); servername:=CFGIniFiles.ReadString('EXMTNCUS', 'HostName', 'Localhost'); dbuser:= CFGIniFiles.ReadString('EXMTNCUS', 'User_Name', 'LGSAS'); dbPswd:= CFGIniFiles.ReadString('EXMTNCUS', 'Password', 'LGSAS'); dbName:= CFGIniFiles.ReadString('EXMTNCUS', 'DataBase', 'MTNCUS'); finally CFGIniFiles.Free; end; //获取参数报表路径 with qryRptPath do begin Close; CommandText:='select * from PLMPARM where PARA_CODE=''RPT'''; Open; if not IsEmpty then rptPath:=FieldByName('PARA_VALUE').AsString else rptPath:=CurrentDir+'\RPT\'; end; 本文来源:http://blog.csdn.net/sheshou2/archive/2007/07/02/1675581.aspx
|