Kod içinden rapor dosyası oluşturma

Axapta içinden kod ile bir raporu (PDF formatında) nasıl oluşturacağımızı görelim.
Örnek olarakta bir satış şiparişine ait faturayı PDF formatında kaydedelim.
Arzu ederseniz raporu HTML formatına dönüştürüp e-mail olarakta gönderebiliriz.

CustInvoiceJour custInvoice;
SalesId salesId;
ReportRun report;
RecordSortedList List = new RecordSortedList(62);

SalesId='00001';

Select custInvoice Index hint SalesIdx Where custInvoice.SalesId == salesId;

List.ins(custInvoice);
report = new ReportRun(new Args(ReportStr(SalesInvoice)));
report.args().caller(null);
report.args().parmEnum(1);
report.args().parmEnumType(920);
report.args().object(List);
report.args().name("KeepSettings");
report.printJobSettings().setTarget(PrintMedium::File);
report.printJobSettings().format(PrintFormat::PDF);
report.printJobSettings().fileName("C:\\Invoice.pdf");
report.prompt();
report.run();

1 yorum:

Adsız dedi ki...

Selamlar,

Benim bir sorum olacak..
Bu kodda mail gönderen kısım hangisi ? smtp vs gibi ayarlar set ediliyor mu axapta ?