AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск Все разделы прочитаны

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 04.09.2018, 22:15   #1  
Blog bot is offline
Blog bot
Участник
 
25,459 / 846 (79) +++++++
Регистрация: 28.10.2006
dynamicsnavax: Print a Sales Invoice via X++ in #MSDyn365FO
Источник: http://dynamicsnavax.blogspot.com/20...sdyn365fo.html
==============

Often you want to print a report via X++. One of the more common reports is the sales invoice.

Below is some code you could use to download a pdf copy. I am just picking the first invoice and printing to pdf.

Next few posts will be dependent on this. I will try to build up the scenario.



public static void printSalesInvoice()
{
CustInvoiceJour custInvoiceJour;

select firstonly custInvoiceJour
where custInvoiceJour.SalesId != '';

if (custInvoiceJour)
{
str ext = SRSPrintDestinationSettings::findFileNameType(SRSReportFileFormat::PDF, SRSImageFileFormat::BMP);
PrintMgmtReportFormatName printMgmtReportFormatName = PrintMgmtDocType::construct(PrintMgmtDocumentType::SalesOrderInvoice).getDefaultReportFormat();

SalesInvoiceContract salesInvoiceContract = new SalesInvoiceContract();
salesInvoiceContract.parmRecordId(custInvoiceJour.RecId);

SrsReportRunController srsReportRunController = new SrsReportRunController();
srsReportRunController.parmReportName(printMgmtReportFormatName);
srsReportRunController.parmExecutionMode(SysOperationExecutionMode::Synchronous);
srsReportRunController.parmShowDialog(false);
srsReportRunController.parmReportContract().parmRdpContract(salesInvoiceContract);

SRSPrintDestinationSettings printerSettings = srsReportRunController.parmReportContract().parmPrintSettings();
printerSettings.printMediumType(SRSPrintMediumType::File);
printerSettings.fileFormat(SRSReportFileFormat::PDF);
printerSettings.parmFileName(custInvoiceJour.InvoiceId + ext);
printerSettings.overwriteFile(true);

srsReportRunController.startOperation();
}
}


Источник: http://dynamicsnavax.blogspot.com/20...sdyn365fo.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
dynamicsaxse: November 2017 Release – Dynamics AX 2012 R3 Blog bot DAX Blogs 0 08.12.2017 10:51
dynamicsaxtraining: Sales Blog bot DAX Blogs 0 25.04.2012 03:18
Dynamics AX Sustained Engineering: Sale Order Batch Invoicing reprints invoices from prior runs, when “Print” is set to ‘After’ on AR >> Periodic >> Sales Update >> Invoice form Blog bot DAX Blogs 0 24.03.2010 02:06
wiki.dynamicsbook: Changes Made in Navision Attain 3.60 Blog bot Dynamics CRM: Blogs 0 02.09.2008 13:23
C# and AX Development: How to print a different Sales Invoice per company in AX Blog bot DAX Blogs 0 26.08.2008 23:05
Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск
Опции просмотра

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 22:19.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.