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…