ktrinad Posted August 31, 2006 Share Posted August 31, 2006 By: Hamza MEahmmed - hamzam multipage Subreports 2003-05-30 00:14 Please help. Multipage Reports with subreport is going well. I have a Problem to develope a Report which has Subreports and this subreports have also more than one Page. thanks. By: Giulio Toffoli - gt78 RE: multipage Subreports 2003-05-30 00:41 if the problem is relative to blank portions of pages etc..., insert any subreport in a group. In this way you can split your detail. Generally this type of problem occurs when the detail band il heigher of a page. Giulio By: Hamza MEahmmed - hamzam RE: multipage Subreports 2003-05-30 01:03 Thank you for your fast respose! The portion of the pages are not blank. May be it is better that i send you those two small Reports: Master and Child_1 xml Files. ============================================= MASTER ================================================ <?xml version="1.0" encoding="UTF-8" ?> <!-- Created with iReport - A designer for JasperReports --> <!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"> <jasperReport name="Master" columnCount="1" printOrder="Vertical" orientation="Portrait" pageWidth="595" pageHeight="842" columnWidth="535" columnSpacing="0" leftMargin="30" rightMargin="30" topMargin="20" bottomMargin="20" whenNoDataType="NoPages" isTitleNewPage="false" isSummaryNewPage="false"> <group name="child1" isStartNewColumn="false" isStartNewPage="true" isResetPageNumber="false" isReprintHeaderOnEachPage="false" minHeightToStartNewPage="0" > <groupExpression></groupExpression> <groupHeader> <band height="50"> </band> </groupHeader> <groupFooter> <band height="500"> <subreport isUsingCache="true"> <reportElement mode="Opaque" x="15" y="14" width="508" height="474" forecolor="#000000" backcolor="#808080" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"/> <subreportExpression class="java.lang.String"><![CDATA["c:\_MISC\TPS\TPS_V1\com\systerion\tps\JasperFiles\Child_1.jasper"]]></subreportExpression> </subreport> </band> </groupFooter> </group> <title> <band height="50"> <staticText> <reportElement mode="Transparent" x="145" y="20" width="192" height="24" forecolor="#000000" backcolor="#FFFFFF" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="sansserif" pdfFontName="Helvetica" size="10" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="false" /> </textElement> <text><![CDATA[This is the Master Report title.]]></text> </staticText> </band> </title> <pageHeader> <band height="50"> </band> </pageHeader> <columnHeader> <band height="30"> </band> </columnHeader> <detail> <band height="50"> </band> </detail> <columnFooter> <band height="30"> </band> </columnFooter> <pageFooter> <band height="50"> </band> </pageFooter> <summary> <band height="50"> </band> </summary> </jasperReport> ================================================== CHILD_1 ================================================= <?xml version="1.0" encoding="UTF-8" ?> <!-- Created with iReport - A designer for JasperReports --> <!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"> <jasperReport name="Child_1" columnCount="1" printOrder="Vertical" orientation="Portrait" pageWidth="595" pageHeight="842" columnWidth="535" columnSpacing="0" leftMargin="30" rightMargin="30" topMargin="20" bottomMargin="20" whenNoDataType="AllSectionsNoDetail" isTitleNewPage="false" isSummaryNewPage="false"> <title> <band height="50"> <staticText> <reportElement mode="Transparent" x="144" y="15" width="191" height="22" forecolor="#000000" backcolor="#FFFFFF" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="sansserif" pdfFontName="Helvetica" size="10" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="false" /> </textElement> <text><![CDATA[This is Child Nr. 1 Title]]></text> </staticText> </band> </title> <pageHeader> <band height="50"> </band> </pageHeader> <columnHeader> <band height="30"> </band> </columnHeader> <detail> <band height="50"> <textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" > <reportElement mode="Transparent" x="113" y="12" width="173" height="23" forecolor="#000000" backcolor="#FFFFFF" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="sansserif" pdfFontName="Helvetica" size="48" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="false" /> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[" test of child nr. 1test of child nr. 1test of child nr. 1test of child nr. 1test of child nr. 1test of child nr. 1test of child nr. 1test of child nr. 1test of child nr. 1test of child nr. 1test of child nr. 1test of child nr. 1test of child nr. 1test of child nr. 1test of child nr. 1test of child nr. 1"]]></textFieldExpression> </textField> </band> </detail> <columnFooter> <band height="30"> </band> </columnFooter> <pageFooter> <band height="50"> </band> </pageFooter> <summary> <band height="50"> </band> </summary> </jasperReport> ================================================= Thanks a lot again, Hamza By: Giulio Toffoli - gt78 RE: multipage Subreports 2003-05-30 01:31 ops... the link... https://sourceforge.net/forum/forum.php?thread_id=868822&forum_id=217623 Giulio By: Giulio Toffoli - gt78 RE: multipage Subreports 2003-05-30 01:27 Sorry Hamza, but what do you aspects from this report? There isn't a query or a datasource -> detail and group bands are not printed. Please refer to this link to download an example master/subreport that don't use connections. But I'm sure that you want use a connection... Try to put your subreport in a "group header" band, and not in a "group footer". (I can assure you that it's possible handle subreport with many pages :-) Giulio By: Hamza MEahmmed - hamzam RE: multipage Subreports 2003-05-30 02:04 Hello Giulio, I am trying to develope a Report for one big programm that can have even hundreds of Pages. This report contains some descriptions as text, which can hava more than one page. The other Components of this report will be taken from JTables, which kann also has a lot of pages. I can now develope reports with subreports. But this reports has only a single page and if i make subreports with more than one page only the first pages title will be printed. if you could change the report that i sent you to print all 4 pages of the child report, it will help me to go further. Thanks, Hamza The report i sent you was just an example, which has only one title for the master and 4 pages for the Child (because of the big size of the text). But after puting the Subreport in the Gruppeheader of the Master it prints out only one page. But i print only the child report i get 4 pages. By: Hamza MEahmmed - hamzam RE: multipage Subreports 2003-05-30 02:15 Hello Giulio, Sorry for the message at the bottom of my last mail. Concerning the report i sent you: I tried to say when i print out only the Child Report i get 4 Pages and when i print out the Master Report i get only one single page. Sorry for my broken english. Thanks, Hamza By: Giulio Toffoli - gt78 RE: multipage Subreports 2003-05-30 02:16 OK Hamza, please open a Support request, so we have a way to exchange files. I'll attach to the support request the pdf generated and some other stuff. By: Hamza MEahmmed - hamzam RE: multipage Subreports 2003-06-02 07:10 Hallo Giulio, After I got your files, i tried to work on my Stuff. In your files you used database and i tried in the same way with JTabels but i didn't success. Is there any thing i schuld change? or is that the same as for DB. Thanks Hamza By: Giulio Toffoli - gt78 RE: multipage Subreports 2003-06-02 13:41 If you can with a JRDatasource created by a ResultSet (a JRDResultSetDataSource), also you can do the same thing with any other type of JRDataSource. You should "wrap" your jTable model using an appropriate JRDataSource. See JAsperReports API to see howto create your custom datasource. 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