juanmanuelsanch Posted June 22, 2010 Share Posted June 22, 2010 hi ! I usually prints subreports on the summary band, the problem is that when I want to print 2 or more subreports they overlap.Wich is the correct way to do it?Also I want to print the sub reports depending on a variable, so Im using Print When Expression and the formula Im using is: new Boolean( $P{detalle}.matches( "checked" ) )==true but dosent seem to work, any idea on how to do it?Thanks!Post Edited by juanmanuelsanch at 06/22/2010 18:21 Link to comment Share on other sites More sharing options...
juanmanuelsanch Posted June 25, 2010 Author Share Posted June 25, 2010 anyone? I really need how to do this Post Edited by juanmanuelsanch at 06/25/2010 07:56 Link to comment Share on other sites More sharing options...
indhira Posted June 25, 2010 Share Posted June 25, 2010 Hi, You can put the subreport in detail band and set the property strech with over flow. If u do in this way, you can have more than two sub reports without overlapping.And for print when expression the comand shld be in this waynew Boolean( $P{detalle}.matches( "checked" ) ))? Boolean.TRUE : Boolean.FALSE Hope this shld help u. Regards,Indhira P :) Link to comment Share on other sites More sharing options...
juanmanuelsanch Posted June 25, 2010 Author Share Posted June 25, 2010 sorry but I cant seem to find that option in Ireport, I can see the option strech type, but it dosent say anything about overflow. Also it dosent say anything on the band properties. Thanks for the help Link to comment Share on other sites More sharing options...
aanderso Posted June 25, 2010 Share Posted June 25, 2010 Also, you should make the first subreport position type 'Fix Relative to Top', and the second (and any others) position type = 'Float'. this allows the 2nd and subsequent sub-reports to float down out of the way of the prior report.AndyX Link to comment Share on other sites More sharing options...
aanderso Posted June 25, 2010 Share Posted June 25, 2010 In the detail band of the subreport , you can physically insert text similar to the code below with a regular text editor if the GUI does not offer the option. I use Jasper Assistant, and that field won't have anything displayed (if I have not previously set it)... until I click on it an it drops down the option.All the GUIs are currently way behind JR in functionality. The options are: "Relative to Tallest Object", "Relative to Band Height", and "No stretch"See code below.Regards... AndyXCode:[code] <detail> <band height="16"> <frame> <reportElement style="RowShader" stretchType="RelativeToTallestObject" mode="Opaque" x="2" y="-1" width="732" height="16" isPrintWhenDetailOverflows="true"/> <box padding="0" topBorder="1Point" topBorderColor="#C0C0C0" leftBorder="None" leftBorderColor="#FFFFFF" bottomBorder="None" bottomBorderColor="#C0C0C0" rightBorder="None" rightBorderColor="#FFFFFF"/> Link to comment Share on other sites More sharing options...
juanmanuelsanch Posted June 26, 2010 Author Share Posted June 26, 2010 ok thanks that seems to work, sadly I dont like the way it looks. So its there a way to make each sub report go into a separate page when printing? Link to comment Share on other sites More sharing options...
juanmanuelsanch Posted June 27, 2010 Author Share Posted June 27, 2010 Also when trying to print the report by using java I get this error in the Print When Expression: Error: Errors were encountered when compiling report expressions class file:1. Type mismatch: cannot convert from Boolean to boolean value = (java.lang.Boolean)(new Boolean( ((java.lang.String)parameter_detalle.getValue()).matches( "checked" ) )? Boolean.TRUE : Boolean.FALSE); //$JR_EXPR_ID=31$ When using Ireport everything seems to be fine... Any help is appreciated! Link to comment Share on other sites More sharing options...
juanmanuelsanch Posted July 3, 2010 Author Share Posted July 3, 2010 Can someone tell me why is this java error happening? I havent been able to fix it. Link to comment Share on other sites More sharing options...
ejhellerattc Posted July 8, 2010 Share Posted July 8, 2010 .matches returns boolean (little b) - the data type, not Boolean (big B) - the class. You need to use Boolean.valueOf([boolean_value]) to create your new object.With regard to the paging, you can insert a page break element between your sub reports to get them on separate pages. Ed. Link to comment Share on other sites More sharing options...
juanmanuelsanch Posted July 11, 2010 Author Share Posted July 11, 2010 I dont know but it keeps giving me errors. If I try:Boolean.valueOf( $P{detalle}.matches( "checked" )? Boolean.TRUE:Boolean.FALSE)In java I get the following error:Errors were encountered when compiling report expressions class file: 1. The method valueOf(boolean) in the type Boolean is not applicable for the arguments (Boolean) value = (java.lang.Boolean)(Boolean.valueOf( ((java.lang.String)parameter_detalle.getValue()).matches( "checked" )? Boolean.TRUE:Boolean.FALSE)); //$JR_EXPR_ID=31$ <-----> 2. The method valueOf(boolean) in the type Boolean is not applicable for the arguments (Boolean) value = (java.lang.Boolean)(Boolean.valueOf( ((java.lang.String)parameter_detalle.getValue()).matches( "checked" )? So how do I tell the subreport to print when a variable is equal to a value?Thanks!Post Edited by juanmanuelsanch at 07/11/2010 11:38 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