当前位置: 首页 > 网络学院 > 客户端脚本教程 > APPML > section

APPML
AppML HTML 报告
AppML 过滤函数
AppML HTML 列表
AppML HTML 表单
AppML XML 报告

APPML 中的 section


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-04   浏览: 330 ::
收藏到网摘: n/a

The <section> element is used to divide the report output into sections. Any legal HTML elements can be put inside this element.
<section>元素用于将报告结果拆分成片断。任何合法的HTML元素都可以被放到这个元素中。

Tip: The <section> element may be used in conjunction with the <break> element to create reports divided into sections, e.g. Sales per year, Sales per category, Customers by country, Sales per customer, etc.
提示:<section>元素可以和<break>元素一起使用,把报告拆分成片断,举个例子来说,每年的销售、每类的销售、每个国家的客户、每个客户的销售量,等等。


<section> Attributes
<section>属性

The <section> element may have the following attributes:
<section>元素可以包含下面这些属性:

Attribute
属性
Value
Description
描述
movenext yes Moves to the next record in the recordset after each repeat
移动到记录集中的下一个记录,并重复
name name Specifies a unique name for the section
为片断指定一个独立的名称
repeat number Specifies the number of times to repeat the section. If not the movenext attribute is defined the report will display the same record the number of times specified in this attribute
指定片断重复的时间次数。如果没有定义movenext属性,那么报告将会重复显示指定次数相同的记录


<section> Sub Elements
<section>二级元素

The <section> element may have the following sub elements:
<section>元素可以包含下面这些二级元素:

Element
元素
Description
描述
<html>[CDATA[
......
......
......
]]>
Inside this element you may put any standard HTML elements and scripts. You may also show data from the database. Data values from the database is inserted with the following syntax:
在这个元素中,你可以放入所有标准的HTML元素和脚本程序.你也可以显示数据库中的数据。数据库中的数据值将按照下面的语法一起插入。

#appml:field(name='fieldname')

Why CDATA? When working with sections, you often split the HTML code in an incorrect way. There will often be a start element in one section that will be closed in another section. When the AppML description (the .xml file) is parsed by an XML parser, it will report an error because this is not correct HTML. To avoid that the parser reports an error you must embed your  report HTML inside a CDATA section
为什么CDATA?当和这些片断一起运行的时候,你通常会把HTML代码以一个非正确的方式进行拆分。片断中通常需要包含开始符和结束符。当AppML描述(.xml 文件)通过XML 解析器解析时,它会提示错误,因为这不是一个正确的HTML。如果你要避免解析器报告错误,你必须将报告HTML元素嵌入一个CDATA片断中。



Example
案例

<?xml version="1.0" ?>
<appml>
<title>CUSTOMERS BY COUNTRY</title>
<database>
<connection>northwind</connection>
</database>

<filters>
<orderby>country,companyname,city</orderby>
</filters>

<htmlreport>
<sql>
SELECT companyname,contactname,city,country,phone
FROM Customers
</sql>
<break>
<field>country</field>
<section>C</section>
</break>
<header>
<h3>CUSTOMERS BY COUNTRY</h3>
</header>

<section name="A"> <html><![CDATA[ <p><b>COUNTRY:</b> #appml:field(name='country')</p> <table width="90%" border="1" cellpadding="1" cellspacing="1"> <tr> <th width="30%">Company</th> <th width="30%">Contactperson</th> <th width="20%">City</th> <th width="20%">Phone</th> </tr> ]]> </html> </section> <section name="B" repeat="10000" movenext="yes"> <html><![CDATA[ <tr> <td>#appml:field(name='companyname')</td> <td>#appml:field(name='contactname')</td> <td>#appml:field(name='city')</td> <td>#appml:field(name='phone')</td> </tr> ]]> </html> </section> <section name="C"> <html><![CDATA[</table><br />]]></html> </section>
</htmlreport>
</appml>

View the output produced by the AppML HTML List Service
查看由AppML HTML 报告服务输出的结果

View the XML source file
查看XML 源文件

评论 (0) All

登陆 | 还没注册?