03.05.2020, 09:13 | #1 |
Участник
|
ievgensaxblog: MSDyn365FO. How-to set brand id for a report.
Источник: https://ievgensaxblog.wordpress.com/...-for-a-report/
============== Document branding is a really cool feature, unfortunately it is not installed by default and has only several reports available, so not widely used. However, besides SSRS report designs there is a setup available under Organization administration -> Setup -> Document branding, allowing you to define your brand and set logos, background colors, address and contact information, making your reports more configurable from UI. There is another gotcha here, by default your brand is a company id. But in some cases, you may have different business inside of one company and want to have your brand per business unit, for example. It’s quite an easy change, all we need to do, is to set SysDocuBrandContract. parmBrandId(). Below is an example for Sales Invoice report [ExtensionOf(classStr(SalesInvoiceController))]public final class SalesInvoiceController_IM_Extension{ protected void preRunModifyContract() { next preRunModifyContract(); SrsReportDataContract reportDataContract = this.parmReportContract(); if (!reportDataContract.parmDocuBrandContract()) { reportDataContract.parmDocuBrandContract(new SysDocuBrandContract()); } var brandId = DimensionAttributeValueSetStorage::find(custInvoiceJour.DefaultDimension).getDisplayValueByDimensionAttribute(DimensionHelper_IM::getBusinessUnitDimensionAttribute()); reportDataContract.parmDocuBrandContract().parmBrandId(brandId); }}As you can see, instead of getting dimension value by name or backing table id, I have a helper class that retrieves dimension attribute. Usually, it is stored in parameters table and gives you flexibility to change dimension name at any time and does not cause issues if you have 2 dimensions with same backing table, like “From BU” and “To BU”. Another thing to consider is creation of SysDocuBrandContract. In my example, I populate only brandId, however, you can set branding details per report and per design, so they should be populated as well. Framework does it by default for all preprocessed reports, however, for query-based reports you need to set parmReportName and parmDesignName manually. You may say that no one does SSRS reports these days and that’s a reasonable remark. ER is great but even there you have SysDocuBrandDetails table available, so it can be used to avoid hardcoded colors and logos! Источник: https://ievgensaxblog.wordpress.com/...-for-a-report/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору. |
|
|
Опции темы | Поиск в этой теме |
Опции просмотра | |
|