web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

changes on Report Layout in Sales Invoice

(2) ShareShare
ReportReport
Posted on by 1,275
Hi Guys, I have a requirement to do changes on Report Layout in Sales Invoice. In the print management, the report should be mapped with the new format to print.
 
Could you please let me know what classes are required to do the changes. So, that I will get my report in Print management in below:
 
 
 
Thanks in advance!
Categories:
I have the same question (0)
  • Suggested answer
    Martin Dráb Profile Picture
    237,965 Most Valuable Professional on at
    The documentation page Create custom designs for business documents is a good starting point.
  • CU05031448-0 Profile Picture
    1,275 on at
    Thanks, Martin for the response.
     
    I gone through the link which you shared. What I understood the along with below code (from the link) we need add Controller & Contract class also.
     
    class PrintMgtDocTypeHandlersExt
    {
        [SubscribesTo(classstr(PrintMgmtDocType), delegatestr(PrintMgmtDocType, getDefaultReportFormatDelegate))]
        public static void getDefaultReportFormatDelegate(PrintMgmtDocumentType _docType, EventHandlerResult _result)
        {
            switch (_docType)
            {
                case PrintMgmtDocumentType::SalesOrderConfirmation:
                     _result.result(ssrsReportStr(SalesConfirmExt, Report));
                     break;
            }
        }
    }
     
    Controller:
    [ExtensionOf(classStr(SalesInvoiceController))]
    final class SalesInvoiceController_Extension
    {
        /// <summary>
        /// Sets the instance name from the current print settings
        /// </summary>
        protected void outputReport()
        {
            PrintMgmtPrintSettingDetail printMgmtPrintSettingDetail = formLetterReport.getCurrentPrintSetting();
    
            salesInvoiceContract.parmInstanceName(printMgmtPrintSettingDetail.parmInstanceName());
    
            next outputReport();
        }
    
    }
    Contract:
    [ExtensionOf(classStr(SalesInvoiceContract))]
    final class SalesInvoiceContract_Extension
    {
        private PrintMgmtSetupName instanceName;
    
        /// <summary>
        /// Gets or sets the value of the datacontract parameter instanceName.
        /// </summary>
        /// <param name="_instanceName">
        /// The new value of the datacontract parameter agentAddress; optional.
        /// </param>
        /// <returns>
        ///  The current value of datacontract parameter instanceName
        /// </returns>
        [DataMemberAttribute('InstanceName')]
        public PrintMgmtSetupName parmInstanceName(PrintMgmtSetupName _instanceName = instanceName)
        {
            instanceName = _instanceName;
            return instanceName;
        }
    
    }
    DP:
     
    If we add any new field in Tmp table to populate value in Header & Footer
    [ExtensionOf(ClassStr(SalesInvoiceDP))]
    final class SalesInvoiceDP_Extension
    {
        protected void insertIntoSalesInvoiceHeaderFooterTmp(CustInvoiceJour _custInvoiceJour, CompanyInfo _companyInfo)
    
    // TO DO
    next insertIntoSalesInvoiceHeaderFooterTmp( _custInvoiceJour,  _companyInfo);
    
    }
     
    Am I correct?
  • Martin Dráb Profile Picture
    237,965 Most Valuable Professional on at
    Your code isn't anywhere on the page I shared. Also, it doesn't add a contract and a controller, it extends them.
     
    Your requirement is changing the report design, not to extend the contract and the data provider class, therefore your code doing so shouldn't be there. Your code in the controller extension doesn't seem to be related to your requirement either.
     
    If you follow the link, you'll create a new controller extending the standard one; you won't extend it. But it's not really necessary, AFAIK.
  • CU05031448-0 Profile Picture
    1,275 on at
    Hi Martin, I understood that print management code is required which you shared earlier. But Contract and controller class not required any more. So, I will remove it.
     
    As per my requirement, I need to add logo in the header and footer in the sales invoice report based on some condition.
     
    That's why I have mentioned the DP class and provide the code how will i insert the code in Temp table to display the logo in the report header and footer.
     
    I hope DP class is correct.
     
    Pls confirm.
  • CU05031448-0 Profile Picture
    1,275 on at
    Kindly confirm Martin once available 
  • Martin Dráb Profile Picture
    237,965 Most Valuable Professional on at
    Sure, if you have other requirements, you may need other changes.
  • CU05031448-0 Profile Picture
    1,275 on at
    Thanks, Martin for the response. As I am new to D365FO , So, I searched in google and found that below two classes are needed for the Print management setup to run the custom report format for the sales invoice:
     
    PrintMgmtReportFormatPopulator
    PrintMgmtDocType
     
    anything else required?
     
    Is it correct? Pls confirm.
     
     
     
     
  • CU05031448-0 Profile Picture
    1,275 on at
    Hi guys, once available kindly reply on this pls.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 451 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 428 Super User 2025 Season 2

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 239 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans