My idea is this, pass the master reports $V{PAGE_NUMBER}
to sub report
<subreportParameter name="MASTER_PAGE_NR">
<subreportParameterExpression><![CDATA[$V{PAGE_NUMBER}]]></subreportParameterExpression>
</subreportParameter>
and then use the parameter to sum in sub report (evaluation time now), but watch out!, your subreport may overflow to new page hence you need to take this into consideration, which you can do by using the current page number in the subreport. The actual page number will be $P{MASTER_PAGE_NUMBER} + $V{PAGE_NUMBER} - 1
, in your textField "Page of Title" it will be:
<textFieldExpression>
<![CDATA[$V{REPORT_COUNT} +$P{MASTER_PAGE_NUMBER} + $V{PAGE_NUMBER} - 1]]>
</textFieldExpression>
Full example
Master jrxml
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.2.1.final using JasperReports Library version 5.1.2 -->
<!-- 2018-09-27T16:21:23 -->
<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="Blank_A4_9" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="f44e296b-0657-45aa-9089-0bcf771dfac4">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="Empty 3"/>
<queryString>
<![CDATA[]]>
</queryString>
<detail>
<band height="51" splitType="Stretch">
<subreport>
<reportElement x="0" y="0" width="550" height="50" uuid="1364b663-c783-4686-b571-7a579b3b5052"/>
<subreportParameter name="MASTER_PAGE_NUMBER">
<subreportParameterExpression><![CDATA[$V{PAGE_NUMBER}]]></subreportParameterExpression>
</subreportParameter>
<dataSourceExpression><![CDATA[new JREmptyDataSource(40)]]></dataSourceExpression>
<subreportExpression><![CDATA["Blank_Subreport.jasper"]]></subreportExpression>
</subreport>
</band>
</detail>
</jasperReport>
Sub report jrxml
<?xml version="1.0" encoding="UTF-8"?>
<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="Blank_Subreport" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="351ed03b-edc6-47a9-9139-f7be09f27889">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/>
<parameter name="MASTER_PAGE_NUMBER" class="java.lang.Integer" isForPrompting="false">
<defaultValueExpression><![CDATA[1]]></defaultValueExpression>
</parameter>
<queryString>
<![CDATA[]]>
</queryString>
<columnHeader>
<band height="20" splitType="Stretch">
<staticText>
<reportElement x="0" y="0" width="100" height="20" uuid="d55531d4-77ea-4022-8409-a49dc8d80719"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[Summary]]></text>
</staticText>
<staticText>
<reportElement x="100" y="0" width="100" height="20" uuid="d329710d-6ba8-404c-ae63-d9c7388a7a9c"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[Current Page]]></text>
</staticText>
<staticText>
<reportElement x="200" y="0" width="100" height="20" uuid="46562462-4658-489a-9028-ac5d041bae1d"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[Current Row]]></text>
</staticText>
<staticText>
<reportElement x="300" y="0" width="100" height="20" uuid="2ea0046b-aece-4fb3-96f0-20f94a4f2510"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[Page of Title]]></text>
</staticText>
</band>
</columnHeader>
<detail>
<band height="23" splitType="Stretch">
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
<textField>
<reportElement x="0" y="0" width="100" height="20" uuid="c168f2fa-f0a2-4db1-af3a-c82933395133"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA["Title " + $V{REPORT_COUNT}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="100" y="0" width="100" height="20" uuid="bbc49b4a-c3f2-4167-be35-c37bc813f89c"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$P{MASTER_PAGE_NUMBER}+$V{PAGE_NUMBER}-1]]></textFieldExpression>
</textField>
<textField>
<reportElement x="200" y="0" width="100" height="20" uuid="85c1b417-7224-4dd9-9917-4585b579c9d7"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$V{REPORT_COUNT}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="300" y="0" width="100" height="20" uuid="6b0fdd30-a6be-47d3-8819-146d0fb67249"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$V{REPORT_COUNT} +$P{MASTER_PAGE_NUMBER}+$V{PAGE_NUMBER}-1]]></textFieldExpression>
</textField>
</band>
</detail>
</jasperReport>
Output of page 2 table on page 1 is overflowing on page 2 (running 3 empty records on main, passing 40 empty records to subreport)
