cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

We are happy to announce the new Windchill Customization board! Learn more.

API to download Multi Level BOM report as XML?

RK_10318816
4-Participant

API to download Multi Level BOM report as XML?

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?

1 ACCEPTED SOLUTION

Accepted Solutions

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.

HelesicPetr_0-1663850812105.png

 

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

 

 

View solution in original post

3 REPLIES 3

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.

HelesicPetr_0-1663850812105.png

 

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!

 

 

rhart
14-Alexandrite
(To:RK_10318816)

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();

Top Tags