﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-Junky's IT Notebook-随笔分类-report</title><link>http://www.blogjava.net/junky/category/18948.html</link><description /><language>zh-cn</language><lastBuildDate>Tue, 27 Feb 2007 22:08:19 GMT</lastBuildDate><pubDate>Tue, 27 Feb 2007 22:08:19 GMT</pubDate><ttl>60</ttl><item><title>BIRT：基于 Eclipse 的报表(转)</title><link>http://www.blogjava.net/junky/archive/2007/01/03/91658.html</link><dc:creator>junky</dc:creator><author>junky</author><pubDate>Wed, 03 Jan 2007 15:44:00 GMT</pubDate><guid>http://www.blogjava.net/junky/archive/2007/01/03/91658.html</guid><wfw:comment>http://www.blogjava.net/junky/comments/91658.html</wfw:comment><comments>http://www.blogjava.net/junky/archive/2007/01/03/91658.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/junky/comments/commentRss/91658.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/junky/services/trackbacks/91658.html</trackback:ping><description><![CDATA[
		<blockquote>
				<div>
						<a href="http://www-128.ibm.com/developerworks/cn/opensource/os-ecl-birt/#author">
								<font color="#996699">胡键 </font>
						</a>, 西安交通大学硕士<br /></div>
				<div>2006 年 3 月 22 日<br />几乎在各种应用中，报表都具有其不可替代的作用。各类报表软件也是争奇斗艳，如今Eclipse也推出了自己的报表框架：BIRT。现在，让我们不妨看看它到底提供了什么样的功能，以及特点是什么。</div>
		</blockquote>
		<!--START RESERVED FOR FUTURE USE INCLUDE FILES-->
		<!-- include java script once we verify teams wants to use this and it will work on dbcs and cyrillic characters -->
		<!--END RESERVED FOR FUTURE USE INCLUDE FILES-->
		<div>
				<a name="IDANC2ZC">
						<span class="atitle">
								<font face="Arial" color="#373737" size="4">安装介绍</font>
						</span>
				</a>
		</div>
		<div>对于扩展Eclipse的功能，首先当然就是去下载对应的plugin，BIRT也不能例外。BIRT的下载地址：<a href="http://download.eclipse.org/birt/downloads/"><a href="http://download.eclipse.org/birt/downloads/" target="_blank"><font color="#373737">http://download.eclipse.org/birt/downloads/</font></a></a>，当前版本是2.0。BIRT依赖于Eclipse的其它几个plugin（GEF和EMF），由于我使用的是Eclipse WTP（这是Eclipse的WEB开发工具），在这个工具中那些plugin都已预装，因此直接下载birt-report-framework-2_0_0.zip就好了。如果没有这些plugin，请下载。</div>
		<div>下载之后，安装非常简单：只需解压然后将对应的features和plugins目录中的内容复制到Eclipse对应的目录下即可。且慢，这只是完成了对于BIRT的基本安装。下一步就是去下载BIRT需要的第三方软件包：</div>
		<table class="data-table-1" cellspacing="0" cellpadding="0" width="650" border="1">
				<tbody>
						<tr>
								<th> </th>
								<th>需要的jar文件</th>
								<th>复制位置（都在plugins目录下）</th>
						</tr>
						<tr>
								<th class="tb-row">
										<a href="http://www.apache.org/dyn/closer.cgi/ws/axis/1_2_1">
												<font color="#5c81a7">Apache Axis</font>
										</a>
								</th>
								<td>axis.jar<br />axis-ant.jar<br />commons-discovery-0.2.jar<br />jaxrpc.jar<br />saaj.jar<br />wsdl4j-1.5.1.jar<br /></td>
								<td>org.eclipse.birt.report.viewer_version/birt/WEB-INF/Lib</td>
						</tr>
						<tr>
								<th class="tb-row">
										<a href="http://www.lowagie.com/iText/download.html">
												<font color="#5c81a7">iText 1.3</font>
										</a>
								</th>
								<td>itext-1.3.jar</td>
								<td>org.eclipse.birt.report.engine.emitter.pdf_version/lib</td>
						</tr>
						<tr>
								<th class="tb-row">
										<a href="http://dev.conio.net/repos/prototype/dist/">
												<font color="#5c81a7">prototype.js v1.4.0</font>
										</a>
								</th>
								<td>prototype.js v1.4.0</td>
								<td>org.eclipse.birt.report.viewer_version/birt/ajax/lib</td>
						</tr>
				</tbody>
		</table>
		<div>自此，BIRT的安装大功告成。启动Eclipse，在"project wizard"中会出现一个BIRT的项目类型。</div>
		<br />
		<table cellspacing="0" cellpadding="0" width="100%" border="0">
				<tbody>
						<tr>
								<td>
										<img onclick="window.open(this.src)" height="1" alt="" src="http://www.ibm.com/i/v14/rules/blue_rule.gif" width="100%" />
										<br />
										<img onclick="window.open(this.src)" height="6" alt="" src="http://www.ibm.com/i/c.gif" width="8" border="0" />
								</td>
						</tr>
				</tbody>
		</table>
		<table class="no-print" cellspacing="0" cellpadding="0" align="right">
				<tbody>
						<tr align="right">
								<td>
										<img onclick="window.open(this.src)" height="4" alt="" src="http://www.ibm.com/i/c.gif" width="100%" />
										<br />
										<table cellspacing="0" cellpadding="0" border="0">
												<tbody>
														<tr>
																<td valign="center">
																		<img onclick="window.open(this.src)" height="16" alt="" src="http://www.ibm.com/i/v14/icons/u_bold.gif" width="16" border="0" />
																		<br />
																</td>
																<td valign="top" align="right">
																		<a class="fbox" href="http://www-128.ibm.com/developerworks/cn/opensource/os-ecl-birt/#main">
																				<b>
																						<font color="#996699">回页首</font>
																				</b>
																		</a>
																</td>
														</tr>
												</tbody>
										</table>
								</td>
						</tr>
				</tbody>
		</table>
		<br />
		<br />
		<div>
				<a name="IDAIE2ZC">
						<span class="atitle">
								<font face="Arial" color="#373737" size="4">典型使用</font>
						</span>
				</a>
		</div>
		<div>在使用之前，了解一些关于BIRT的基本概念，将会对使用非常有益：</div>
		<ul>
				<li>数据源：数据的来源，或提供者。如xml数据源、jdbc数据源等。 
</li>
				<li>数据集：数据集合，它必须与数据源关联，可以理解为查询的结果。 
</li>
				<li>报表以及报表项，报表可视为是针对一组数据集的表现形式，而报表项这是这个表现形式的某个具体的单元。它们之间的关系，与窗体和控件的关系非常类似。报表、数据集、数据源三者间的关系：数据源 --- 数据集 --- 报表。 
</li>
				<li>报表参数：查询参数的表现形式，使用它可以构建更灵活的报表。 
</li>
				<li>模板和库：主要用于复用报表设计，提高报表开发的效率。</li>
		</ul>
		<div>本文中的例子都采用jdbc数据源，这是最常见的使用情形，其中涉及的数据关系是一个典型的多对多关系：</div>
		<br />
		<img onclick="window.open(this.src)" height="174" alt="" src="http://www-128.ibm.com/developerworks/cn/opensource/os-ecl-birt/images/image004.gif" width="383" border="0" />
		<br />
		<div>
				<a name="IDACF2ZC">
						<span class="smalltitle">
								<strong>
										<font face="Arial" color="#373737" size="3">1. 简单报表</font>
								</strong>
						</span>
				</a>
		</div>
		<div>首先，让我们来看看一个"Hello World"级别的应用："列出所有用户"，以便可以快速的了解BIRT。为了完成这一任务，我们需要：</div>
		<div>A. 通过项目向导，创建BIRT工程。工程创建完毕之后，显示BIRT的"报表设计"视图。由于此时没有报表，其它几个视图，如"数据资源管理器"，不可用。</div>
		<br />
		<img onclick="window.open(this.src)" height="399" alt="" src="http://www-128.ibm.com/developerworks/cn/opensource/os-ecl-birt/images/image006.jpg" width="552" border="0" />
		<br />
		<div>B. 在项目上点鼠标右键，选择："new -&gt; 报表"。在报表类型中，选择"空白报表"。</div>
		<div>C. 创建新报表后，数据视图可用。在"数据资源管理器"中创建报表所需要的jdbc数据源。根据向导，可以方便的添加jdbc驱动、数据库url、用户名和密码。</div>
		<div>D. 在指定的数据源上，创建数据集，这一步完成产生数据集的查询。在BIRT中支持2种数据集：基于查询语句和基于存储过程。在本例中使用前者，对应的查询语句是：<code><font face="新宋体">select user.userid, user.username, user.addr from user</font></code>。</div>
		<div>E. 选择刚刚创建的数据集，将它拖至空白报表页上。BIRT会自动为其创建一个报表项，此处是"表"。如下图：</div>
		<br />
		<img onclick="window.open(this.src)" height="437" alt="" src="http://www-128.ibm.com/developerworks/cn/opensource/os-ecl-birt/images/image008.jpg" width="553" border="0" />
		<br />
		<div>F. 选择预览，就可以看到报表运行的实际结果了。或在报表上点击鼠标右键，选择："报表 -&gt; 运行报表"。</div>
		<div>非常简单，一个显示所有用户信息的报表就完成了。在此基础之上，让我们再来完成一些其它具有挑战性的任务：</div>
		<div>1.格式化：这是一个内容广泛的主题，常见的需求：</div>
		<table class="data-table-1" cellspacing="0" cellpadding="0" width="650" border="1">
				<tbody>
						<tr>
								<th>需求</th>
								<th>解决办法（以上为例）</th>
						</tr>
						<tr>
								<th class="tb-row">显示报表列头为中文</th>
								<td>如：将userid显示为"用户标识"。<br />选择"userid"，输入"用户标识"。</td>
						</tr>
						<tr>
								<th class="tb-row">设置报表外观</th>
								<td>选择对应的报表项，通过"属性编辑器"调整。</td>
						</tr>
						<tr>
								<th class="tb-row">对于报表数据列进行处理</th>
								<td>如：将userid和username，显示成：userid：username。双击row["userid"]，出现"表达式生成器"，输入： <code><font face="新宋体">row["userid"]+"："+ row["username"]</font></code></td>
						</tr>
						<tr>
								<th class="tb-row">分页</th>
								<td>选择"表"：在"属性编辑器"中，选择"分页符"，在"分页符间隔"中输入分页大小。</td>
						</tr>
						<tr>
								<th class="tb-row">页眉和页脚</th>
								<td>在报表设计页，选择"主页"，在其中设置页眉和页脚。</td>
						</tr>
				</tbody>
		</table>
		<div>2.排序：一种变通的做法是：将数据集排序之后，如在对应的SQL语句中使用order by，再显示。除此之外，也可以在报表设计时来完成：</div>
		<div>A. 选择表，此时属性编辑器下方会出现与表相关的选择页。</div>
		<br />
		<img onclick="window.open(this.src)" height="34" alt="" src="http://www-128.ibm.com/developerworks/cn/opensource/os-ecl-birt/images/image010.jpg" width="351" border="0" />
		<br />
		<div>B. 选择"排序"，在对应的页面中选择"添加"按钮之后，出现：</div>
		<br />
		<img onclick="window.open(this.src)" height="88" alt="" src="http://www-128.ibm.com/developerworks/cn/opensource/os-ecl-birt/images/image012.jpg" width="554" border="0" />
		<br />
		<div>C. 选择需要进行排序的列，以及排序方式。</div>
		<div>3.计算列：通过"数据集编辑器"来完成。进入"数据集编辑器后"，选择"计算列"：输入对应的"列名称"、"数据类型"和"表达式"。</div>
		<div>4.报表参数：它为报表的产生带来了极大的灵活性。报表参数一定是与含参数的查询对应的，否则失去了意义。现在，将以上需求改为列出"用户标识大于某一输入的所有用户"：</div>
		<div>A. 编辑数据集，修改SQL：<code><font face="新宋体">select user.userid,user.username,user.addr from user where user.userid&gt;?</font></code>。</div>
		<div>B. 在数据集编辑窗体内选择"参数"，然后输入对应的"名称"、"数据类型"、"方向"和"默认值"（必须给出默认值）。其中"方向"表示"输入"或"输出"。对于参数，一般选"输入"。完毕之后：</div>
		<br />
		<img onclick="window.open(this.src)" height="92" alt="" src="http://www-128.ibm.com/developerworks/cn/opensource/os-ecl-birt/images/image014.jpg" width="554" border="0" />
		<br />
		<div>C. 在"数据资源管理器"视图，创建报表参数："用户标识"。</div>
		<div>D. 选择"表"，在"属性编辑器"中选择"绑定"。此时，会出现刚才在数据集中定义的参数"id"。在"值"列，选择报表参数"用户标识"：</div>
		<br />
		<img onclick="window.open(this.src)" height="86" alt="" src="http://www-128.ibm.com/developerworks/cn/opensource/os-ecl-birt/images/image016.jpg" width="553" border="0" />
		<br />
		<div>E. 运行报表时，此时会出现报表参数的输入框，填写值后即出现报表结果。</div>
		<div>本例虽然只定义了一个报表参数，但是BIRT并没有这样的限制。我们可以创建多个参数，做法很简单：首先，查询有多个参数；定义数据集的参数时，按照查询中参数出现的顺序定义；最后，添加需要的报表参数。</div>
		<div>5.分组：以上为例：将用户按地址分组。</div>
		<div>A. 选择"表"，点击鼠标右键，选择"插入组"。这里有两个选择："在上面"和"在下面"。</div>
		<div>B. 选择任意一种，弹出分组资料窗体。填写其中的："名称"和"分组依据"。在本例中，"分组依据"是addr列。</div>
		<div>C. 选择预览，或运行报表，查看结果。</div>
		<div>
				<a name="IDAESG1C">
						<span class="smalltitle">
								<strong>
										<font face="Arial" color="#373737" size="3">2. 子报表</font>
								</strong>
						</span>
				</a>
		</div>
		<div>子报表是另一种最常见的报表，以上为例：列出所有用户，并列出每个用户所购买的项目，以及项目数。为了完成这种父子关系的报表，需要：</div>
		<div>A. 创建新报表和数据源。</div>
		<div>B. 创建数据集user，使用SQL：select user.userid,user.username,user.addr from user。</div>
		<div>C. 创建数据集items，使用SQL：</div>
		<br />
		<table cellspacing="0" cellpadding="5" width="100%" bgcolor="#eeeeee" border="1">
				<tbody>
						<tr>
								<td>
										<divre>
												<code class="section">
														<font face="Lucida Console">select item.itemid,item.itemdesc,item.price,user_item.count from item,user_item where item.itemid= user_item.itemid and user_item.userid= ? </font>
												</code>
												<pre>
												</pre>
										</divre>
								</td>
						</tr>
				</tbody>
		</table>
		<br />
		<div>同时在数据集items上创建参数user，它对应SQL中的参数。</div>
		<div>D. 从"Palette"视图拖入"列表"到报表中，在"属性编辑器"的"绑定"页中，选择数据集为user。它用来显示主表的信息，在本例中是用户信息。</div>
		<div>E. 从"Palette"视图拖入"网格"到"列表"的"明细数据"中，设置网格为1行2列，它用来存放"用户姓名"和"用户地址"。在"数据资源管理器"视图，选择数据集user，将username和addr分别拖入网格的2列中。</div>
		<div>F. 在"数据资源管理器"视图，选择数据集items，将它拖入"列表"的"明细数据"中，位于刚刚插入的网格下方。此时，BIRT会生成数据集items对应的"表"。</div>
		<div>G. 选择刚刚生成的"表"，在"属性编辑器"的"绑定"页中，会出现在items中定义的参数。修改它的值：row["userid"]。于是，父子报表就发生了联系。</div>
		<div>H. 选择预览，或运行报表，就可以看到结果了。</div>
		<div>很遗憾，到目前为止，另一种最常见的报表"交叉表"还不被BIRT支持。但是，BIRT的官方网站已明确表示，将在未来的版本中支持它。</div>
		<div>
				<a name="IDA1SG1C">
						<span class="smalltitle">
								<strong>
										<font face="Arial" color="#373737" size="3">3. 统计图表</font>
								</strong>
						</span>
				</a>
		</div>
		<div>俗话说，"一图顶千言"。没有图的报表是枯燥，且缺乏表现力的。在本例中，我们将使用图表来表示：每个用户的消费总数。</div>
		<div>A. 创建新报表和数据源。</div>
		<div>B. 创建数据集chart，使用SQL：</div>
		<br />
		<table cellspacing="0" cellpadding="5" width="100%" bgcolor="#eeeeee" border="1">
				<tbody>
						<tr>
								<td>
										<divre>
												<code class="section">
														<font face="Lucida Console">select user.username,round(sum(item.price*user_item.count),2) from item, user_item, user where item.itemid= user_item.itemid and user.userid= user_item.userid group by user.username </font>
												</code>
												<pre>
												</pre>
										</divre>
								</td>
						</tr>
				</tbody>
		</table>
		<br />
		<div>C. 从"Palette"视图拖入"图表"到报表中，此时会弹出"编辑图表"窗体。</div>
		<div>D. 在"选择图表类型"页，选择图表类型为"条形图"。在"选择数据"页，使用数据集chart，同时选中username列，将其拖入"类别x系列"。对于统计列，同样将其拖入"类别y系列"。在"图表格式"页，分别为x和y系列，填写相应的显示名称。</div>
		<div>E. 选择预览，或运行报表，即可看到统计图表。</div>
		<div>
				<a name="IDANTG1C">
						<span class="smalltitle">
								<strong>
										<font face="Arial" color="#373737" size="3">4. 使用脚本</font>
								</strong>
						</span>
				</a>
		</div>
		<div>可以使用脚本，是BIRT的一大特色。在BIRT中，数据源、数据集和报表项，都可以书写脚本。具体做法：选择数据源、数据集和报表项任意一种对象，然后选择"脚本"页面。如选择数据源user后，对应的脚本输入页面：</div>
		<br />
		<img onclick="window.open(this.src)" height="187" alt="" src="http://www-128.ibm.com/developerworks/cn/opensource/os-ecl-birt/images/image018.jpg" width="482" border="0" />
		<br />
		<div>选择对应的事件，然后在下方的脚本输入框中输入脚本即可。如对于第一个例子，我们需要统计用户地址是"No.5 St."的用户数：</div>
		<div>A. 选择数据集，然后选择"脚本"，进入数据集的脚本编辑窗口。</div>
		<div>B. 选择事件"afterOpen"，在脚本窗口内输入：count=0;</div>
		<div>C. 选择事件"onFetch"，在脚本窗口内输入：if( row["addr"]== "No.5 St.") count++;</div>
		<div>D. 选择报表，在脚本窗口选择事件"onRender"，输入：this.caption=count;</div>
		<div>E. 预览，或运行报表后，会在报表的标题输出count的数值。</div>
		<div>另外，BIRT也支持使用java来作为报表项的事件处理程序。具体做法，请参见BIRT的帮助文档。</div>
		<div>
				<a name="IDAHUG1C">
						<span class="smalltitle">
								<strong>
										<font face="Arial" color="#373737" size="3">5. 库和模板</font>
								</strong>
						</span>
				</a>
		</div>
		<div>除了脚本使开发者可以自定义报表的行为外，BIRT还提供了库和模板机制来重用设计，加快报表的开发。在TheServerSide上有一篇相当详细的文档：<a href="http://www.theserverside.com/articles/article.tss?l=EclipseBRT"><font color="#5c81a7">Using Eclipse BIRT Report Libraries and Templates</font></a>。</div>
		<br />
		<table cellspacing="0" cellpadding="0" width="100%" border="0">
				<tbody>
						<tr>
								<td>
										<img onclick="window.open(this.src)" height="1" alt="" src="http://www.ibm.com/i/v14/rules/blue_rule.gif" width="100%" />
										<br />
										<img onclick="window.open(this.src)" height="6" alt="" src="http://www.ibm.com/i/c.gif" width="8" border="0" />
								</td>
						</tr>
				</tbody>
		</table>
		<table class="no-print" cellspacing="0" cellpadding="0" align="right">
				<tbody>
						<tr align="right">
								<td>
										<img onclick="window.open(this.src)" height="4" alt="" src="http://www.ibm.com/i/c.gif" width="100%" />
										<br />
										<table cellspacing="0" cellpadding="0" border="0">
												<tbody>
														<tr>
																<td valign="center">
																		<img onclick="window.open(this.src)" height="16" alt="" src="http://www.ibm.com/i/v14/icons/u_bold.gif" width="16" border="0" />
																		<br />
																</td>
																<td valign="top" align="right">
																		<a class="fbox" href="http://www-128.ibm.com/developerworks/cn/opensource/os-ecl-birt/#main">
																				<b>
																						<font color="#996699">回页首</font>
																				</b>
																		</a>
																</td>
														</tr>
												</tbody>
										</table>
								</td>
						</tr>
				</tbody>
		</table>
		<br />
		<br />
		<div>
				<a name="IDASUG1C">
						<span class="atitle">
								<font face="Arial" color="#373737" size="4">应用集成</font>
						</span>
				</a>
		</div>
		<div>BIRT与现有应用的集成非常简单，由于BIRT主要是web应用，本节以web应用为例进行说明。</div>
		<div>1. 从Eclipse BIRT官方网站下载birt-runtime-2_0_0.zip。</div>
		<div>2. 解压之后，只需要其中的web view example目录下的内容。</div>
		<div>3. 复制以下第三方软件包到web view example目录：</div>
		<table class="data-table-1" cellspacing="0" cellpadding="0" width="650" border="1">
				<tbody>
						<tr>
								<th> </th>
								<th>需要的jar文件</th>
								<th>复制位置</th>
						</tr>
						<tr>
								<th class="tb-row">
										<a href="http://www.apache.org/dyn/closer.cgi/ws/axis/1_2_1">
												<font color="#5c81a7">Apache Axis</font>
										</a>
								</th>
								<td>axis.jar<br />axis-ant.jar<br />commons-discovery-0.2.jar<br />jaxrpc.jar<br />saaj.jar<br />wsdl4j-1.5.1.jar<br /></td>
								<td>WEB-INF/Lib</td>
						</tr>
						<tr>
								<th class="tb-row">
										<a href="http://www.lowagie.com/iText/download.html">
												<font color="#5c81a7">iText 1.3</font>
										</a>
								</th>
								<td>itext-1.3.jar</td>
								<td>Plugins/org.eclipse.birt.report.engine.emitter.pdf/lib</td>
						</tr>
						<tr>
								<th class="tb-row">
										<a href="http://dev.conio.net/repos/prototype/dist/">
												<font color="#5c81a7">prototype.js v1.4.0</font>
										</a>
								</th>
								<td>prototype.js v1.4.0</td>
								<td>ajax/lib</td>
						</tr>
				</tbody>
		</table>
		<div>4. 将web view example目录发布到web容器中，如tomcat，改名：birtApp。</div>
		<div>5. 启动tomcat，并访问birtApp。在首页中选择"View Example"，如果成功发布，系统将提示成功。</div>
		<div>6. 发布设计完成的报表文件，在birtApp中创建reports目录，用于存放报表设计文件。</div>
		<div>7. 在应用中通过：<a href="http://localhost:8080/birtApp/frameset?__report=" target="_blank"><font color="#373737">http://localhost:8080/birtApp/frameset?__report=</font></a>报表文件路径，就可以访问报表了。</div>
		<div>这个web应用支持2个动作：</div>
		<ul>
				<li>frameset，以frameset的形式显示报表。这个界面包含一些frame，如页面导航，报表主体在其中的一个frame中显示；使用形式：<br /><a href="http://localhost:8080/birtApp/frameset?__report=" target="_blank"><font color="#373737">http://localhost:8080/birtApp/frameset?__report=</font></a>报表文件路径&amp;参数=........ 
