Giter Site home page Giter Site logo

Comments (7)

youseries avatar youseries commented on May 24, 2024

参数放在报表预览页面的url后面传递,要取出来可以使用param函数,param函数用法见文档!

from ureport.

ljc818 avatar ljc818 commented on May 24, 2024

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.

youseries avatar youseries commented on May 24, 2024

确切的说,这map是往报表里传递参数的。这用于自定义报表输出,如果你是采用默认的html报表预览页面,那么只需要在url后面加需要的参数即可!

from ureport.

ljc818 avatar ljc818 commented on May 24, 2024

我写的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.

youseries avatar youseries commented on May 24, 2024

函数属于表达式,要写在单元格类型为表达式的单元格里,比如你上面的param("starttime"),要把单元格类型设置为表达式!

from ureport.

ljc818 avatar ljc818 commented on May 24, 2024

谢谢这么耐心的解答!
对,我设的是表达式.但是没有取出来,我怀疑我操作的流程有问题,所以想让大神帮忙指导一下,看看上边的流程是否有问题.
另外我想知道我put进map中的参数的key跟设计器中数据源sql参数的key一致.报表设计器在查的时候,应该会替换我默认设置的参数吧.

from ureport.

youseries avatar youseries commented on May 24, 2024

会的

from ureport.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.