Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X
I'm generating a simple BOM table (Column headers as; Part No, Description & Quantity). The assembly comprises of components modeled by the local design team and parts from overseas. I need the table to populate the 'Description' cells (driven from a part Parameter),using either of the defined Parameters i.e 'asm_mbr_Description' or 'asm_mbr_Bezeichnung'
I believe this can be achieved by defining a Relation to the Table Repeat Region, but I am struggling to write (and apply to the table ) the correct script. This is what I've drafted:
if exists ("asm_mbr_DESCRIPTION")
bom_no=asm_mbr_description
else
bom_no=asm_mbr_bezeichnung
endif
Many Thanks.
Solved! Go to Solution.
Tom , Roger,
It works! Thanks gents for your prompt assistance.
Regards,
Bob
This looks okay to me... One thing you might want to do is add an "IF EXISTS" condition fro the asm_mbr_bezeichnung as well. Something like this:
IF EXISTS ("ASM_MBR_DESCRIPTION")
BOM_NO = ASM_MBR_DESCRIPTION
ELSE
IF EXISTS ("ASM_MBR_BEZEICHNUNG")
BOM_NO = ASM_MBR_BEZEICHNUNG
ELSE
BOM_NO = ""
ENDIF
ENDIF
Thanks for the response Tom. however, I've revised the script in line with your recommendations , but still cannot get this to work in my table. Perhaps back to basics, but how does this script get applied to the table? I feel I'm missing a step here.
Bob
Bob,
Not sure what you mean about "how does the script get applied to the table". Tom's code looks like it should work. Put the relations in the Repeat Region relations for the BOM table (Repeat Region -> Relations -> select the table). Then change the report parameter for the description column to rpt.rel.bom_no - either edit the properties and add manually "&rpt.rel.bom_no" or double click the first data row of the description column (or right click on the cell and pick Report Parameter), then use the menu picks rpt... -> rel... -> User Defined -> type in "bom_no"
-Roger
Essentially the relations statement is evaluated once for each unique row in the table. It's like you opened each model and manually copied this relations statement into it, except in this case, the resulting parameter only exists in the repeat region table.
It will probably help for testing to have one column in your table for each of the three parameters, "ASM_MBR_DESCRIPTION", "ASM_MBR_BEZEICHNUNG", and "BOM_NO".
Just to be clear, the table parameter would be entered this way: &rpt.rel.BOM_NO
Tom , Roger,
It works! Thanks gents for your prompt assistance.
Regards,
Bob
Don't forget to mark the appropriate answer correct. (For those who may find this post in the future.)