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
Add them to the summary band, you may even chose to have that on a different page. Than on that subreport that you just added, at his summary band you can put another one, and on his, another one and so you go. You can have infinite reports binded together.
I possibly misunderstood the question, because the accepted answer goes about discouraging subreports, which are the perfect solution for a cover (just put it in the TITLE band). Subreports are actually the killer feature of JR. It's true they aren't simple, but they can be implemented without any tweaking nor bending of the available toolset. And I use them EXACTLY when the dataset queries are widely different...
Lately answer but It might help another one little bit tricky,
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
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.16.0.final using JasperReports Library version 6.16.0-48579d909b7943b64690c65c71e07e0b80981928 -->
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="with_cover_page" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="54476be0-8bb3-45ff-a01b-12ce691c960b">
<queryString>
<![CDATA[]]>
</queryString>
<background>
<band splitType="Stretch"/>
</background>
<title>
<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>
</title>
<pageHeader>
<band height="35" splitType="Stretch">
<textField>
<reportElement x="4" y="5" width="546" height="30" uuid="580f101d-9569-4692-914b-4f30e05df9a4">
<printWhenExpression><![CDATA[$V{PAGE_NUMBER} != 1]]></printWhenExpression>
</reportElement>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="18"/>
</textElement>
<textFieldExpression><![CDATA["This is page Header for every page except first one"]]></textFieldExpression>
</textField>
</band>
</pageHeader>
<columnHeader>
<band height="61" splitType="Stretch"/>
</columnHeader>
<detail>
<band height="125" splitType="Stretch">
<textField>
<reportElement x="4" y="49" width="546" height="30" uuid="52bcf471-555f-4fe7-bd35-a53aee7e761f"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="16"/>
</textElement>
<textFieldExpression><![CDATA["This is second page"]]></textFieldExpression>
</textField>
</band>
</detail>
<columnFooter>
<band height="45" splitType="Stretch"/>
</columnFooter>
<pageFooter>
<band height="54" splitType="Stretch"/>
</pageFooter>
<summary>
<band height="42" splitType="Stretch"/>
</summary>
</jasperReport>
This is preview ss for source code
Directory Discourse
Setting up the subreport is not trivial using Jasper Reports. There are at least two ways to tell a master report where to find sub-reports.
SUBREPORT_DIR
parameter.For solution 1, determine the absolute directory of the master report location at run time. Then, place subreports in relative directories under the master report. Finally, tell the master report the absolute path to the subdirectory containing the subreports.
I have not used solution 2.
Parameterized Master
Consider parameterizing the master report, instead of creating subreports.
If you only have one report, but want to use a different logo (and company name, styling, and so forth), then use parameters to configure the look and feel.
Subreport Usage
I find it useful to create subreports when the queries for the data are nearly the same, but need to group the data in slightly different ways. The master report contains everything that is common (showing input parameters -- so that the report can be recreated, headings, company name, user name, time stamp, page number, and so on), and the subreports focus on the differences. Often, the subreports will overlap and only be executed depending on the value of an input parameter.
I added a break at the end of the title band.
<title>
<band>
<break></break>
</band>
</title>
This has the effect of a page break.