ktrinad Posted August 30, 2006 Share Posted August 30, 2006 By: Mohan Joshi - mohanjoshi1 Sub Report - Delete SQL Query in main report 2003-03-03 01:28 Hi To get successfully running Subreport example I have to delete SQL Query from Query text of Compile Window. I wonder what is reason for this ? -Mohan By: Giulio Toffoli - gt78 RE: Sub Report - Delete SQL Query in main report 2003-03-03 01:42 The reason is that if you leave the SQL Query field blank in the iReportCompiler window, iReportCompiler pass to the jasperreport an opened Connection object, otherwise, if you leave a query in the field, the compiler execute yourself the query and pass to jasperreports only the result set. This is no good when you have a subreport, because if you don't pass a connection object, jasperreport pass to the subreport a null connection and the execution of the query in the subreport fail. I hope this helps you. Giulio By: Mohan Joshi - mohanjoshi1 RE: Sub Report - Delete SQL Query in main report 2003-03-03 06:26 Hi Giulio, Is it possible to modify the iReport to pass the connection object instead of resultset, if report is having subreport ? For normal user point of view it looks strange to delete the Query only for reports which contains subreport. This behaviour should be consistant (for both kind of report i.e subreports & normal reports). -Mohan By: Giulio Toffoli - gt78 RE: Sub Report - Delete SQL Query in main report 2003-03-03 13:16 The problem is that in most cases the query saved in the report contains conditions with parameters (i.e. MYID=$P{the_Id_to_print}) and can not be execute as is... I think that is more useful use this approach... Giulio 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