3.2.3記述例
テキストの指定方法に関するサンプルです。テキスト指定には次の2つの方法があります。
- ①Label タグのcontent(#PCDATA)で、テキストを直接指定
- ②Name 属性にページレイアウト情報外部からデータを取得するためのKEY を指定
Label サンプル1
<?xml version="1.0" encoding="UTF-8"?>
<!-- XML file created by biz-Stream Designer -->
<!-- biz-Stream Copyright BrainSellers.com Corp. -->
<Layout Name="LabelSample1" Width="120" Height="60" X="5" Y="15" 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">
<!-- (1)label1 -->
<Square Width="100" Height="10" LineColor="14,0,176" LineStyle="Solid"/>
<Label Name="label1" Width="100" Height="10" Y="30" Horizon="left" Vertical="center" Vector="horizon" Font="MSGothic" FontSize="10" FontStyle="PLAIN" Narrow="horizon">表示内容の直接指定</Label>
<!-- (2)company_name -->
<Square Width="100" Height="10" Y="15" LineColor="14,0,176" LineStyle="Solid"/>
<Label Name="company_name" Width="100" Height="10" Y="15" Horizon="left" Vertical="center" Vector="horizon" Font="MSGothic" FontSize="10" FontStyle="PLAIN" Narrow="horizon"/>
<!-- (3)company_name_empty -->
<Square Width="100" Height="10" Y="30" LineColor="14,0,176" LineStyle="Solid"/>
<Label Name="company_name_empty" Width="100" Height="10" Y="0" Horizon="left" Vertical="center" Vector="horizon" Font="MSGothic" FontSize="10" FontStyle="PLAIN" Narrow="horizon"/>
</Layout>
- ①label1:Label タグのcontent で直接表示内容の指定を行っています。
- ②company_name:Name 属性でデータベースのフィールド名を指定し、レイアウト情報外部からデータを取得しています。
company_name 内容 : ブレインセラーズ・ドットコム
- ③company_name_empty:Name 属性でデータベースのフィールド名を指定し、レイアウト情報外部からデータを取得しています。
company_name_empty 内容 : データなし
Label サンプル2
水平方向の配置(Horizon 属性)に関するサンプルです。
<?xml version="1.0" encoding="UTF-8"?>
<!-- XML file created by biz-Stream Designer -->
<!-- biz-Stream Copyright BrainSellers.com Corp. -->
<Layout Name="LabelSample2" Width="60" Height="65" X="5" Y="15" 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">
<!-- (1)label1 -->
<Square Width="50" Height="5" Y="0" LineColor="14,0,176" LineStyle="Solid"/>
<Label Name="label1" Width="50" Height="5" Y="40" Horizon="left" Vertical="center" Vector="horizon" Font="MSGothic" FontStyle="PLAIN" Narrow="horizon">指定なし</Label>
<!-- (2)label2 -->
<Square Width="50" Height="5" Y="10" LineColor="14,0,176" LineStyle="Solid"/>
<Label Name="label2" Width="50" Height="5" Y="30" Horizon="left" Vertical="center" Vector="horizon" Font="MSGothic" FontStyle="PLAIN" Narrow="horizon">左揃え</Label>
<!-- (3)label3 -->
<Square Width="50" Height="5" Y="20" LineColor="14,0,176" LineStyle="Solid"/>
<Label Name="label3" Width="50" Height="5" Y="20" Horizon="center" Vertical="center" Vector="horizon" Font="MSGothic" FontStyle="PLAIN" Narrow="horizon">中央揃え</Label>
<!-- (4)label4 -->
<Square Width="50" Height="5" Y="30" LineColor="14,0,176" LineStyle="Solid"/>
<Label Name="label4" Width="50" Height="5" Y="10" Horizon="right" Vertical="center" Vector="horizon" Font="MSGothic" FontStyle="PLAIN" Narrow="horizon">右揃え</Label>
<!-- (5)label5 -->
<Square Width="50" Height="5" Y="40" LineColor="14,0,176" LineStyle="Solid"/>
<Label Name="label5" Width="50" Height="5" Y="0" Horizon="even" Vertical="center" Vector="horizon" Font="MSGothic" FontStyle="PLAIN" Narrow="horizon">均等割付</Label>
</Layout>
- ①label1:label1: Horizon 指定なし("left 指定と同内容")
- ②label2: Horizon = "left"
- ③label3: Horizon = "center"
- ④label4: Horizon = "right"
- ⑤label5: Horizon = "even"
Label サンプル3
指定領域(X,Y,Width,Heightの各属性で指定)にデータが入りきらない場合の圧縮方法(Narrow属性)に
関するサンプルです。
(『<biz-Stream_home>/sample/xml/Label/Labelsample3.xml
』)
<?xml version="1.0" encoding="UTF-8"?>
<!-- XML file created by biz-Stream Designer -->
<!-- biz-Stream Copyright BrainSellers.com Corp. -->
<Layout Name="LabelSample3" Width="50" Height="50" X="5" 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">
<!-- (1)label1 -->
<Square Width="15" Height="5" Y="30" LineColor="14,0,176" LineStyle="Solid"/>
<Label Name="label1" Width="15" Height="5" Y="30" Horizon="left" Vertical="center" Vector="horizon" Font="MSGothic" FontStyle="PLAIN" Narrow="horizon">指定なしレイアウトサンプル</Label>
<!-- (2)label2 -->
<Square Width="15" Height="5" Y="20" LineColor="14,0,176" LineStyle="Solid"/>
<Label Name="label2" Width="15" Height="5" Y="20" Horizon="left" Vertical="center" Vector="horizon" Font="MSGothic" FontStyle="PLAIN" Narrow="horizon">幅圧縮レイアウトサンプル</Label>
<!-- (3)label3 -->
<Square Width="15" Height="5" Y="10" LineColor="14,0,176" LineStyle="Solid"/>
<Label Name="label3" Width="15" Height="5" Y="10" Horizon="left" Vertical="center" Vector="horizon" Font="MSGothic" FontStyle="PLAIN" Narrow="size">フォントサイズ縮小レイアウトサンプル</Label>
<!-- (4)label4 -->
<Square Width="15" Height="5" Y="0" LineColor="14,0,176" LineStyle="Solid"/>
<Label Name="label4" Width="15" Height="5" Y="0" Horizon="left" Vertical="center" Vector="horizon" Font="MSGothic" FontStyle="PLAIN" Narrow="none">圧縮なしレイアウトサンプル</Label>
</Layout>
- ①label1: Narrow 指定なし("horizon"指定と同内容)
- ②label2: Narrow = "horizon"
- ③label3: Narrow = "size"
- ④label4: Narrow = "none"
Label サンプル4
拡大縮小率(Rate属性)に関するサンプルです。
拡大縮小にはNarrow属性の値が反映されるため、必ず2つの属性を併用してください。
- ①Narrow="size" ⇒ フォントサイズによる拡大 / 縮小
- ②Narrow="horizon" ⇒ 水平比率による拡大 / 縮小
- ③Narrow="none" ⇒ 拡大縮小なし
<?xml version="1.0" encoding="UTF-8"?>
<!-- XML file created by biz-Stream Designer -->
<!-- biz-Stream Copyright BrainSellers.com Corp. -->
<Layout Name="LabelSample4" Width="100" Height="140" 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">
<!-- (1)label1 -->
<Square Width="70" Height="10" Y="105" LineColor="14,0,176" LineStyle="Solid"/>
<Label Name="label1" Width="70" Height="10" Y="105" Horizon="left" Vertical="center" Vector="horizon" Font="MSGothic" FontStyle="PLAIN" Narrow="horizon">指定なし</Label>
<!-- (2)label2 -->
<Square Width="70" Height="10" Y="90" LineColor="14,0,176" LineStyle="Solid"/>
<Label Name="label2" Width="70" Height="10" Y="90" Horizon="left" Vertical="center" Vector="horizon" Font="MSGothic" FontStyle="PLAIN" Rate="100" Narrow="horizon">拡大縮小率100%</Label>
<!-- (3)label3 -->
<Square Width="70" Height="10" Y="75" LineColor="14,0,176" LineStyle="Solid"/>
<Label Name="label3" Width="70" Height="10" Y="75" Horizon="left" Vertical="center" Vector="horizon" Font="MSGothic" FontStyle="PLAIN" Rate="50" Narrow="size">拡大縮小率50%(1)</Label>
<!-- (4)label4 -->
<Square Width="70" Height="10" Y="60" LineColor="14,0,176" LineStyle="Solid"/>
<Label Name="label4" Width="70" Height="10" Y="60" Horizon="left" Vertical="center" Vector="horizon" Font="MSGothic" FontStyle="PLAIN" Rate="50" Narrow="horizon">拡大縮小率50%(2)</Label>
<!-- (5)label5 -->
<Square Width="70" Height="10" Y="45" LineColor="14,0,176" LineStyle="Solid"/>
<Label Name="label5" Width="70" Height="10" Y="45" Horizon="left" Vertical="center" Vector="horizon" Font="MSGothic" FontStyle="PLAIN" Rate="50" Narrow="none">拡大縮小率50%(3)</Label>
<!-- (6)label6 -->
<Square Width="70" Height="10" Y="30" LineColor="14,0,176" LineStyle="Solid"/>
<Label Name="label6" Width="70" Height="5" Y="30" Horizon="left" Vertical="center" Vector="horizon" Font="MSGothic" FontStyle="PLAIN" Rate="200" Narrow="size">拡大縮小率200%(1)</Label>
<!-- (7)label7 -->
<Square Width="70" Height="10" Y="15" LineColor="14,0,176" LineStyle="Solid"/>
<Label Name="label7" Width="70" Height="10" Y="15" Horizon="left" Vertical="center" Vector="horizon" Font="MSGothic" FontStyle="PLAIN" Rate="200" Narrow="horizon">拡大縮小率200%(2)</Label>
<!-- (8)label8 -->
<Square Width="70" Height="10" Y="0" LineColor="14,0,176" LineStyle="Solid"/>
<Label Name="label8" Width="70" Height="10" Y="0" Horizon="left" Vertical="center" Vector="horizon" Font="MSGothic" FontStyle="PLAIN" Rate="200" Narrow="none">拡大縮小率200%(3)</Label>
</Layout>
- ①label1: Rate 指定なし("100"指定と同内容)
- ②label2: Rate = "100"
- ③label3: Rate = "50"、Narrow="size"
- ④label4: Rate = "50"、Narrow="horizon"
- ⑤label5: Rate = "50"、Narrow="none"
- ⑥label6: Rate = "200"、Narrow="size"
- ⑦label7: Rate = "200"、Narrow="horizon"
- ⑧label8: Rate = "200"、Narrow="none"
- ※Narrow="size"
⇒ フォントサイズによる拡大 / 縮小
- ※Narrow="horizon"
⇒ 水平比率による拡大 / 縮小
- ※Narrow="none"
⇒ Rate 属性指定がある場合も拡大 / 縮小されません
Label サンプル5
文字間隔指定(CharSpace)に関するサンプルです。
<?xml version="1.0" encoding="UTF-8"?>
<!-- XML file created by biz-Stream Designer -->
<!-- biz-Stream Copyright BrainSellers.com Corp. -->
<Layout Name="LabelSample5" Width="70" Height="70" X="5" 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">
<!-- (1)label1 -->
<Square Width="50" Height="5" Y="40" LineColor="14,0,176" LineStyle="Solid"/>
<Label Name="label1" Width="50" Height="5" Y="40" Horizon="left" Vertical="center" Vector="horizon" Font="MSGothic" FontStyle="PLAIN" Narrow="horizon">文字間隔指定なし</Label>
<!-- (2)label2 -->
<Square Width="50" Height="5" Y="30" LineColor="14,0,176" LineStyle="Solid"/>
<Label Name="label2" Width="50" Height="5" Y="30" Horizon="left" Vertical="center" Vector="horizon" CharSpace="0" Font="MSGothic" FontStyle="PLAIN" Narrow="horizon">文字間隔指定0</Label>
<!-- (3)label3 -->
<Square Width="50" Height="5" Y="20" LineColor="14,0,176" LineStyle="Solid"/>
<Label Name="label3" Width="50" Height="5" Y="20" Horizon="left" Vertical="center" Vector="horizon" CharSpace="1" Font="MSGothic" FontStyle="PLAIN" Narrow="horizon">文字間隔指定1</Label>
<!-- (4)label4 -->
<Square Width="50" Height="5" Y="10" LineColor="14,0,176" LineStyle="Solid"/>
<Label Name="label4" Width="50" Height="5" Y="10" Horizon="left" Vertical="center" Vector="horizon" CharSpace="5" Font="MSGothic" FontStyle="PLAIN" Narrow="horizon">文字間隔指定5</Label>
</Layout>
- ①label1: CharSpace 指定なし("0"指定と同内容)
- ②label2: CharSpace = "0"
- ③label3: CharSpace = "1"
- ④label4: CharSpace = "5"