Select the diagrams that I want print

Uploaded report templates and discussions about reports.

Moderators: sarawut_w, Moderators

Select the diagrams that I want print

Postby hsui@gacrndusa.com » Thu Aug 30, 2018 6:43 pm

There are many diagrams that I want to print out. However, how can I select the one that I want?
For example, I know I can use $sorter.sort to select the file by name. But there are few different types of diagrams under this. How can I select them?
Code: Select all
#foreach ($pack in $sorter.sort($Package, “name”))
#set ($nspace = $pack.namespace.name)
#if ($nspace == “Classification Method”)

For instance, there are few ibd and bbd under this name file.
How can I set to print all ibd first, then all bdd?
Please help
hsui@gacrndusa.com
Forum Newbie
Forum Newbie
 
Posts: 5
Posts Rating:0
Joined: Thu Aug 30, 2018 11:29 am

Re: Select the diagrams that I want print

Postby sarawut_w » Thu Aug 30, 2018 8:30 pm

Hello,

But there are few different types of diagrams under this. How can I select them?

You can filter diagram type by this code:
Code: Select all
#foreach($diagram in $report.filterDiagram($Diagram,["Class Diagram","Activity Diagram"]))
$diagram.name : $diagram.diagramType
$diagrma.image
#end


How can I set to print all ibd first, then all bdd?

You can sort the diagram by $soter tool.
Code: Select all
#foreach($diagram in $sorter.sort($report.filterDiagram($Diagram, [“SysML Internal Block Diagram”, “SysML Block Definition Diagram”]), “diagramType:desc”))
$diagram.name :: $diagram.diagramType
#end


Best regards,
Sarawut W.
Support Engineer
sarawut_w
No Magic
No Magic
 
Posts: 328
Posts Rating:23
Joined: Thu Jun 23, 2011 12:47 am

Re: Select the diagrams that I want print

Postby hsui@gacrndusa.com » Fri Aug 31, 2018 2:51 pm

Dear Sarawut
Thanks for your Infor. That helped me some way. However, I still have some problems with the code. There is what I understand. I can use #sort to find out the diagram that I want. Or I can use it to find out the diagram name that I want. Something like
Code: Select all
#foreach ($pack in $sorter.sort($Package, “name”))
#set ($nspace = $pack.namespace.name)
#if ($nspace == “File name”)

I understand there are a few different types of diagrams in my mode. I want to print out the diagram that is under something like "Specification of system properties" How can I do that?
Also, I tried use
Code: Select all
#foreach($diagram in $sorter.sort($report.filterDiagram($Diagram, [“SysML Internal Block Diagram”, “SysML Block Definition Diagram”]), “diagramType:desc”))
$diagram.name :: $diagram.diagramType
$diagrma.image
#end

to print the diagram in my report. But I got nothing there. I am sure that I do have some ibd and bbd there. But why there is nothing?
hsui@gacrndusa.com
Forum Newbie
Forum Newbie
 
Posts: 5
Posts Rating:0
Joined: Thu Aug 30, 2018 11:29 am

Re: Select the diagrams that I want print

Postby sarawut_w » Sun Sep 02, 2018 7:38 pm

Hello,

I can use #sort to find out the diagram that I want. Or I can use it to find out the diagram name that I want. Something like

https://docs.nomagic.com/display/MD185/%24sorter
$sorter is for ordering items in the collection/array variable.
From your code, the sorter tool oder all Package elements in $Package by name.

to print the diagram in my report. But I got nothing there. I am sure that I do have some ibd and bbd there. But why there is nothing?

Please make sure, you have already included your diagrams in the report generation scope.
You can check it by simply printing all diagrams in $Diagram variable, this variable contains all Diagram element in your report generation scope.
Code: Select all
#foreach($d in $sorter.sort($Diagram, "diagramType"))
$d.name :: $d.diagramType
#end

If there is no IBD and BDD diagrams that you want, that means you have not included in the report generation scope.
If your diagrams are printed out, please share us your screenshot of your IBD and BDD diagrams on your containment tree.

Best regards,
Sarawut
sarawut_w
No Magic
No Magic
 
Posts: 328
Posts Rating:23
Joined: Thu Jun 23, 2011 12:47 am


Return to Report Engine

Who is online

Users browsing this forum: No registered users and 0 guests