Heute 10:16
FileName := StrSubstNo('NG#A%1#L%2#C%3#N%4#Z%5.PDF', Setup."Alias Name", SalesShipmentHeader."No.", NoofCopies, Setup."Exit Relation", TimeStamp);
TempBlob.CreateOutStream(OutS);
ReportSelection.SetRange(Usage, ReportSelection.Usage::"S.Shipment");
if ReportSelection.find('-') then begin
RecRef.GetTable(SalesShipmentHeader);
FldRef := RecRef.Field(SalesShipmentHeader.FieldNo("No."));
FldRef.SetRange(SalesShipmentHeader."No.");
if RecRef.FindFirst() then begin
Clear(SalesShipment);
SalesShipment.SetSkipCopy(true);
SalesShipment.UseRequestPage(false);
SalesShipment.SaveAs('', ReportFormat::Pdf, OutS, RecRef);
FileManagement.BLOBExportToServerFile(TempBlob, StrSubstNo('%1\%2', FilePath, FileName));
Commit();
end;
end;