biz-StreamマニュアルXMLページレイアウトタグ リファレンス第10章 場合分け制御10.2 場合分け制御<ConditionIsNull>

10.2 場合分け制御<ConditionIsNull>


10.2.1機能説明

場合分け制御に関する定義を行います。データ有無による場合分けを行います。
ConditionIsLine要素が『~行ある場合』という行数による場合分けを行うのに対し、
ConditionIsNull要素では、『~がある場合』という項目(複数可)のデータ有無による場合分けを行います。



10.2.2属性説明

属性名指定説明指定内容初期値
name任意名前CDATA
Target必須KEY項目CDATA
Width任意領域の幅CDATA
Height任意領域の高さCDATA
X任意X座標CDATA0
Y任意Y座標CDATA0
Unit任意単位(Choice)mm / cm / in / px / ptmm
Horizon任意水平方向の配置(Choice)left / center / right / evenleft
Vertical任意垂直方向の配置(Choice)top / center / bottom / evenbottom
Vector任意整列方向(Choice)horizon / vertical / nonehorizon
Narrow任意領域にデータが入りきらない場合の圧縮方法(Choice)horizon / size / nonesize
LineSpace任意行間CDATA0
  • (注)初期値:出荷時のXMLデフォルト情報(default_values.properties)値を表します。ユーザにより値の変更が行われた場合は内容が異なります。


10.2.3記述例

ConditionIsNullサンプル1

ConditionIsNullサンプル1(『<biz-Stream_home>/sample/ConditionIsNull/ConditionIsNullSample1.xml』)

<?xml version="1.0" encoding="UTF-8"?>
<!-- XML file created by biz-Stream Designer -->
<!-- biz-Stream Copyright BrainSellers.com Corp. -->
<Layout Name="CondirionIsNullSample1" Width="105" Height="50" X="10" Y="10" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:bs="http://www.brainsellers.com/schema" xmlns:svg="http://www.brainsellers.com/schema" xmlns:form="http://www.brainsellers.com/schema" xmlns:pdf="http://www.brainsellers.com/schema" version="5.0.0">
    <Condition>
        <!-- (1)ケース1:customer_center_id、customer_center_nameにデータがある場合 -->

        <ConditionIsNull Target="customer_center_id;customer_center_name" Name="con1" Horizon="left" Vertical="bottom" Vector="horizon" narrow="size">
            <GroupAlignment Width="60" Height="15" Horizon="center" Vertical="center" Vector="horizon" LineColor="14,0,176" Narrow="size">
                <Label Name="customer_center_header" Horizon="left" Vertical="bottom" Vector="horizon" Font="MSGothic" FontStyle="PLAIN" Narrow="horizon">CustomerCenter: </Label>
                <Label Name="customer_center_id" Horizon="left" Vertical="bottom" Vector="horizon" Font="MSGothic" FontStyle="PLAIN" Narrow="horizon"/>
                <Label Name="SPACE" Width="2" Horizon="left" Vertical="bottom" Vector="horizon" Font="MSGothic" FontStyle="PLAIN" Narrow="horizon"/>
                <Label Name="customer_center_name" Horizon="left" Vertical="bottom" Vector="horizon" Font="MSGothic" FontStyle="PLAIN" Narrow="horizon"/>
            </GroupAlignment>
        </ConditionIsNull>
        <!-- (2)ケース2:customer_center_idにデータがある場合 -->

        <ConditionIsNull Target="customer_center_id" Name="con2" Horizon="left" Vertical="bottom" Vector="horizon" narrow="size">
            <GroupAlignment Width="80" Height="15" Horizon="center" Vertical="center" Vector="horizon" LineColor="14,0,176" Narrow="size">
                <Label Name="customer_center_header" Horizon="left" Vertical="bottom" Vector="horizon" Font="MSGothic" FontStyle="PLAIN" Narrow="horizon">CustomerCenter: </Label>
                <Label Name="customer_center_id" Horizon="left" Vertical="bottom" Vector="horizon" Font="MSGothic" FontStyle="PLAIN" Narrow="horizon"/>
                <Label Name="SPACE" Width="2" Horizon="left" Vertical="bottom" Vector="horizon" Font="MSGothic" FontStyle="PLAIN" Narrow="horizon"/>
                <Label Name="customer_center_header" Horizon="left" Vertical="bottom" Vector="horizon" Font="MSGothic" FontStyle="PLAIN" Narrow="horizon">カスタマーセンター窓口</Label>
            </GroupAlignment>
        </ConditionIsNull>
    </Condition>
</Layout>

生成されるPDF


ConditionIsNullサンプル2
  • case1: KEY項目(customer_center_idのみ)にデータがある場合に採用されるレイアウト

    customer_center_idのデータと、「カスタマーセンター窓口」の固定テキストを表示しています。

ConditionIsNullサンプル1
  • case2: KEY項目(customer_center_id、customer_center
    _name)にデータがある場合に採用されるレイアウト

    customer_center_id、customer_center_nameのデータを表示しています。
  • レイアウト情報は記述順(上から下)に解析されるため、指定されたフィールド『customer_center_id』・『customer_center_name』とともに共にデータがある場合は必ず case1 のレイアウトが採用され、『customer_center_id』にしかデータがない場合にはcase2のレイアウトが採用されます。