felcy Posted February 8, 2007 Share Posted February 8, 2007 hi everyone...im havin a problem in doing my reports which happen to have subreports..i want to know if this is possible..if my subreport returns null, i have a variable on main report which tells whether the subreport is null or not. thanks!!! Link to comment Share on other sites More sharing options...
jmurray Posted February 9, 2007 Share Posted February 9, 2007 Your subreport will have a value in the $V{REPORT_COUNT} variable at fill time, usually the count of rows returned by the source query. In the case of an empty report it will be either: 0 if you set the report's "When no data" setting to "AllPagesNoData" or null if it is set to BlankPage or NoPages When you create the subreport control in you main report you wil need to pass the subreport's $V{REPORT_COUNT} variable's contents into your own variable (eg. $V{SUBREPORT_ROWCOUNT} ). This varable needs to be of type java.lang.Integer, have a default value expression of new java.lang.Integer(0), and have a calculation type value of "System". Its variable expression can be left blank. From there it's up to you as to how you use the variable, and how you trap and handle a value of null if necessary.Post edited by: jmurray, at: 2007/02/08 23:20 Link to comment Share on other sites More sharing options...
felcy Posted February 25, 2007 Author Share Posted February 25, 2007 hi!!thanks for ur response..it helped a lot...anyways, i have another problem..i tried to copy the .jasper file to my project and generated it..it printed successfully but then i copied the jasper file from my project to the other pc im using..tried to generate it again and it dint print at all(im using the same parameters and the same database connection)...it said empty report...when i tried to recompile it to ireport and replace the existing file on my project to the other pc..it was printed...my question is...is it possible that a jasper file can or may be corrupted?? or do i have to recompile a precompiled file everytime i transfer it to another project??? what r the factors that may affect on the compilation of .jasper??? need ur advice...or opinion..thanks so much!!!!!Post edited by: felcy, at: 2007/02/25 02:19 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