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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 19.07.2012, 18:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,459 / 846 (79) +++++++
Регистрация: 28.10.2006
ax-erp: Save SSRS report to pdf that uses Controller classes [Dynamics AX 2012]
Источник: http://microsoft-dynamics-ax-erp.blo...that-uses.html
==============


Friends,
This is the most commonly asked requirement of saving the report to pdf and send it to through email.
We all know that SRSReportRun class is helpful in combination with printDestinationsettings to save to pdf file.
But tricky requirements are those which uses controller classes for the report. Below is the small snippet which will help to save the sales invoice report to pdf that actually uses controller classes.


staticvoid SR_SaveReportToPDFFromController(Args _args)
{
SalesInvoiceController salesInvoiceController;
SalesInvoiceContract salesInvoiceContract;
Args args = new Args();
SrsReportRunImpl srsReportRun;
CustInvoiceJour custInvoiceJour;
ReportName reportName = "SalesInvoice.Report";
;


selectfirstOnly custInvoiceJour;
args.record(custInvoiceJour);

salesInvoiceController = new SalesInvoiceController();
salesInvoiceController.parmReportName(reportName);

salesInvoiceContract = salesInvoiceController.parmReportContract().parmRdpContract();
salesInvoiceContract.parmRecordId(custInvoiceJour.RecId); // Record id must be passed otherwise the report will be empty
salesInvoiceContract.parmCountryRegionISOCode(SysCountryRegionCode::countryInfo()); // comment this code if tested in pre release
salesInvoiceController.parmArgs(args);


srsReportRun = salesInvoiceController.parmReportRun() as SrsReportRunImpl;

salesInvoiceController.parmReportRun(srsReportRun);
salesInvoiceController.parmReportContract().parmPrintSettings().printMediumType(SRSPrintMediumType::File);
salesInvoiceController.parmReportContract().parmPrintSettings().overwriteFile(true);
salesInvoiceController.parmReportContract().parmPrintSettings().fileFormat(SRSReportFileFormat::PDF);
salesInvoiceController.parmReportContract().parmPrintSettings().fileName(‘c:\\SR_SalesInvoice.pdf’);
salesInvoiceController.runReport();
}

Below is the pdf file output:




Источник: http://microsoft-dynamics-ax-erp.blo...that-uses.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
ax-erp: Duplicate SSRS reports [Dynamics AX 2012] Blog bot DAX Blogs 0 18.07.2012 19:11
dax-lessons: Dialog fields and runtime lookups on SSRS Report parameters [Dynamics AX 2012] Blog bot DAX Blogs 0 11.05.2012 04:12
dax-lessons: Create Quick first SSRS report in Dynamics AX 2012 Blog bot DAX Blogs 0 19.08.2011 22:12
dynamics-ax-dev: Making Modifications to Report Libraries in AX and Re-Deploying the Latest Versions to SSRS Blog bot DAX Blogs 0 02.11.2010 18:05
gatesasbait: Dynamics AX 2009 SSRS and SSAS Integration Tips Blog bot DAX Blogs 3 09.07.2009 13:07
Опции темы Поиск в этой теме
Поиск в этой теме:

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

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

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

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