10.2 場合分け制御<ConditionIsNull>
10.2.1機能説明
場合分け制御に関する定義を行います。データ有無による場合分けを行います。
ConditionIsLine要素が『~行ある場合』という行数による場合分けを行うのに対し、
ConditionIsNull要素では、『~がある場合』という項目(複数可)のデータ有無による場合分けを行います。
10.2.2属性説明
属性名 | 指定 | 説明 | 型 | 指定内容 | 初期値 |
---|---|---|---|---|---|
name | 任意 | 名前 | CDATA | - | |
Target | 必須 | KEY項目 | CDATA | - | |
Width | 任意 | 領域の幅 | CDATA | - | |
Height | 任意 | 領域の高さ | CDATA | - | |
X | 任意 | X座標 | CDATA | 0 | |
Y | 任意 | Y座標 | CDATA | 0 | |
Unit | 任意 | 単位 | (Choice) | mm / cm / in / px / pt | mm |
Horizon | 任意 | 水平方向の配置 | (Choice) | left / center / right / even | left |
Vertical | 任意 | 垂直方向の配置 | (Choice) | top / center / bottom / even | bottom |
Vector | 任意 | 整列方向 | (Choice) | horizon / vertical / none | horizon |
Narrow | 任意 | 領域にデータが入りきらない場合の圧縮方法 | (Choice) | horizon / size / none | size |
LineSpace | 任意 | 行間 | CDATA | 0 |
- (注)初期値:出荷時の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
- (『<biz-Stream_home>/sample/ConditionIsNull/ConditionIsNullSample1-1.pdf
』)
- (『<biz-Stream_home>/sample/ConditionIsNull/ConditionIsNullSample1-2.pdf
』)

- ①case1: KEY項目(customer_center_idのみ)にデータがある場合に採用されるレイアウト
customer_center_idのデータと、「カスタマーセンター窓口」の固定テキストを表示しています。

- ②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のレイアウトが採用されます。