JasperReports最终用户手册中文版第四节报表设计

上传人:M****1 文档编号:490395526 上传时间:2023-01-04 格式:DOC 页数:7 大小:123.02KB
返回 下载 相关 举报
JasperReports最终用户手册中文版第四节报表设计_第1页
第1页 / 共7页
JasperReports最终用户手册中文版第四节报表设计_第2页
第2页 / 共7页
JasperReports最终用户手册中文版第四节报表设计_第3页
第3页 / 共7页
JasperReports最终用户手册中文版第四节报表设计_第4页
第4页 / 共7页
JasperReports最终用户手册中文版第四节报表设计_第5页
第5页 / 共7页
点击查看更多>>
资源描述

《JasperReports最终用户手册中文版第四节报表设计》由会员分享,可在线阅读,更多相关《JasperReports最终用户手册中文版第四节报表设计(7页珍藏版)》请在金锄头文库上搜索。

1、第四章 报表设计 “报表设计(report design)”是一个模板,JasperReports 引擎会用它来传递动态内容到打印机,屏幕或者是Web页面。存储于数据库中的数据会根据报表的实际设计来填充整个报表,打印到页面导向的文档。The report design represents a template that will be used by the JasperReports engine to deliver dynamic content to the printer, to the screen or to the Web. Data stored in the databa

2、se is organized during the report filling process according to this report design to obtain ready to print, page oriented documents.通常,一个“报表设计”包含了关于数据填充后所形成的报表(documents)的结构和所有的其他方面的信息。这些信息包括将要输出到报表上的各种文本,图像元素的位置,内容,以及要进行的数据计算,自定义计算,分组,操作等信息。Generally speaking, a report design contains all the infor

3、mation concerning the structure and the aspect of the documents that will be generated when the data will be provided. This information concerns the position and the content of various text or graphic elements that will appear on the document, their appearance, the custom calculations, data grouping

4、 and data manipulation that should be performed when generating the documents, etc.一般,“报表设计(report design)”用一种特殊的结构定义在Xml文档中(我们会在稍后详细分析),在被填充数据前,这一过程属于JasperReports 报表的编辑阶段。但是“报表设计(report design)”也可以用JasperReports API 以编程的方式在内存中构造.随JasperReports 项目源文件一起提供了一个 noxmldesign(No Xml Design) 例子介绍了如何直接在内存中创

5、建“报表设计(report design)”,而不用编辑Xml 文档。Normally, the report designs are defined in XML files with a special structure that we shall see in detail later and are subject to the JasperReports compilation process before being filled with data. But they also can be constructed in-memory, programmatically, us

6、ing the JasperReports API. There is a sample called noxmldesign shipped with the JasperReports project source files that shows how to directly create in-memory report designs, without editing any XML files at all.4.1 DTD 文件引用用Xml 文档来编辑“报表设计(report design)”时,JasperReports 用它自己内部专用的DTD 文件来校验这个文档内容。如果X

7、ML 校验通过,那表示这个XML “报表设计(report design)”符合 JasperReports 所需要的XML 文档结构和语法,JapserReports 引擎也可以编译这个文档来输出“已编译”的“报表设计(report design)”.When working with XML report designs, JasperReports uses its own internal DTD files to validate the XML content it receives for processing. If the XML validation is passed,

8、it means that the supplied report design corresponds to the JasperReports required XML structure and syntax and the engine is able to generate the compiled version of the report design.正确的Xml“报表设计”通常标明用于校验它本身的JasperReports 内部专用的DTD文件。如果不标明引用这个文件,报表编译便会失败。这个应该不复杂,因为这个引用在每个“报表设计(report design)“里通常都是一样

9、,你只要简单的复制他就行了。初始设计报表,你可以从本书的例子 里复制。 Valid XML report designs always point to the JasperReports internal DTD files for validation. Without the DTD reference specified, the report compilation process fails abruptly. This should not be considered a too much burden for anybody since the DTD reference is

10、 always the same and can simply be copied from previous report designs. At the beginning you will copy it from the supplied samples.前面已经说过,Jasper reports 引擎只认识指向它内部DTD文件的引用,所以大虾你不要从library 源文件里另外拷贝一个DTD文件放到别的所在,然后在你的“报表设计“里指向它-做外部引用。如果你预谋这样做,你还得修改一些library Classes,包括 类。As already mentioned, the engi

11、ne recognizes only the DTD references that point to its internal DTD files. You cannot make a copy of the DTD files found among the library source files and point to that copy in your XML report designs. If you want to do that, you will also have to alter the code of some of the library classes incl

12、uding the dori.jasper.engine.xml.JRXmlDigester class.如果“小强”你有福遇到了说 JasperReport 引擎由于资源载入问题找不到它自己内部DTD专用文件,确认排除一切可能的错误后再做外部DTD文件引用-做“强人”。不过遇到这样错误的机率很小,因为library资源载入机制已经作了优化。If you ever encounter problems such as the engine not finding its own internal DTD files due to some resource loading problems,

13、make sure you have eliminated every possible cause before deciding to use external DTD files. Encountering such a problem is very unlikely since the resource loading mechanism of the library was improved with time.在XML”报表设计”里,有两种方式的DTD文件引用,它们是:或者是XML“报表设计”的根元素是,下面是一个普通的XML文件形式的“报表设计”:。第一个连续的3个点号是放报表

14、的属性和设置的,另外3个点号是放各种“报表设计”元素的如:parameters,fields,variables,groups,sections, 等。我们会在接下来的几章里详细分析它们。The first 3 points make it for the report design properties and settings and the other 3 for the suppressed various report design elements such as report parameters, fields, variables, groups, report sections, etc. We shall see all of them in detail in the following chapters of this book.42 XML 编码 使用不同种类的语言设计报表时,大哥你一定要注意你报表里的语言编码要符合XML 文件头部的encoding属性所指定的编码。如果不指定的话,默认的就是“UTF8”编码。When creating XML report designs in different languages

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 办公文档 > 模板/表格 > 财务表格

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号