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. 兼容IE与firefox、chrome的css 线性渐变(linear-gradient)

    现行渐变首先看下示例(1)垂直渐变 (2)垂直渐变 IE系列 filter: progid:DXImageTransform.Microsoft.Gradient(startColorStr='#FF ...

  2. 【Beta】Phylab2.0: Postmortem

    设想和目标 1. 我们的软件要解决什么问题?是否定义得很清楚?是否对典型用户和典型场景有清晰的描述? 主要解决同学们写物理实验报告时,处理数据的困难--巨大的计算量和不规范的物理报告数据处理格式.典型 ...

  3. UIApplication详解再解-备

    每个app有且只有一个UIApplication对象,当程序启动的时候通过调用UIApplicationMain方法得到的.可以通过sharedApplication方法得到. UIApplicati ...

  4. VS2010使用Qt库

    有参考文件可以看出,应该还是简单的. = =! Qt库的安装目录bin下,我把它添加到Path环境变量中也无用,真是搞不懂,按理来说windows搜索完当前目录会去Path指定的路径下搜索啊?为什么必 ...

  5. VS2010 Command Prompt Error:Cannot determine the location of the VS Common Tools folder

    就在VS2010 Command Prompt 用vcvarsall.bat x64重新设置环境变量的时候,出现了标题中的错误.原因就在参考链接中 References: http://stackov ...

  6. java cannot find the tag library descriptor for "http://java.sun.com/jsp/jstl/core"

    出现java cannot find the tag library descriptor for "http://java.sun.com/jsp/jstl/core" 主要的愿 ...

  7. rpm -qs查看包信息

    rpm -qs mysql-connector-c-devel Query options (with -q or --query):  -c, --configfiles               ...

  8. linux 下的对拍

    搞了一上午终于弄好了一个对拍,估计以后调试会方便很多. #!/bin/bash while true; do ./makedate>tmp.in ./XXXXX<tmp.in>tmp ...

  9. javascript笔记2之数据类型

    /* var box; alert(typeof box); //box是Undefined类型,值是undefined,类型返回的字符串是undefined var box = true; aler ...

  10. HTML特殊符号显示技巧

    转:http://www.cnblogs.com/JessonChan/archive/2011/08/06/2129170.html HTML符号 显示一览表.编辑博客的时候经常会用到.特别是空格( ...