biz-Streamマニュアル XMLページレイアウトタグ リファレンス 第10章 場合分け制御 10.3 行数による場合分け<ConditionIsLine>

10.3 行数による場合分け<ConditionIsLine>


10.3.1機能説明

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



10.3.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.3.3記述例

ConditionIsLineサンプル1

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

<?xml version="1.0" encoding="UTF-8"?>
<!-- XML file created by biz-Stream Designer -->
<!-- biz-Stream Copyright BrainSellers.com Corp. -->
<Layout Name="CondirionIsLineSample1" Width="55" Height="40" 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">
    <Square Width="30" Height="20" LineColor="14,0,176" LineStyle="Solid"/>

    <Condition>
        <ConditionIsLine Target="3" Name="con1" Width="30" Height="20" Horizon="center" Vertical="center" Vector="vertical" narrow="size">
            <Label Name="phone1" Horizon="left" Vertical="bottom" Vector="horizon" Font="MSGothic" FontStyle="PLAIN" Narrow="horizon"/>
            <Label Name="phone2" Horizon="left" Vertical="bottom" Vector="horizon" Font="MSGothic" FontStyle="PLAIN" Narrow="horizon"/>
            <Label Name="fax" Horizon="left" Vertical="bottom" Vector="horizon" Font="MSGothic" FontStyle="PLAIN" Narrow="horizon"/>
        </ConditionIsLine>
        <ConditionIsLine Target="2" Name="con2" Width="30" Height="20" Horizon="center" Vertical="center" Vector="vertical" narrow="size">
            <Label Name="phone1" Horizon="left" Vertical="bottom" Vector="horizon" Font="MSGothic" FontStyle="PLAIN" Narrow="horizon"/>
            <Label Name="phone2" Horizon="left" Vertical="bottom" Vector="horizon" Font="MSGothic" FontStyle="PLAIN" Narrow="horizon"/>
            <Label Name="fax" Horizon="left" Vertical="bottom" Vector="horizon" Font="MSGothic" FontStyle="PLAIN" Narrow="horizon"/>
        </ConditionIsLine>
    </Condition>
</Layout>

生成されるPDF

ConditionIsLineサンプル1

  • case1:ConditionIsLineの子要素にデータが3行ある場合に採用されるレイアウト





  • case2: ConditionIsLineの子要素にデータが2行ある場合に採用されるレイアウト

<ConditionIsLine>内のLabelは、Name属性でデータベースのフィールド名を指定し、レイアウト情報外部からデータを取得しています。レイアウト情報は記述順(上から下)に解析されるため、データが3行ある場合は必ずcon1のレイアウトが採用され、2行の場合にはcon2のレイアウトが採用されます。

<ConditionIsLine>で指定する描画領域(X,Y,Width,Height)・Horizon・Vertical・Vector・Narrow・LineSpaceの機能は、<GroupAlignment>と同一機能となります。