Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Answered

Change SSRS Report for SalesInvoice in Code.

(1) ShareShare
ReportReport
Posted on by 3,987
I need to change the SSRS Report that is used for printing out a SalesInvoice depending on SalesTable.SalesType

But I have not been able to figure out where I need to make the change in the code.

I tried to Extend outputReport from SalesInvoiceController, but that did not change the SSRS Report.
 
protected void outputReport()
{
    this.parmReportContract().parmReportName(ssrsReportStr(SalesInvoice_New, Report));
    super();
}

Can anyone tell me where I need to set the SSRS Report.
  • Martin Dráb Profile Picture
    Martin Dráb 230,333 Most Valuable Professional on at
    Change SSRS Report for SalesInvoice in Code.
    It's good to hear that my suggestion works for you, but don't forget the other part of my reply. Make sure that the solution meets your requirements in case of summary invoices. You're checking the type of just one of the orders, not all.
  • Rudi Hansen Profile Picture
    Rudi Hansen 3,987 on at
    Change SSRS Report for SalesInvoice in Code.
    Thanks Alireza, that solved the problem for me.
  • Verified answer
    Alireza Eshaghzadeh Profile Picture
    Alireza Eshaghzadeh 12,306 Super User 2024 Season 2 on at
    Change SSRS Report for SalesInvoice in Code.
    Hi,
    As Martin mentioned, you can use Accounts receivable > Setup > Forms > Form setup > General > Print management by adding the appropriate settings. This eliminates the need to fulfill this requirement through custom code.
    To add Setting, you right click on Default print management and add criteria. 


  • Martin Dráb Profile Picture
    Martin Dráb 230,333 Most Valuable Professional on at
    Change SSRS Report for SalesInvoice in Code.
    Don't forget that the report uses print management. It means that you maybe don't need any code at all, because you can use conditions in print management. And if you find that a customization is necessary, you need to take print management into account in your development.
     
    Also, remember that an invoice can include multiple orders. You need to define what should happen if there are orders with different sales types.
  • Suggested answer
    Mohamed Amine Mahmoudi Profile Picture
    Mohamed Amine Mahmoudi 9,689 Super User 2024 Season 2 on at
    Change SSRS Report for SalesInvoice in Code.
     
    I think you must try these steps :
     
    1. create a Menu Item Output Extension of "SalesInvoice"
     
    2. create a new controller class like "SalesInvoiceController" (for e.g. SalesInvoiceControllerExt)
     
    3.Add your new class in object property in the menu item extension 
     
    4. write your besiness logic in the outputReport method
     
    Best regards,
    Mohamed Amine MAHMOUDI

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

News and Announcements

Announcing Category Subscriptions!

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,331 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,333 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans