sukirtha Posted July 10, 2008 Share Posted July 10, 2008 Hi,I came to know that jasper allows sql query to be passed at runtime during report generation. However I could not obtain any sample to do the same. If any of you have an idea of how to this, please share it here.My requirement is as follows, Depending on the user's request, the query to be executed for a particular report will change. So I need to pass the sql query only during runtime. Any help will be appreciated. Thanks in advance. Warm Regards,Sukirtha Joseph Link to comment Share on other sites More sharing options...
lucianc Posted July 16, 2008 Share Posted July 16, 2008 You can pass the report query string via a parameter:Code:<!-- the JRXML --><parameter name="Query" isForPrompting="false"/><queryString>$P!{Query}</queryString><!-- the fill code -->String query = "select ...";params.put("Query", query);JasperFillManager.fillReport(report, params, connection); HTH,Lucian Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now