2010-04-29 02:39
浏览 75


I'm using Web Services to run some reports created in iReport on JasperReports Server. Inside the .jrxml file I can see the <querystring> xml that holds the SQL for the report. Is it possible to pass this querystring over to JasperServer via Web Services, instead of hard coding the definition inside the .jrxml file. This is the string I would build in PHP, then pass over to JasperReports Server to be used in the execution of the report.

   <![CDATA[SELECT * FROM table WHERE j=2]]>

Basically, I'm trying to find a way to dynamically create the SQL in PHP, then pass the SQL over to Jasper to run the report. Is it even possible?

图片转代码服务由CSDN问答提供 功能建议

我正在使用Web服务运行在JasperReports Server上的iReport中创建的一些报告。 在.jrxml文件中,我可以看到&lt; querystring&gt; xml,它包含报告的SQL。 是否可以通过Web服务将此查询字符串传递给JasperServer,而不是在.jrxml文件中对该定义进行硬编码。 这是我将在PHP中构建的字符串,然后传递给JasperReports Server以用于执行报告。

 &lt; queryString&gt; 
&lt;![  CDATA [SELECT * FROM table WHERE j = 2]]&gt; 
&lt; / queryString&gt; 

基本上,我正试图找到一种动态创建的方法 PHP中的SQL,然后将SQL传递给Jasper以运行报告。 它甚至可能吗?

  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • dtnd30892 2010-05-05 20:47

    Found out I could do this by setting up a parameter with $P!{query} instead of using $P{query}. The "!" makes the difference. Hope it helps someone else who comes along with the same problem.

    打赏 评论

相关推荐 更多相似问题