biz-StreamマニュアルXMLページレイアウトタグ リファレンス第3章 テキスト3.10 日付テキスト<datetime-text>

3.10 日付テキスト<datetime-text>


3.10.1機能説明

生成時の日時を表示するか、日付フォーマットを定型で表示したい場合に使用する要素です。



3.10.2属性説明

属性名指定説明指定内容初期値
name任意名前CDATA
x任意X座標CDATA0
y任意Y座標CDATA0
unit任意単位(Choice)mm /
cm /
in /
px/
pt
width必須領域の幅CDATA
height任意領域の高さCDATA
text-align任意テキストの配置 (水平方向)(Choice)left /
center /
right
left
line-align任意行の配置(垂直方向)(Choice)top /
center /
bottom /
even
bottom
narrow任意領域にデータが入りきらない場合の圧縮方法(Choice)horizon /
size /
none
horizon
font-family任意フォント種類(Choice) ライブラリ共通ガイド
6.2 横書きフォント』を参照
MSGothic
font-color任意フォントの色CDATA0
font-size任意フォントサイズCDATA8
font-style任意フォントスタイル(Choice)PLAIN /
BOLD /
ITALIC /
BOLD-ITALIC
PLAIN
font-encoding 任意 フォントエンコーディング (Choice) 90ms-RKSJ-H / 90ms-RKSJ-V / 90msp-RKSJ-H / 90msp-RKSJ-V / UniJIS-UTF16-H / UniJIS-UTF16-V フォントごとのデフォルト値
char-space任意文字間隔CDATA0
format任意日時の書式設定CDATAAPI仕様SimpleDateFormat に準拠した表示形式
(Java API仕様を参照)
yyyy/MM/dd
current-time任意日時にシステム日付を使用する設定(Choice)true /
false
true
  • (注)初期値:出荷時のXMLデフォルト情報(default_values.properties)値を表します。ユーザにより値の変更が行われた場合は内容が異なります。


3.10.3記述例

datetime-textサンプル1

現在日時に対してformat 属性で出力形式を指定した結果を出力するサンプルです。

datetime-textサンプル1
(『<biz-Stream_home>/sample/xml/datetime-text/datetime-textSample1.xml』)

<?xml version="1.0" encoding="UTF-8"?>
<!-- XML file created by biz-Stream Designer -->
<!-- biz-Stream Copyright BrainSellers.com Corp. -->
<Layout Width="595pt" Height="842pt" 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">
    <GroupAlignment X="62.324" Y="117.254" Horizon="left" Vertical="bottom" Vector="vertical" LineSpace="5mm" Radius="0" Corners="true;true;true;true" Narrow="size">
        <!-- (1)初期値 -->

        <datetime-text text-align="left" line-align="bottom" font-family="MSGothic" font-size="20" font-style="PLAIN" narrow="horizon" current-time="true"/>
        <!-- (2)format="yyyy/MM/dd" -->

        <datetime-text text-align="left" line-align="bottom" format="yyyy/MM/dd" font-family="MSGothic" font-size="20" font-style="PLAIN" narrow="horizon" current-time="true"/>
        <!-- (3)format="yyyy/MM" -->

        <datetime-text text-align="left" line-align="bottom" format="yyyy/MM" font-family="MSGothic" font-size="20" font-style="PLAIN" narrow="horizon" current-time="true"/>
        <!-- (4)format="MM/dd" -->

        <datetime-text text-align="left" line-align="bottom" format="MM/dd" font-family="MSGothic" font-size="20" font-style="PLAIN" narrow="horizon" current-time="true"/>
        <!-- (5)yyyy年MM月dd日 (EEE) -->

        <datetime-text text-align="left" line-align="bottom" format="yyyy年MM月dd日 (EEE)" font-family="MSGothic" font-size="20" font-style="PLAIN" narrow="horizon" current-time="true"/>
        <!-- (6)format="dd-MMM-yy" -->

        <datetime-text text-align="left" line-align="bottom" format="dd-MMM-yy" font-family="MSGothic" font-size="20" font-style="PLAIN" narrow="horizon" current-time="true"/>
        <!-- (7)format="dd-MMM" -->

        <datetime-text text-align="left" line-align="bottom" format="dd-MMM" font-family="MSGothic" font-size="20" font-style="PLAIN" narrow="horizon" current-time="true"/>
        <!-- (8)format="HH:mm:ss" -->

        <datetime-text text-align="left" line-align="bottom" format="HH:mm:ss" font-family="MSGothic" font-size="20" font-style="PLAIN" narrow="horizon" current-time="true"/>
        <!-- (9)format="hh:mm:ss a" -->

        <datetime-text text-align="left" line-align="bottom" format="hh:mm:ss a" font-family="MSGothic" font-size="20" font-style="PLAIN" narrow="horizon" current-time="true"/>
        <!-- (10)format="yyyy/MM/dd HH:mm:ss" -->

        <datetime-text text-align="left" line-align="bottom" format="yyyy/MM/dd HH:mm:ss" font-family="MSGothic" font-size="20" font-style="PLAIN" narrow="horizon" current-time="true"/>
    </GroupAlignment>
