Hello awesome community!
I'm new to print management.
I created 2 custom designs for FreeTextInvoice. I want the user to choose the design he prefers, so he should be able to choose between these 2 custom designs.
What I did after creating the report with 2 different designs is that I have created a class and put in it the following event handler method:
[SubscribesTo(classstr(PrintMgmtDocType), delegatestr(PrintMgmtDocType, getDefaultReportFormatDelegate))]
public static void getDefaultReportFormatDelegateHandler(PrintMgmtDocumentType _docType, EventHandlerResult _result)
{
switch (_docType)
{
case PrintMgmtDocumentType::SalesFreeTextInvoice:
_result.result(ssrsReportStr(FreeTextInvoiceCustom, MyCustomDesign1);
_result.result(ssrsReportStr(FreeTextInvoiceCustom, MyCustomDesign2);
break;
}
}
Both of my custom designs appeared in the print management for Free Text Invoice in the AR > Set-up > Form Setup > print management.
But my issue is that when I print the Free Text Invoice, it will always print MyCustomDesign2, the last one added in the switch case in the method above.
Even though I choose MyCustomDesign1 or I choose the original standard FreeTextInvoice.Report design in Form Set-up > Print management, it will always print MyCustomDesign2.
And also, even though while generating the report, it says that it is generating the report design name I am selecting in the print management, but when it finishes generating and shows the invoice, it always shows MyCustomDesign2.
Unless I remove the line for the MyCustomDesign2 in the method above, it will always be the one to print.
What am I missing or doing wrong?
I want the user to be able to choose the invoice design he prefers and be able to switch back.
Any advice is appreciated!
Thanks in advance!