Agile Product Lifecycle Management Web Services Guide Release 9.3.6 E71166-01 |
|
![]() Previous |
![]() Next |
This chapter describes how to generate Assembly Cost Reports using loadReportSchema and loadReportData operations.
The PLM Web client supports generating the Assembly Cost Report to help understand the total cost of a BOM, including the material and non-material costs. To simplify this operation, the Web client provides a wizard to locate and select the required Sourcing Project, including the necessary parameters.
A sample report is shown below. Once the report is prepared, the PLM user can invoke the Export command and send the data from the PLM to an external device in a supported format, for example, to an Excel worksheet.
The Agile Core Web Services supports this feature with loadReportSchema and loadReportData operations. The following code sample uses the loadReportSchema operation to get the report data structure and the loadReportData operation to set the report parameters and generate the report.
Example: Loading assembly cost reports schema
LoadReportSchemaRequestType loadReportSchemaRequestType = new LoadReportSchemaRequestType(); AgileLoadReportSchemaRequestType[] agileLoadReportSchemaRequestType = new AgileLoadReportSchemaRequestType[1]; agileLoadReportSchemaRequestType[0] = new AgileLoadReportSchemaRequestType(); agileLoadReportSchemaRequestType[0].setReportIdentifier("103"); //Assembly cost report Identifier ParameterType[] params = new ParameterType[1]; params[0] = new ParameterType(); params[0].setId("objectNumber"); String[] pcmPrjs = {"PRJ00001"}; //set the PCM project number here params[0].setValues(pcmPrjs); agileLoadReportSchemaRequestType[0].setParams(params); loadReportSchemaRequestType.setRequests(agileLoadReportSchemaRequestType);
Example: Generating Assembly Cost Report
LoadReportDataRequestType loadReportDataRequestType = new LoadReportDataRequestType(); AgileLoadReportDataRequestType[] agileLoadReportDataRequestType = new AgileLoadReportDataRequestType[1]; agileLoadReportDataRequestType[0] = new AgileLoadReportDataRequestType(); agileLoadReportDataRequestType[0].setReportIdentifier("103"); //Assembly cost report Identifier ParameterType[] params = new ParameterType[3]; params[0] = new ParameterType(); params[0].setId("objectNumber"); String[] pcmPrjs = {"PRJ00001"}; //set the PCM project number here params[0].setValues(pcmPrjs); params[1] = new ParameterType(); params[1].setId("items"); String[] items = {"P00001"}; //set the item present in the above project params[1].setValues(items); params[2] = new ParameterType(); params[2].setId("suppliers"); String[] suppliers = {"EMS1"}; //set the supplier for the item included above params[2].setValues(suppliers); agileLoadReportDataRequestType[0].setParams(params); loadReportDataRequestType.setRequests(agileLoadReportDataRequestType);
Note: The returned value of the loadReportSchema operation represents the XML schema of the Assembly Cost Report To get the schema, you must set the value of the report name parameter. To get the report data, or report, you must set the values of the first two parameters. |
The Assembly Cost Report parameters supported by loadReportData operation are defined as follows:
items - The array of top level assembly items: "<itemNumber>::<revNumber>" if there is a revision, and "<itemNumber>" if there are no revisions.
suppliers - The array of supplier names along with the optional indicators for the "Best of Suppliers": "-101" or the "Best Of Suppliers/Partners".
pricescenarios - The array of price scenarios names.
doCostRollup - The flag to run the cost Rollup option for the report.
To generate a report data for all assemblies, all suppliers/partners, or all price scenarios without specifying their names, you must provide the following corresponding parameters:
String[] items = new String[1];
items[0] = "all";
String[] suppliers = new String[2];
suppliers[0] = "-101";
suppliers[1] = "all";
String[] priceScenarios = new String[0];
priceScenarios[0] = "all";