10. Februar 2023 12:02
SalesInvHeader := Rec;
CurrPage.SETSELECTIONFILTER(SalesInvHeader);
Z :=0;
WITH SalesInvHeader DO BEGIN
IF FINDSET THEN BEGIN
REPEAT
SaveDocumentAsPDFToStream(SalesInvHeader, TempBlob);
Z:= Z + 1;
UNTIL SalesInvHeader.NEXT = 0;
END;
END;
LOCAL SaveDocumentAsPDFToStream(DocumentVariant : Variant;VAR TempBlob : TEMPORARY Record TempBlob)
ReportID := 50176;
DataTypeMgt.GetRecordRef(DocumentVariant, DocumentRef);
TempBlob.Blob.CREATEOUTSTREAM(VarOutStream);
IF REPORT.SAVEAS(ReportID, '', REPORTFORMAT::Pdf, VarOutStream, DocumentRef) THEN
BEGIN
FileMgt.BLOBExport(TempBlob,'OST'+ FORMAT(Z) + '.pdf',FALSE);
END
ELSE BEGIN
ERROR(TxtCouldNotSaveReport, ReportID);
END;
10. Februar 2023 12:09
10. Februar 2023 12:52
10. Februar 2023 13:24
10. Februar 2023 14:14
SalesInvHeader := Rec;
CurrPage.SETSELECTIONFILTER(SalesInvHeader);
Z :=0;
WITH SalesInvHeader DO BEGIN
IF FINDSET THEN BEGIN
REPEAT
SalesInvHeader2 := SalesInvHeader;
SalesInvHeader2.SETRECFILTER;
SaveDocumentAsPDFToStream(SalesInvHeader2, TempBlob);
SLEEP(500);
Z:= Z + 1;
UNTIL SalesInvHeader.NEXT = 0;
END;
END;
10. Februar 2023 14:32
14. Februar 2023 10:08
CurrPage.SETSELECTIONFILTER(SalesInvHeader);
Z :=0;
WITH SalesInvHeader DO BEGIN
IF FINDSET THEN BEGIN
REPEAT
SalesInvHeader2 := SalesInvHeader;
SalesInvHeader3.SETFILTER("No.",'%1',SalesInvHeader2."No.");
IF SalesInvHeader3.FINDFIRST THEN
SaveDocumentAsPDFToStream(SalesInvHeader3, TempBlob);
Z:= Z + 1;
UNTIL SalesInvHeader.NEXT = 0;
END;
END;
LOCAL SaveDocumentAsPDFToStream(DocumentVariant : Variant;VAR TempBlob : TEMPORARY Record TempBlob)
ReportID := 50176;
DataTypeMgt.GetRecordRef(DocumentVariant, DocumentRef);
TempBlob.Blob.CREATEOUTSTREAM(VarOutStream);
IF REPORT.SAVEAS(ReportID, '', REPORTFORMAT::Pdf, VarOutStream, DocumentRef) THEN
BEGIN
FileMgt.BLOBExportToServerFile(TempBlob,'c:\temp\ost'+ FORMAT(Z) + '.pdf');
Z:= Z + 1;
END
ELSE BEGIN
ERROR(TxtCouldNotSaveReport, ReportID);
END;
16. Februar 2023 16:06
16. Februar 2023 21:49