Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X
I am using Windchill PDMLink Release 11.2 and Datecode with CPS 11.2.0.2
Is it possible to generate Multi level BOM report through API in XML format? We tried using BOMHelper.produceBOMReport(), but its downloading as HTML. We need some help to understand if there is a way to download the report as XML?
Solved! Go to Solution.
Hello @RK_10318816
I don't think there is a general API to create BOM report as you need.
All exports of MultilevelBOM is done by JSP page from a table menu.
I always write own function to create the BOM output in any format I need it.. (xml, csv, html, txt)
It is not so complicated to collect all levels of BOM.
You can also build your xml format as you need.
I know it doesn't help too much. May be somebody else knows the API which could help.
PS> useful api method is
//primWtp is WTPart object
QueryResult qResult = WTPartHelper.service.getUsesWTParts(primWtp, new LatestConfigSpec());
PetrH
Hello @RK_10318816
I don't think there is a general API to create BOM report as you need.
All exports of MultilevelBOM is done by JSP page from a table menu.
I always write own function to create the BOM output in any format I need it.. (xml, csv, html, txt)
It is not so complicated to collect all levels of BOM.
You can also build your xml format as you need.
I know it doesn't help too much. May be somebody else knows the API which could help.
PS> useful api method is
//primWtp is WTPart object
QueryResult qResult = WTPartHelper.service.getUsesWTParts(primWtp, new LatestConfigSpec());
PetrH
Hi PetrH,
This approach worked out. I have used a recursive loop to get all levels of BOM.
Thank you very much!
You could get the multi-level BoM using an infoEngine webject like Query-Tree, then once you have the BoM as i.e convert to xml
//String oid = "VR:wt.part.WTPart:651623469";
<ie:getService varName="vdb" />
<ie:webject name="Query-Tree" type="OBJ">
<ie:param name="instance" data="<%= wtadapterVMName %>" valueSeparator=";" delim=";" default="Windchill" />
<ie:param name="type" data="wt.part.WTPartUsageLink" />
<ie:param name="DIRECTION" data="uses"/>
<ie:param name="ATTRIBUTE" data="number,name,*" delim=","/>
<ie:param name="OUTPUT_TYPE" data="FULL"/>
<ie:param name="MODE" data="NESTED"/>
<ie:param name="GROUP_OUT" data="tree_out"/>
<ie:param name="object_ref" data="<%= oid %>" />
<ie:param name="DEPTH" data="99"/>
</ie:webject>
String xmlBOM = vdb.getCollection().toXML();