1、根据传递的参数定义sheet name (jasper sheet name defined by parameter)

(1) 获取后台参数

<parameter name="PARAMS_PROVIDER" class="com......jasper.writer.JRParamsProvider" isForPrompting="false"/>
<parameter name="P_FIN_PRES" class="java.lang.String">
<defaultValueExpression><![CDATA[$P{PARAMS_PROVIDER}.getQueryParams().get("P_SheetName")]]></defaultValueExpression>
</parameter>

(2) 根据参数定义sheetname, 定义在main report 的 pageHeader 中。

<line>
<reportElement x="0" y="0" width="1" height="1" uuid="141e6753-0b2c-4b74-be35-5826e4df4eb2">
<propertyExpression name="net.sf.jasperreports.export.xls.sheet.name"><![CDATA[$P{P_SheetName}]]></propertyExpression>
</reportElement>
</line>

2、在jasper main report 中硬编码,不同sheet页的sheet name 需要用 "/" 隔开。 (jasper sheet name defined by hard coding)

<property name="net.sf.jasperreports.export.xls.sheet.names.all" value="Sheet1Name/Sheet2Name/Sheet3Name"/>

3、 在jasper sub report 中使用子报表的数据源字段作为sheetName. (jasper sheet name defined by field name)

<group name="Group1">
<groupExpression><![CDATA[$F{Restriction Id}]]></groupExpression>
<groupHeader>
<band height="20">
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
<textField>
<reportElement mode="Opaque" x="0" y="0" width="555" height="20" backcolor="#A6A2A2" uuid="23780fba-1d03-40d6-8c45-fe4ff67e83ad">
<propertyExpression name="net.sf.jasperreports.export.xls.sheet.name"><![CDATA[$F{Restriction Id}]]></propertyExpression>
</reportElement>

4、每个 sheet 页的 sheet name 长度不能超过31 个字符。超过的部分将会被截断。

Jasper_sheetName_defined by parameter or hard coding or filed name的更多相关文章

  1. scrapy(四): 爬取二级页面的内容

    scrapy爬取二级页面的内容 1.定义数据结构item.py文件 # -*- coding: utf-8 -*- ''' field: item.py ''' # Define here the m ...

  2. scrapy (三) : 请求传参

    scrapy 请求传参 1.定义数据结构item.py文件 ''' field: item.py ''' # -*- coding: utf-8 -*- # Define here the model ...

  3. Projected coordinate systems 和 wkid

    Projected coordinate systems Well-known ID Name Well-known text 2000 Anguilla_1957_British_West_Indi ...

  4. Coding源码学习第三部分(EaseStartView.m)

    首先接上篇的要做一个NSEnumerator 类的延展阅读. 枚举(NSEnumerator) (1)依附于集合类(NSArray,NSSet,NSDictionary),没有用来创建实例的接口. ( ...

  5. 编程风格(Coding Style)要求

    编程风格(Coding Style)要求2.1.1 文件(1) 每个模块(module)一般应存在于单独的源文件中,通常源文件名与所包含模块名相同.(2) 每个设计文件开头应包含如下注释内容:? 年份 ...

  6. A few things to remember while coding in Python.

    A few things to remember while coding in Python. - 17 May 2012 - UPDATE: There has been much discuss ...

  7. (转帖) 有限狀態機FSM coding style整理 (SOC) (Verilog)

    来源:http://www.codesoso.net/Record/101092_95120_21.html 来源:http://www.cnblogs.com/oomusou/archive/201 ...

  8. Java – 4 Security Vulnerabilities Related Coding Practices to Avoid---reference

    This article represents top 4 security vulnerabilities related coding practice to avoid while you ar ...

  9. linux c coding style

    Linux kernel coding style This is a short document describing the preferred coding style for the lin ...

随机推荐

  1. nodejs教程

    http://www.yiibai.com/nodejs/ http://www.runoob.com/nodejs/nodejs-tutorial.html http://www.runoob.co ...

  2. 【转】android service 之二(IntentService)

    原文网址:http://rainbow702.iteye.com/blog/1143286 不管是何种Service,它默认都是在应用程序的主线程(亦即UI线程)中运行的.所以,如果你的Service ...

  3. bzoj 1195

    http://www.lydsy.com/JudgeOnline/problem.php?id=1195 状压DP. 首先去掉被包含的字符串. 对于字符串i和j,我们求出 当字符串j的左端点在字符串i ...

  4. NOI 2013 书法家

    http://uoj.ac/problem/125 我真是日狗了...... 果然还是没有耐心读题,搞到读题读错了2个地方,结果调试了半天...... 言归正传. 动态规划. 这种题目很常见. 我们发 ...

  5. paip.hadoop的应用研究总结

    paip.hadoop的应用研究总结 作者Attilax ,  EMAIL:1466519819@qq.com  来源:attilax的专栏 地址:http://blog.csdn.net/attil ...

  6. [置顶] 顿悟JAVA,自己实现Object的Clone的约束关系(上)

    因protected 的理解,顿悟一些JAVA的原理,模拟了Object类的子类为什么在调用clone方法前实现Cloneable接口. 这里不解释 ,上代码先. 运行效果 文件结构 调用类 pack ...

  7. c指针点滴4-指针的值

    #include <stdio.h> #include <stdlib.h> void main() { ; int *p = &num; //double *p1 = ...

  8. hdu 5313 Bipartite Graph(dfs染色 或者 并查集)

    Problem Description Soda has a bipartite graph with n vertices and m undirected edges. Now he wants ...

  9. javascript对象的理解

    从代码中体会javascript中的对象: <!DOCTYPE html> <html> <head> <meta charset="utf-8&q ...

  10. (转)iOS Wow体验 - 第一章 - iOS人机界面设计规范纵览

    本文是<iOS Wow Factor:Apps and UX Design Techniques for iPhone and iPad>第一章译文精选,其余章节将陆续放出. 关于本套译文 ...