报表及报表设计
整理课件
主要内容:
报表概念、分类、示例
报表软件及分类
报表结构设计(iReport)
实例(JasperReport+iReport+JSP)
其它
整理课件
什么是报表
报表就是用表格、图表等格式不同的值。它一搬用来实现各个Band内容的动态显示
整理课件
JasperReport-jrxml示例
//JasperReport根元素
<jasperReport name="example" ………………….>
//参数,书籍类型
<parameter name="type" isForPrompting="false" class="">
</parameter>
//作为数据源的Query
<queryString><![CDATA[select * from books where bookType=$P{type}]]></queryString>
//变量:报告日期
<variable name="reportdate"
class="" resetType="Report" calculation="Nothing">
<variableExpression><![CDATA[new Date()]]></variableExpression>
</variable>
//3个field:编号,名称,类型
<field name="bookId" class=""/>
<field name="bookName" class=""/>
<field name="bookType" class=""/>
…………………………………
//title band,对应于上例中的“DISK类书籍汇总”
<title>
…………….
<textFieldExpression class="">
<![CDATA[$P{type}+"类书籍汇总"]]>
</textFieldExpression>
……………
</title>
//PageHeader Band,对应于上例中的“第1页”
<pageHeader>
……………………………….
<textFieldExpression class="">
<![CDATA["第"+$V{PAGE_NUMBER}.intValue()+"页"]]> </textFieldExpression>
………..
</pageHeader>
整理课件
JasperReport-jrxml示例
//ColumnHeader Band,对应于例中的列名
<columnHeader>
………….
<text><![CDATA[编号]]></text>
………………….
<text><![CDATA[名称]]></text>
………………….
<text><![CDATA[类型]]></text>
………………….
</columnHeader>
//Detail Band 对应于表格中的内容
<detail>
<textFieldExpression class="">
<![CDATA[$F{bookId}]]>
</textFieldExpression>
<textFieldExpression class="">
<![CDATA[$F{bookName}]]>
</textFieldExpression>
<textFieldExpression class="">
<![CDATA[$F{bookType}]]>
</textFieldExpression>
</detail>
//ColumnFooter Band,在例中为空
<columnFooter>
<band height="40" isSplitAllowed="true" >
</band>
</columnFooter>
//PageFooter Band,对应于例中的“本页合计:15”
<pageFooter>
………………
<text><![CDATA[本页合计:]]></text>
…………………….
<textFieldExpression class="
《报表及报表设计》 来自淘豆网www.taodocs.com转载请标明出处.