Setup PrintMgmt on RDP/Contract/Controller Class

I have created new RDP/Contract/Controller classes that open a SSRS report. Now the user wants to be able to setup the report to Print Management Destination so they can email it to our different companies and also email it in batch if needed. I tried finding a tutorial on how to do this but only found this:

http://krishhdax.blogspot.ca/2012/02/ax2012-configure-print-management-for.html

I tried implementing this as best I could but it’s not working. Any help would be appreciated.

Hello Andrew,

can you give more detail where exactly you are being stuck in the above steps?
i can see one more link for the same requirement like you

axmartina.wordpress.com/…/

Okay so I followed the steps in that link and now I have 10 compile errors…

Maybe I need to show you what I have (which is working perfectly) and someone can help me get Print Mgmt Destination on it?

I have 3 classes:
SalesMOCContract
SalesMOCController
SalesMOCDP

and a SSRS Report with a design called Report:
SalesMOC

Here is the code:
SalesMOCContract:

[DataContractAttribute]
public class SalesMOCContract
{
QuotationId quotationId;
}

[DataMemberAttribute(‘QuotationId’)]
public QuotationId parmQuotationID(QuotationId _quotationId = quotationId)
{
quotationId = _quotationId;
return quotationId;
}

SalesMOCController:

class SalesMOCController extends SrsReportRunController
{
}

protected void prePromptModifyContract()
{
SalesMOCContract contract;
SalesQuotationTable salesQuotationTable;

contract = this.parmReportContract().parmRdpContract() as SalesMOCContract;

salesQuotationTable = args.record();

contract.parmQuotationID(salesQuotationTable.QuotationId);
}

public static client void main(Args args)
{
SalesMOCController controller = new SalesMOCController();

controller.parmArgs(args);
controller.parmReportName(ssrsReportStr(SalesMOC, Report));
controller.startOperation();
}

SalesMOCDP:

[SRSReportParameterAttribute(classStr(SalesMOCContract))]
class SalesMOCDP extends SRSReportDataProviderBase
{
SalesMOCHeaderFooterTmp salesMOCHeaderFooterTmp;
SalesMOCTmp salesMOCTmp;
SalesMOCContract contract;
SalesQuotationTable salesQuotationTable;
SalesQuotationLine salesQuotationLine;
InventTable inventTable;

QuotationId quotationid;
}

[SRSReportDataSetAttribute(‘SalesMOCTmp’)]
public SalesMOCTmp getSalesMOC()
{
select * from salesMOCTmp;
return salesMOCTmp;
}

[SRSReportDataSetAttribute(‘SalesMOCHeaderFooterTmp’)]
public SalesMOCHeaderFooterTmp getSalesMOCHeaderFooter()
{
select * from salesMOCHeaderFooterTmp;
return salesMOCHeaderFooterTmp;
}

private void insertIntoSalesMOCHeaderFooterTmp()
{
Bitmap companyLogo;
DirPartyPostalAddressView dirPartyPostalAddressView;
AMDeviceConfigVersionReference amDeviceConfigurationVersionReference;
AMDeviceConfigVersionTable amDeviceConfigVersionTable;
InventDim inventDim;

contract = this.parmDataContract() as SalesMOCContract;
quotationid = contract.parmQuotationID();
breakpoint;
while select salesQuotationTable
where salesQuotationTable.QuotationId == quotationid
join dirPartyPostalAddressView
where dirPartyPostalAddressView.PostalAddress == salesQuotationTable.DeliveryPostalAddress
&& dirPartyPostalAddressView.IsLocationOwner == 1
join salesQuotationLine
where salesQuotationLine.QuotationId == salesQuotationTable.QuotationId
join inventTable
where inventTable.ItemId == salesQuotationLine.itemId
join amDeviceConfigurationVersionReference
where amDeviceConfigurationVersionReference.RefRecId == salesQuotationLine.RecId
&& amDeviceConfigurationVersionReference.Active == 0
join amDeviceConfigVersionTable
where amDeviceConfigVersionTable.VersionId == amDeviceConfigurationVersionReference.VersionId
join inventDim
where inventDim.inventDimId == amDeviceConfigVersionTable.InventDimId
{
salesMOCHeaderFooterTmp.SalesIdRef = salesQuotationTable.SalesIdRef;
salesMOCHeaderFooterTmp.QuotationId = salesQuotationTable.QuotationId;
salesMOCHeaderFooterTmp.QuotationName = salesQuotationTable.QuotationName;
salesMOCHeaderFooterTmp.ShippingDateRequested = salesQuotationTable.ShippingDateRequested;
salesMOCHeaderFooterTmp.AMDeviceModelId = inventTable.AMDeviceModelId;
salesMOCHeaderFooterTmp.ItemId = inventTable.ItemId;
salesMOCHeaderFooterTmp.CompanyLogo = FormLetter::companyLogo();
salesMOCHeaderFooterTmp.City = dirPartyPostalAddressView.City;
salesMOCHeaderFooterTmp.Country = dirPartyPostalAddressView.CountryRegionId;
salesMOCHeaderFooterTmp.VersionId = amDeviceConfigurationVersionReference.VersionId;
salesMOCHeaderFooterTmp.AMDeviceId = inventDim.AMDeviceId;
salesMOCHeaderFooterTmp.insert();
}
}

private void insertIntoSalesMOCTmp()
{
BOM bom;
ConfigChoice configChoice;
ConfigGroup configGroup;
InventDim inventDim;

//breakpoint;
contract = this.parmDataContract() as SalesMOCContract;
quotationid = contract.parmQuotationID();

while select salesQuotationLine
order by configChoice.chosengroupid
where salesQuotationLine.QuotationId == quotationid
join inventDim
where inventDim.inventDimId == salesQuotationLine.InventDimId
join configChoice
where configChoice.ConfigId == inventDim.configId
join configGroup
where configGroup.ConfigGroupId == configChoice.ChosenGroupId
join bom
where bom.BOMId == salesQuotationLine.ItemBOMId
&& bom.ConfigGroupId == configChoice.ChosenGroupId
join inventTable
where inventTable.ItemId == bom.ItemId
{
salesMOCTmp.QuotationId = salesQuotationLine.QuotationId;
salesMOCTmp.ItemId1 = bom.ItemId;
salesMOCTmp.ChosenItemId = configChoice.ChosenItemId;
salesMOCTmp.NameAlias = inventTable.NameAlias;
salesMOCTmp.ChosenGroupId = configChoice.ChosenGroupId;
salesMOCTmp.Name = configGroup.Name;
salesMOCTmp.Mandatory = configGroup.Mandatory;
salesMOCTmp.MultipleOptions = configGroup.MultipleOptions;
salesMOCTmp.insert();
}

}

[SysEntryPointAttribute]
public void processReport()
{
this.insertIntoSalesMOCTmp();
this.insertIntoSalesMOCHeaderFooterTmp();
}

Now I have a menu item that calls the controller and this all works PERFECT! I just want Print Mgmt Destination button and functionality added…

Hello Andrew,

can you send me the error details which you are facing while applying code from that link?

Honestly, I took it all back out because it was screwing up other things in my development environment.

Do you want to send me your email? When I have time, I can start putting it back in and we can work through the errors. Then I can post the working result here.

Or if you have Skype that would work too. Let me know.