-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathAdding ReportToPrintManagement.xpp
40 lines (37 loc) · 1.56 KB
/
Adding ReportToPrintManagement.xpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//Author: Mafigu Huggins
//Email: mafiguhuggins@gmail.com
//Tel: +263 782 326 160
//Adding the report to the print management
class PrintManagementExt
{
/// <summary>
/// Delegate handler for the getDefaultReportFormatDelegate method of the <c>PrintMgmtDocType</c> class.
/// </summary>
/// <param name = "_docType"><c>PrintMgmtDocumentType</c> enumeration value.</param>
/// <param name = "_result">The <c>EventHandlerResult</c> object.</param>
[SubscribesTo(classstr(PrintMgmtDocType), delegatestr(PrintMgmtDocType, getDefaultReportFormatDelegate))]
public static void getDefaultReportFormatDelegateHandler(PrintMgmtDocumentType _docType, EventHandlerResult _result)
{
PrintMgmtReportFormatName formatName = hsPrintMgmtDelegatesHandler::getDefaultReportFormat(_docType);
if (formatName)
{
_result.result(formatName);
}
}
/// <summary>
/// Gets the report format value.
/// </summary>
/// <param name = "_docType">The <c>PrintMgmtDocumentType</c> enumeration value.</param>
/// <returns>The report format value.</returns>
private static PrintMgmtReportFormatName getDefaultReportFormat(PrintMgmtDocumentType _docType)
{
switch (_docType)
{
case PrintMgmtDocumentType::PurchaseOrderRequisition:
return ssrsReportStr(PurchPurchaseOrderCopy, Report);
case PrintMgmtDocumentType::PurchaseOrderConfirmationRequest:
return ssrsReportStr(PurchPurchaseOrderCopy, Report);
}
return '';
}
}