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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 06.06.2018, 21:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,459 / 846 (79) +++++++
Регистрация: 28.10.2006
How to add a new report for a business document in D365
Источник: http://alexvoy.blogspot.com/2018/06/...-business.html
==============

My colleague Rod showed it to me when I needed to add a new report to Project Invoice Proposal with billing rules to be present in Print management settings.


///
/// Subscribes to print mgmt report format publisher to populate custom reports
///
[SubscribesTo(classstr(PrintMgmtReportFormatPublisher), delegatestr(PrintMgmtReportFormatPublisher, notifyPopulate))]
public static void notifyPopulate()
{
#PrintMgmtSetup

void addFormat(PrintMgmtDocumentType _type, PrintMgmtReportFormatName _name, PrintMgmtReportFormatCountryRegionId _countryRegionId = #NoCountryRegionId)
{
avrPrintMgtDocType_ProjInvReport_Handler::addPrintMgmtReportFormat(_type, _name, _name, _countryRegionId);
}

addFormat(PrintMgmtDocumentType::SIProjInvoiceWithBR, ssrsReportStr(avrPSAContractLineInvoice, Report));
}

///
/// Adds a report format to the printMgtReportFormat table
///
/// PrintMgmtDocumentType value
/// Name of the report (ie. reportname.Report)
/// Description of the report (ie. reportname.Report)
/// Country or default (#NoCountryRegionId)
/// True if this is a system report
/// SSRS report or another type
private static void addPrintMgmtReportFormat(
PrintMgmtDocumentType _type,
PrintMgmtReportFormatName _name,
PrintMgmtReportFormatDescription _description,
PrintMgmtReportFormatCountryRegionId _countryRegionId,
PrintMgmtReportFormatSystem _system = false,
PrintMgmtSSRS _ssrs = PrintMgmtSSRS::SSRS)
{
PrintMgmtReportFormat printMgmtReportFormat;

select firstonly printMgmtReportFormat
where printMgmtReportFormat.DocumentType == _type
&& printMgmtReportFormat.Description == _description
&& printMgmtReportFormat.CountryRegionId == _countryRegionId;

if (!printMgmtReportFormat)
{
// Add the new format
printMgmtReportFormat.clear();
printMgmtReportFormat.DocumentType = _type;
printMgmtReportFormat.Name = _name;
printMgmtReportFormat.Description = _description;
printMgmtReportFormat.CountryRegionId = _countryRegionId;
printMgmtReportFormat.System = _system;
printMgmtReportFormat.ssrs = _ssrs;
printMgmtReportFormat.insert();
}
}


Then I can pick it up in Print management settings in Project module.



It may be a good idea to delete records from PrintMgmtReportFormat table; all its records will be recreated the next time you open Print management form.




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

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
alexef: How to add a field to Item Card in Business Central Blog bot NAV: Blogs 0 22.05.2018 20:11
atinkerersnotebook: Creating Your Own Document Management System With SharePoint Blog bot DAX Blogs 0 02.10.2013 21:12
ax-erp: Walkthrough: Creating a Report Bound to a Report Data Provider Class (X++ Business Logic) [AX 2012] Blog bot DAX Blogs 0 20.09.2012 11:11
emeadaxsupport: New Content for Microsoft Dynamics AX 2012 : October 2011 Blog bot DAX Blogs 0 27.10.2011 17:11
wiki.dynamicsbook: Changes Made in Navision Attain 3.60 Blog bot Dynamics CRM: Blogs 0 02.09.2008 13:23
Опции темы Поиск в этой теме
Поиск в этой теме:

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

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

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

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