- 功能预览
运行预览
模板样式
存储返参
导出的Excel
2. 代码实现
//执行sql的函数
procedure TForm1.GetReportData(astrsql:string);
var
strSQL,err:string; i:integer;
begin
strSQL :='set QUOTED_IDENTIFIER off '+astrsql;
//strSQL := astrsql ;
//查询 可支持多个结果集的返回
DM.qryReport.Active:=False;
DM.qryReport.Close;
DM.qryReport.SQL.Clear;
DM.qryReport.SQL.Add(strSQL);
try
DM.qryReport.Open;
except on E: Exception do
begin
showmessage('执行SQL'+strsql+'异常!'+E.Message);
Exit;
end;
end;
end;
//获取桌面的路径
function TForm1.GetShellFolders(strDir: string): string;
const
regPath = '\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders';
var
Reg: TRegistry;
strFolders: string;
begin
Reg := TRegistry.