</li>
				<li>run，报表以一个单独的html页面或pdf显示，由于这种形式没有frmaeset，因此使用者必须自己提供相应的参数，如报表参数，页号等。使用形式：<br /><a href="http://localhost:8080/birtApp/run?__report=" target="_blank"><font color="#373737">http://localhost:8080/birtApp/run?__report=</font></a>报表文件路径&amp;参数=........</li>
		</ul>
		<div>对于以上2个动作，以下列出可用的参数：</div>
		<table class="data-table-1" cellspacing="0" cellpadding="0" width="650" border="1">
				<tbody>
						<tr>
								<th>选项</th>
								<th>说明</th>
						</tr>
						<tr>
								<th class="tb-row">__format</th>
								<td>报表输出格式：html或pdf，缺省是html。对于frameset不起作用。</td>
						</tr>
						<tr>
								<th class="tb-row">__isnull</th>
								<td>指明一个参数是null，常用于字符串类型。如果提供参数且值为空： - 对于日期和数字类型，BIRT会将它们当作null处理。 - 对于字符串，BIRT会将它作为空字符串。因此，为了说明某个字符串是null，通常写为：__isnull=参数。</td>
						</tr>
						<tr>
								<th class="tb-row">__locale</th>
								<td>本地化选项，缺省是jvm的locale。</td>
						</tr>
						<tr>
								<th class="tb-row">__report</th>
								<td>报表设计文件路径。</td>
						</tr>
						<tr>
								<th class="tb-row">报表参数</th>
								<td>报表参数参数值对，形式：参数名=参数值。对于frameset，直接在地址栏中输入参数名=参数值后回车，不会影响报表结果。虽然，此时选择"运行报表"时，弹出的参数值已经改变。</td>
						</tr>
				</tbody>
		</table>
		<div>虽然本节所说的是针对web应用的集成，但是这种方法同样也可与非web应用集成。此时，我们可以采取一种变通的方法：在非web应用中使用内嵌的web容器，如jetty，也可达到同样的效果。这种做法和Eclipse的做法类似。还记得在报表设计时使用"报表 -&gt; 运行报表"吗？那个弹出的窗体，实际就是一个web页面。</div>
		<br />
		<table cellspacing="0" cellpadding="0" width="100%" border="0">
				<tbody>
						<tr>
								<td>
										<img onclick="window.open(this.src)" height="1" alt="" src="http://www.ibm.com/i/v14/rules/blue_rule.gif" width="100%" />
										<br />
										<img onclick="window.open(this.src)" height="6" alt="" src="http://www.ibm.com/i/c.gif" width="8" border="0" />
								</td>
						</tr>
				</tbody>
		</table>
		<table class="no-print" cellspacing="0" cellpadding="0" align="right">
				<tbody>
						<tr align="right">
								<td>
										<img onclick="window.open(this.src)" height="4" alt="" src="http://www.ibm.com/i/c.gif" width="100%" />
										<br />
										<table cellspacing="0" cellpadding="0" border="0">
												<tbody>
														<tr>
																<td valign="center">
																		<img onclick="window.open(this.src)" height="16" alt="" src="http://www.ibm.com/i/v14/icons/u_bold.gif" width="16" border="0" />
																		<br />
																</td>
																<td valign="top" align="right">
																		<a class="fbox" href="http://www-128.ibm.com/developerworks/cn/opensource/os-ecl-birt/#main">
																				<b>
																						<font color="#996699">回页首</font>
																				</b>
																		</a>
																</td>
														</tr>
												</tbody>
										</table>
								</td>
						</tr>
				</tbody>
		</table>
		<br />
		<br />
		<div>
				<a name="IDA1XG1C">
						<span class="atitle">
								<font face="Arial" color="#373737" size="4">结论</font>
						</span>
				</a>
		</div>
		<div>与一些老牌报表软件相比，BIRT可能仍显稚嫩。然而，它也不乏其独到之处，如脚本控制、库和模板。加之有世界领先的报表厂商Actuate支持，实际上BIRT的ROM（Report Object Model）就是Actuate捐献的，我们有充分的理由对BIRT的前景表示乐观。</div>
		<br />
		<table cellspacing="0" cellpadding="0" width="100%" border="0">
				<tbody>
						<tr>
								<td>
										<img onclick="window.open(this.src)" height="1" alt="" src="http://www.ibm.com/i/v14/rules/blue_rule.gif" width="100%" />
										<br />
										<img onclick="window.open(this.src)" height="6" alt="" src="http://www.ibm.com/i/c.gif" width="8" border="0" />
								</td>
						</tr>
				</tbody>
		</table>
		<table class="no-print" cellspacing="0" cellpadding="0" align="right">
				<tbody>
						<tr align="right">
								<td>
										<img onclick="window.open(this.src)" height="4" alt="" src="http://www.ibm.com/i/c.gif" width="100%" />
										<br />
										<table cellspacing="0" cellpadding="0" border="0">
												<tbody>
														<tr>
																<td valign="center">
																		<img onclick="window.open(this.src)" height="16" alt="" src="http://www.ibm.com/i/v14/icons/u_bold.gif" width="16" border="0" />
																		<br />
																</td>
																<td valign="top" align="right">
																		<a class="fbox" href="http://www-128.ibm.com/developerworks/cn/opensource/os-ecl-birt/#main">
																				<b>
																						<font color="#996699">回页首</font>
																				</b>
																		</a>
																</td>
														</tr>
												</tbody>
										</table>
								</td>
						</tr>
				</tbody>
		</table>
		<br />
		<br />
		<div>
				<a name="resources">
						<span class="atitle">
								<font face="Arial" color="#373737" size="4">参考资料 </font>
						</span>
				</a>
		</div>
		<ul>
				<li>BIRT官方网站 <a href="http://www.eclipse.org/birt/phoenix/"><a href="http://www.eclipse.org/birt/phoenix/" target="_blank"><font color="#373737">http://www.eclipse.org/birt/phoenix/</font></a></a><br /><br /></li>
				<li>BIRT and POJOs as datasources example <a href="http://tools.osmosis.gr/blog/archives/2005/06/birt_and_object.html"><a href="http://tools.osmosis.gr/blog/archives/2005/06/birt_and_object.html" target="_blank"><font color="#373737">http://tools.osmosis.gr/blog/archives/2005/06/birt_and_object.html</font></a></a><br /><br /></li>
				<li>Using Eclipse BIRT Report Libraries and Templates <a href="http://www.theserverside.com/articles/article.tss?l=EclipseBRT"><a href="http://www.theserverside.com/articles/article.tss?l=EclipseBRT" target="_blank"><font color="#373737">http://www.theserverside.com/articles/article.tss?l=EclipseBRT</font></a></a><br /></li>
		</ul>
		<br />
		<table cellspacing="0" cellpadding="0" width="100%" border="0">
				<tbody>
						<tr>
								<td>
										<font color="#373737">
												<img onclick="window.open(this.src)" height="1" alt="" src="http://www.ibm.com/i/v14/rules/blue_rule.gif" width="100%" />
												<br />
												<img onclick="window.open(this.src)" height="6" alt="" src="http://www.ibm.com/i/c.gif" width="8" border="0" />
										</font>
								</td>
						</tr>
				</tbody>
		</table>
		<table class="no-print" cellspacing="0" cellpadding="0" align="right">
				<tbody>
						<tr align="right">
								<td>
										<font color="#373737">
												<img onclick="window.open(this.src)" height="4" alt="" src="http://www.ibm.com/i/c.gif" width="100%" />
												<br />
										</font>
										<table cellspacing="0" cellpadding="0" border="0">
												<tbody>
														<tr>
																<td valign="center">
																		<font color="#373737">
																				<img onclick="window.open(this.src)" height="16" alt="" src="http://www.ibm.com/i/v14/icons/u_bold.gif" width="16" border="0" />
																				<br />
																		</font>
																</td>
																<td valign="top" align="right">
																		<a class="fbox" href="http://www-128.ibm.com/developerworks/cn/opensource/os-ecl-birt/#main">
																				<b>
																						<font color="#996699">回页首</font>
																				</b>
																		</a>
																</td>
														</tr>
												</tbody>
										</table>
								</td>
						</tr>
				</tbody>
		</table>
		<br />
		<br />
		<div>
				<a name="author">
						<span class="atitle">
								<font face="Arial" color="#373737" size="4">关于作者</font>
						</span>
				</a>
		</div>
		<table cellspacing="0" cellpadding="0" width="100%" border="0">
				<tbody>
						<tr>
								<td colspan="3">
										<font face="Arial" color="#373737" size="4">
												<img onclick="window.open(this.src)" height="5" alt="" src="http://www.ibm.com/i/c.gif" width="100%" />
										</font>
								</td>
						</tr>
						<tr valign="top" align="left">
								<td>
										<div>
												<font face="Arial" color="#373737" size="4">
												</font>
										</div>
								</td>
								<td>
										<font face="Arial" color="#373737" size="4">
												<img onclick="window.open(this.src)" height="5" alt="" src="http://www.ibm.com/i/c.gif" width="4" />
										</font>
								</td>
								<td width="100%">
										<div>胡键，西安交通大学硕士，2000年毕业后一直从事软件开发。2002年开始使用Java，在平时的项目开发中经常采用OpenSource的工具，如Ant、Maven、Hibernate、Struts等，目前正在研究信息集成方面的规范和技术。可以通过<a href="mailto:jianhgreat@hotmail.com"><a href="mailto:jianhgreat@hotmail.com"><font color="#373737">jianhgreat@hotmail.com</font></a></a>与他取得联系，或访问个人blog：<a href="http://blog.donews.com/foxgem/"><a href="http://blog.donews.com/foxgem/" target="_blank"><font color="#373737">http://blog.donews.com/foxgem/</font></a></a>。</div>
								</td>
						</tr>
				</tbody>
		</table>
		<br />
<img src ="http://www.blogjava.net/junky/aggbug/91658.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/junky/" target="_blank">junky</a> 2007-01-03 23:44 <a href="http://www.blogjava.net/junky/archive/2007/01/03/91658.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>