JasperReports: Cover page

前端 未结 5 629
旧巷少年郎
旧巷少年郎 2021-01-13 18:14

I have a JasperReport and I want to create for this report a cover page. The cover page must contain some information coming from the DB, like Company name, etc. I am trying

5条回答
  •  旧时难觅i
    2021-01-13 18:44

    Lately answer but It might help another one little bit tricky,

    • right click title band for "Maximized Band Height" dont delete other bands

    • Title band will be your cover page as well you can add whatever you want

    • the component (TextField,Image,Line etc.) for every page you can use conditionaly(int print expression)

    Checkout Example for with two page jasper report

    
    
    
        
            
        
        
            
        
        
            <band height="607" splitType="Stretch">
                <textField>
                    <reportElement x="4" y="10" width="540" height="30" uuid="9a254956-a600-483d-a9fb-8d64ceb73766"/>
                    <textElement textAlignment="Center" verticalAlignment="Middle">
                        <font size="14"/>
                    </textElement>
                    <textFieldExpression><![CDATA["Some text header etc."]]></textFieldExpression>
                </textField>
                <textField>
                    <reportElement x="4" y="288" width="540" height="30" uuid="15a732d8-2596-433b-9ba6-4278c008a394"/>
                    <textElement textAlignment="Center" verticalAlignment="Middle">
                        <font size="14"/>
                    </textElement>
                    <textFieldExpression><![CDATA["Act like Body"]]></textFieldExpression>
                </textField>
                <textField>
                    <reportElement x="4" y="560" width="540" height="30" uuid="1d4d4c98-4469-4001-a2ff-2e880846491e"/>
                    <textElement textAlignment="Center" verticalAlignment="Middle">
                        <font size="14"/>
                    </textElement>
                    <textFieldExpression><![CDATA["Act like Footer"]]></textFieldExpression>
                </textField>
            </band>
        
        
            
                
                    
                        
                    
                    
                        
                    
                    
                
            
        
        
            
        
        
            
                
                    
                    
                        
                    
                    
                
            
        
        
            
        
        
            
        
        
            
        
    
    

    This is preview ss for source code

提交回复
热议问题