Comments (7)
参数放在报表预览页面的url后面传递,要取出来可以使用param函数,param函数用法见文档!
from ureport.
ExportManager exportManager=(ExportManager)Utils.getApplicationContext().getBean(ExportManager.BEAN_ID);
Map<String,Object> parameters=new HashMap<String,Object>();
HtmlReport htmlReport = exportManager.exportHtml("file:demo.ureport.xml",request.getContextPath(),parameters);
上边这些代码来自于文档的与业务结合中的一个jsp页面的代码...请教一下,这里创建出来的map,往map里边put数据 ,这些数据是用来往报表设计器url后面拼接参数的吗
from ureport.
确切的说,这map是往报表里传递参数的。这用于自定义报表输出,如果你是采用默认的html报表预览页面,那么只需要在url后面加需要的参数即可!
from ureport.
我写的sql如 :select 字段1,字段2 字段3,from tableName where time between :starttime and :endtime;
添加的参数是starttime : String 默认值:2017-07-01 endtime : String 默认值:2017-07-31
就如你上边说的,我用的是自定义报表的输出.在jsp页面我往map里put参数如:
parameters.put("starttime", startDate);
parameters.put("endtime", endDate);
前提:startDate,endDate都是已经赋值过了,能在页面直接输出的
问题:
1.我预览的报表就是这个时间段的查出来的数据吧,
2.然后再选择导出报表,这报表是我查出来的,还是整个数据
3.我想在报表的A1行输出starttime-endtime的值
我在报表设计器的单元格里选的是函数的param("starttime"),结果没取出来值.
我上边哪里写的有问题,希望大神指点迷津,谢谢!
from ureport.
函数属于表达式,要写在单元格类型为表达式的单元格里,比如你上面的param("starttime"),要把单元格类型设置为表达式!
from ureport.
谢谢这么耐心的解答!
对,我设的是表达式.但是没有取出来,我怀疑我操作的流程有问题,所以想让大神帮忙指导一下,看看上边的流程是否有问题.
另外我想知道我put进map中的参数的key跟设计器中数据源sql参数的key一致.报表设计器在查的时候,应该会替换我默认设置的参数吧.
from ureport.
会的
from ureport.
Related Issues (20)
- 安全漏洞 HOT 1
- 查询表单设计器多选列表 HOT 1
- 列表中显示图片问题
- 报表内容链接小窗口详情
- UReport2导入excel文件的时候如何把图片也导入到UReport2里
- 重复表头以及单元格合并
- 因为列数太多,生产环境经常跑死,请问如何优化 HOT 1
- ssrf
- path traversal
- 如何实现动态列 HOT 1
- 述我直言,ureport就是个垃圾
- 咨询下,如果不分组,怎么将小计放入对应排好序的行下呀
- 保存数据集因为SQL超长报错
- ureport2 富文本打印问题
- 打印时,多行数据,第二页出现大量空白只显示一行,其余行数据都在第三页 HOT 3
- UReportServlet初始化不支持springboot3.0 jakarta.servlet HOT 1
- springboot项目引入ureport(maven版本是2.2.9),启动的时候报错
- 导出异常 HOT 1
- 如何持久化数据源配置
- Ureport2组件的单元格是否能支持显示和打印富文本内容
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ureport.