</Layout>

生成されるPDF(『<biz-Stream_home>/sample/xml/datetime-text/datetime-textSample1.pdf』)


サンプル1
  • 指定無し(初期値)
  • format="yyyy/MM/dd"
  • format="yyyy/MM"
  • format="MM/dd"
  • format="yyyy年MM月dd日 (EEE)"
  • format="dd-MMM-yy"
  • format="dd-MMM"
  • format="HH:mm:ss"
  • format="hh:mm:ss a"
  • format="yyyy/MM/dd HH:mm:ss"

datetime-textサンプル2

#PCDATAをformat属性で出力形式を指定したサンプルです。

datetime-textサンプル2
(『<biz-Stream_home>/sample/xml/datetime-text/datetime-textSample2.xml』)

<?xml version="1.0" encoding="UTF-8"?>
<!-- XML file created by biz-Stream Designer -->
<!-- biz-Stream Copyright BrainSellers.com Corp. -->
<Layout Width="595pt" Height="842pt" 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">
    <GroupAlignment X="62.324" Y="117.254" Horizon="left" Vertical="bottom" Vector="vertical" LineSpace="5mm" Radius="0" Corners="true;true;true;true" Narrow="size">
        <!-- (1)初期値 -->

        <datetime-text text-align="left" line-align="bottom" font-family="MSGothic" font-size="20" font-style="PLAIN" narrow="horizon" current-time="false"/>
        <!-- (2)yyyy年MM月dd日 (EEE) -->

        <datetime-text text-align="left" line-align="bottom" format="yyyy年MM月dd日 (EEE)" font-family="MSGothic" font-size="20" font-style="PLAIN" narrow="horizon" current-time="false">1999/01/01 22:22:22</datetime-text>
        <!-- (3)format="HH:mm:ss" -->

        <datetime-text text-align="left" line-align="bottom" format="HH:mm:ss" font-family="MSGothic" font-size="20" font-style="PLAIN" narrow="horizon" current-time="false">1999/01/01 22:22:22</datetime-text>
        <!-- (4)format="hh:mm:ss a" -->

        <datetime-text text-align="left" line-align="bottom" format="hh:mm:ss a" font-family="MSGothic" font-size="20" font-style="PLAIN" narrow="horizon" current-time="false">1999/01/01 22:22:22</datetime-text>
        <!-- (5)format="yyyy/MM/dd HH:mm:ss" -->

        <datetime-text text-align="left" line-align="bottom" format="yyyy/MM/dd HH:mm:ss" font-family="MSGothic" font-size="20" font-style="PLAIN" narrow="horizon" current-time="false">1999/01/01 22:22:22</datetime-text>
    </GroupAlignment>
</Layout>

生成されるPDF(『<biz-Stream_home>/sample/xml/datetime-text/datetime-textSample2.pdf』)


current-time属性をfalseに設定した場合、渡された値をformat属性で指定されたフォーマットで出力します。
値が設定されない場合、何も出力しません。


サンプル2
  • current-time="false" 値無し(何も出力されません)
  • format="yyyy年MM月dd日 (EEE)"
  • format="HH:mm:ss"
  • format="hh:mm:ss a"
  • format="yyyy/MM/dd HH:mm:ss"