Announcements
Hi Everyone,
When we click on Original Preview button of Sales Order Invoice the Sales Invoice Report gets opened.
But my client wants that when user clicks on original preview, 2 copies should get open with 2 different custom title as "Customer Copy" and "Original copy".
Rest of the design remains same as original one.
How can I achieve the requirement in shortest possible way? Please help.
Thanks Gunjan. I went with the approach of calling the menu item twice. And as of now that works for me.
Hi Rhusikesh,
You can store the text and pass it to the report layout in a hidden parameter, you have to set it in Visual Studio.
Hi Rhushikesh,
There are two aspects to changes -
1. You need to set the report header as "Customer copy' for one of the reports. You might need to create a new menuitem for that and handle the change in the SalesInvoiceController class.
2. You create a new class for printing two reports one after the other. Maybe something like this -
class printSalesInvoiceCopy { } static void main(Args _args) { new MenuFunction(menuItemOutputStr(SalesInvoiceCustCopy), MenuItemType::Output).run(_args); new MenuFunction(menuItemOutputStr(SalesInvoiceOriginal), MenuItemType::Output).run(_args); }
Hi Istvan, actually I need to store the Customer Copy and Original copy in one customized parameter. But not sure how should I set the parameter conditionally.
Hi Rhusikesh,
If the two different custom title as "Customer Copy" and "Original copy" should be on the report title and not on the form, it is better to give them as parameter. If the client changes his mind, you do not have to rebuild and redeploy the whole report, just change the parameters.
Controller class can be copied, if you choose that solution, just be aware that printDocumentSet() method has an extra line for the report name:
reportName = ssrsReportStr(SalesInvoice, ReportTH);
If you want to use the same report layout, it can remain the same.
Hi Gunjan, in this case my new controller class should be exact replica of existing controller class SalesInvoiceController or what?
Hi Rhushikesh,
You can create a custom class and call two reports using "menufunction" from the main method of the class. Create an action menu item for the class and replace the existing original preview button with this menu item.
André Arnaud de Cal...
294,118
Super User 2025 Season 1
Martin Dráb
232,866
Most Valuable Professional
nmaenpaa
101,158
Moderator