首页 > 其他 > 详细

D365 增加新的报表格式代替标准报表

时间:2021-04-29 09:52:22      阅读:40      评论:0      收藏:0      [点我收藏+]

D365 增加新的报表格式代替标准报表

1: 增加客制化报表格式到打印管理

[ExtensionOf(classStr(PrintMgmtReportFormatPopulator))]
public final class PrintMgmtReportFormatPopulatorAppSuite_myClass_Extension
{
    #ISOCountryRegionCodes
    #PrintMgmtSetup

    protected void addDocuments()
    {
        // Purchasing documents
        this.myAddPurchaseDocuments();

        next addDocuments();
    }

    ///
    /// Adds purchase records to the PrintMgmtReportFormat table.
    ///
    public void myAddPurchaseDocuments()
    {
        this.addOther(PrintMgmtDocumentType::PurchAgreementConfirmation, ssrsReportStr(myPurchPromptLetterReport, Report), ssrsReportStr(myPurchPromptLetterReport, Report), #NoCountryRegionId);
        this.addOther(PrintMgmtDocumentType::PurchAgreementConfirmation, ssrsReportStr(mySecondPurchPromptLetterReport, Report), ssrsReportStr(mySecondPurchPromptLetterReport, Report), #NoCountryRegionId);
    }

}

2:扩展PrintMgmtDelegatesHandler的getDefaultReportFormatDelegateHandler方法

final class PrintMgmtDelegatesHandlerKKC_Extension
{
    public static void getDefaultReportFormatDelegateHandler(PrintMgmtDocumentType _docType, EventHandlerResult _result)
    {
        next getDefaultReportFormatDelegateHandler(_docType, _result);
        
        if (_docType == PrintMgmtDocumentType::PurchaseOrderConfirmationRequest
        ||  _docType == PrintMgmtDocumentType::PurchaseOrderRequisition)
        {
            PrintMgmtDocInstance    printMgmtDocInstance    = PrintMgmtDocInstance::findByPrintType(0,0,PrintMgmtNodeType::Purch,PrintMgmtDocumentType::PurchaseOrderRequisition,PrintMgmtDocInstanceType::Original);
            PrintMgmtSettings       printMgmtSettings       = PrintMgmtSettings::find(printMgmtDocInstance.RecId,printMgmtDocInstance.PriorityId,true);
            PrintMgmtReportFormat   poPrintMgmtReportFormat = PrintMgmtReportFormat::find(printMgmtSettings.ReportFormat);
            switch (poPrintMgmtReportFormat.Name)
            {
                case ssrsReportStr(PurchPurchaseOrder, MyReport):
                    _result.result(ssrsReportStr(PurchPurchaseOrder, MyReport));
                    break;
            }
        }
    }
}

 



D365 增加新的报表格式代替标准报表

原文:https://www.cnblogs.com/dingkui/p/14716029.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!