通过url传递参数

时间:2014-04-09 13:31:23

标签: jasper-reports jasperserver

我可以访问我使用ireport创建的报告。我正在使用一个网址,让我看一下JasperServer界面的报告。它看起来如下:

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

我的问题是:一个 可以通过此网址传递参数 ,如果可能,它是如何完成的?我在iReport的SQL查询中有3个变量,名为Startdatum,Enddatum和username。

1 个答案:

答案 0 :(得分:6)

我只需在JasperServer接口中添加input controls,然后添加这些参数。

<强>前

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

<强>后

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

基本上只是将输入控件和这些参数添加到url中。

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