Passing parameters through the url

懵懂的女人 提交于 2020-01-24 08:26:25

问题


I am able to access a report, that I created with ireport. I am using an url which let's me have a look at my report from the JasperServer interface. It looks like following:

http://localhost:8080/jasperserver/flow.html?_flowId=viewReportFlow&standAlone=true&_flowId=viewReportFlow&ParentFolderUri=%2Freports%2Fsamples%2FTest&reportUnit=%2Freports%2Fsamples%2FTest%2FEinReport&j_acegi_security_check&j_username=jasperadmin&j_password=jasperadmin

My question is: can one pass parameters through this url and when it is possible, how is it done? I have 3 variables in my SQL query in iReport called, Startdatum, Enddatum and username.


回答1:


I just had to add input controls in the JasperServer interface and then add those parameters.

before

http://localhost:8080/jasperserver/flow.html?_flowId=viewReportFlow&standAlone=true&_flowId=viewReportFlow&ParentFolderUri=%2Freports%2Fsamples%2FTest&reportUnit=%2Freports%2Fsamples%2FTest%2FEinReport&j_acegi_security_check&j_username=jasperadmin&j_password=jasperadmin

after

http://localhost:8080/jasperserver/flow.html?_flowId=viewReportFlow&standAlone=true&_flowId=viewReportFlow&ParentFolderUri=%2Freports%2Fsamples%2FTest&reportUnit=%2Freports%2Fsamples%2FTest%2FEinReport&j_acegi_security_check&j_username=jasperadmin&j_password=jasperadmin&Startdatum=2014-04-08&Enddatum=2014-04-11&username=firstUser

Basically just adding input controls and these parameters to the url.

&Startdatum=2014-04-08&Enddatum=2014-04-11&username=firstUser


来源:https://stackoverflow.com/questions/22964133/passing-parameters-through-the-url

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!