lsReport.CachePages := True;
with lsReport do begin
lsReport.UserName := 'Report';
DataPipeline := lsDBPipeLine;
Template.FileName := TemplateFileName;
Template.format := ftASCII;
lsDesigner.Report := lsReport;
if not FileExists(TemplateFileName) then
begin
lsDesigner.ShowModal;
// template.Save;
end
else
begin
Template.LoadFromFile;
if Designer then lsDesigner.ShowModal
else begin
if Pnt then
lsReport.DeviceType := 'Printer';
lsReport.ShowPrintDialog := aShowPrintDialog;
lsReport.Print;
end;
end;
end;
finally
lsReport.Free;
lsDBPipeline.Free;
lsDesigner.Free;
DataSet.EnableControls;
end;
end;