Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Filename:ファイル名:Item list group.xfd
Levelレベル:Advanced
XML from report:レポートから XML:Item -> FF&E list -> FF&E list grouped by FF&E level
XML sample file:XMLサンプルファイル:xml/file_with_cost.xml
Key conceptsキーコンセプト:Dynamic indentation, condition, table repeat, key/index

This report demonstrates how to print the hierarchical FF&E catalog structure with FF&E items. The report traverses the <level> structure that represents the FF&E catalog structure. To do this we have a repeating section over the <level> nodes. It is important to note that <level> nodes are nested in each other to represent the hierarchical structure. For this reason, simply drag and drop the first level on to the document and create a repeating section over the expression that is created このレポートは、FF&Eアイテムを含む階層的なFF&Eカタログ構造を印刷する方法を示しています。レポートは、FF&Eカタログ構造を表す<level>構造を走査します。 
そのために、<level>ノードの上に繰り返しセクションがあります。 重要なのは、<level>ノードは階層構造を表すために互いに入れ子になっていることです。
このため、単純に最初のレベルをドキュメントにドラッグ&ドロップし、作成された式 (/drofus-xml/level). The expression will not work because it will only iterate over the <level> nodes at the top level, not the sub levels. To get this done we use an expression that will select all <level> nodes in the document regardless of where it is placed in the XML structure. This expression can be: の上に繰り返しセクションを作成します。
この式が機能しないのは、トップ・レベルの<level>ノードだけを繰り返し処理し、サブ・レベルは行わないからです。
これを実現するには、XML構造のどこに配置されているかに関係なく、ドキュメント内のすべての<level>ノードを選択する式を使用します。この式は:

//level

To get an indent for subgroups we use a dynamic value for the ‘Alignment & Indentation -> Start Indent’ property set to: concatサブ・グループのインデントを取得するには "Alignment & Indentation (整列とインデント) -> Start Indent (開始インデント)" プロパティの動的な値を次のように設定します:concat(@depth*5,’mm’). This uses the depth attribute for the level which is 0 for the group (top level), 1 for subgroups etc. this is multiplied with 5 and the result is concatenated with mm that gives the length unit in millimeter. You can use inc to get inches. This gives an indentation of 0 for groups, 5 for subgroups, 10 for sub sub group and so on.

Below each group is a table with FF&E items (articles). The table is inside a conditional section where the condition is count(article) > 0 that will return false if there is no items in the group. This will prevent the table header to appear when there is no need for it. You can insert a conditional section from Insert->Conditional Section.

The table has a table header and a repeatable row as explained in 3.6. Use the XPATH expression article.

In the xml source the level node has child nodes called <article> that represents an FF&E item. This node has only one attribute, @ref, that contains an id to an article item under the 'mm'). これは、グループ (トップ・レベル) には 0、サブ・グループなどには 1 となるレベルの深さ属性を使用します。
これに 5 を乗算し、その結果をミリメートル単位の長さ単位を与える mm と連結します。インチを得るにはincを使います。
これは、グループには0、サブ・グループには5、サブ・サブ・グループには10といったインデントを与えます。

各グループの下には、FF&Eアイテム (物品) のテーブルがあります。テーブルは条件セクションの中にあり、条件はcount(article) > 0で、グループ内にアイテムがなければfalseを返します。
これにより、テーブル・ヘッダーが必要ないときに表示されるのを防止できます。条件付きセクションは、Insert (挿入)→ Conditional Section (条件付きセクション)から挿入できます。

3.6で説明したように、テーブルにはテーブル・ヘッダーと繰り返し可能な行があります。XPATH式の物(article)を使用してください。

xmlソースでは、レベル・ノードは<article>という子ノードを持ち、これはFF&Eアイテムを表します。このノードには、/drofus-xml/article-container node. To get to the FF&E item data we need to do a look up under the correct <article> node that has this same id. To do this efficiently we create a index that we can use. See 5.3 to learn more about indexes. To do this, paste the following code into the Review->Global XSLT window. ノードの下にある article アイテムへの ID を含む @ref という属性が 1 つだけあります。FF&Eアイテムのデータを取得するには、この同じIDを持つ正しい<article>ノードの下で検索を行う必要があります。
これを効率的に行うために、使用可能なインデックスを作成します。インデックスについては5.3を参照してください。
これを行うには、以下のコードをReview (レビュー)->Global XSLT window (グローバルXSLTウィンドウ)に貼り付けます。

<xsl:key match="article" name="article-index" use="@id"/>

This will index all <article> nodes based on the id attribute.

To create a table column, e.g. the FF&E no column, choose Insert->Field and enter the following XPATH expressionこれは、id属性に基づいてすべての<article>ノードにインデックスを作成します。

例えばFF&E番号列のようなテーブル列を作成するには、Insert (挿入)→Field (フィールド)を選択し、以下のXPATH式を入力します。

key('article-index', @ref)/core/@article_func_no

You could then of course copy/paste this field into the other column. Look under articleもちろん、このフィールドを他の列にコピー・ペーストすることもできます。利用可能なフィールドはarticle-container/article for available fields.The sum for each group is printed after each FF&E listing and the sum for groups with sub groups is also listed after each of the subgroups. To get this done we have two conditional sections. The first one will print the sum after each listing and should be done only if there are no sub groups so the condition for this is:articleの下を見てください。

各グループの合計は、各FF&Eリストの後に印刷され、サブグループを持つグループの合計も、各サブグループの後に印刷される。
これを行うために、2つの条件付きセクションがあります。最初のものは、各リストの後に合計を印刷し、サブグループがない場合にのみ実行します。この条件は次のとおりです:

not(level)

To get the sum for all the groups that have subgroups, we need to do this at the end of the last subgroup. To do this we use the following condition:サブ・グループを持つすべてのグループの合計を得るには、最後のサブ・グループの最後でこれを行う必要があります。これを行うには、以下の条件を使用します:

not(following-sibling::level) and parent::level

This one ensures that it is the last level and that it has a parent level.これは最後のレベルであり、親レベルがあることを保証します。