This commit is contained in:
Алексей Заблоцкий 2025-07-04 21:39:34 +03:00
parent b0a0662564
commit 951649ad3d
2 changed files with 9 additions and 2 deletions

View File

@ -192,6 +192,8 @@ constructor TReportCommand.Create(ID: string; aProcesor: TNIDBDM;
begin
inherited Create(ID,aProcesor, aSubClass, aLogger,AUser,IDUser);
fReportProcessor:=TReportDM.Create(nil);
fReportProcessor.ID := ID;
fReportProcessor.RepName := ReportName;
fReportProcessor.Name := 'Report'+fProcessor.Name;
fReportProcessor.NidbData := fProcessor;
end;

View File

@ -90,6 +90,7 @@ type
public
RecordID: integer;
NidbData: TNIDBDM;
ID,RepName: string;
procedure ExportReport( ExportType: TExportFileType; Data: TStream; OnStage: TLogger; OnVars: TVariableFillProc);
procedure EditReport(OnVars: TVariableFillProc; OnHash: TCalcHashProc);
end;
@ -694,7 +695,7 @@ begin
try
frxReport.PrepareReport(False);
frxReport.OnPreview := @frxReportPreview;
{$IFDEF DEBUG} frxReport.SaveToFile(Extractfilepath(paramstr(0))+'out/report.fr3'); {$ENDIF}
{$IFDEF DEBUG} frxReport.SaveToFile(format('%sout/%s_%s.fr3',[Extractfilepath(paramstr(0)),RepName,ID])); {$ENDIF}
except on e: Exception do
begin
NidbData.logError(self,e,'frxReport.PrepareReport');
@ -724,6 +725,10 @@ begin
begin
NidbData.log(mtWarning,self,'ERROR EXPORT PDF');
OnStage(mtError,self,'Ошибка выгрузки в PDF');
end
else
begin
{$IFDEF DEBUG} (Data as TMemoryStream).SaveToFile(format('%sout/%s_%s.pdf',[Extractfilepath(paramstr(0)),RepName,ID])); {$ENDIF}
end;
except on e: Exception do
begin