admin管理员组文章数量:1432764
I'm trying to save a Salesinvoice
object in CompanyA
Business central as a pdf file in blob storage and afterward save it as a attached document on a purchase order in CompanyB
.
I have made a table which is visible for all company, and I try to save the pdf from CompanyA
in blobfield.
This is my code:
procedure GetSalesOrderDocumentFromHB(var PurchaseHeader: Record "Purchase Header"): Boolean
var
PostedSalesInvoiceNo: Code[20];
inss: InStream;
outss: OutStream;
Parameters: Text;
Blob: record "TableBlob";
begin
PostedSalesInvoiceNo := PurchaseHeader."Vendor Invoice No.";
if PostedSalesInvoiceNo <> '' then
begin
postedSalesInvoice.ChangeCompany('CompanyA');
if postedSalesInvoice.GET(PostedSalesInvoiceNo) then
begin
TempBlob.CreateOutStream(outss);
Blob.INIT;
//Rec.ID := 12;
blob.ID := PostedSalesInvoiceNo;
blob.MyBlob.CREATEOUTSTREAM(outss);
Parameters := StrSubstNo('<?xml version="1.0" standalone="yes"?><ReportParameters name="NN Salgs - Faktura" id="50000"><DataItems><DataItem name="Sales Invoice Header">VERSION(1) SORTING(Field3) WHERE(Field3=1(%1))</DataItem></DataItems></ReportParameters>', PurchaseHeader."Vendor Invoice No.");
Report.SaveAs(50000, Parameters, ReportFormat::Pdf, outss);
CopyStream(outss, inss);
blob.MyBlob.CREATEOUTSTREAM(outss);
Blob.Insert(true);
End;
本文标签:
版权声明:本文标题:dynamics al - Report.SaveAs(Report::MyReport, RequestPageParameters, Format, Stream); in blob storage - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741525277a2383428.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论