We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

ODT Not automatic collate copies

Our clients have asked us a question,

Can you please help to solve it?

The following is the content of the customer’s inquiry:

We found that the page number of ODT will not increase with the number of pages, but will remain at 1.

Could you please help to solve this problem?

The attachment is JRXML and the generated report.




@accesssoft You should use AWExporterParameter.RECOGNIZE_FIELDS option and the appropriate MS Word field code { PAGE } in your report.

Hi Peggy,

I’ve changed my JRXML to use {PAGE} field code for current page number and set RECOGNIZE_FIELDS to true, but the output odt document gives null value on current page number. Please refer to code snippet images below and attached files.


cc.png (100.3 KB)
bb.png (137.2 KB)
aa.png (246.7 KB)

Hi @accesssoft
I checked your jrxml file and find $V{PAGE_NUMBER} and $V{PAGE} field.
But AW for JasperReport create and set $V{PAGE} and $V{NUMPAGES} field.
It means that your $V{PAGE_NUMBER} field has null value.

Currently JASPER REPORT cannot recognize the number of changes in $V{PAGE} and $NUMPAGES}

I’m adding two variables now, PAGE and NUMPAGES , but they all show as NULL

Hi @accesssoft

I find working expression from our tests
<textFieldExpression><![CDATA["Page {PAGE} of {NUMPAGES}"]]></textFieldExpression>

It means that you can replace $V{PAGE_NUMBER} to {NUMPAGES} and $V{PAGE} to {PAGE}
It doesn’t require adding variables

Stack Trace:

org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'text'. 
One of '{"http://jasperreports.sourceforge.net/jasperreports":textFieldExpression, 
"http://jasperreports.sourceforge.net/jasperreports":hyperlinkParameter}' is expected.


it shows error.

Hi @accesssoft

For printing Page number please use static text and delete unused Page variable,

	<reportElement x="686" y="60" width="24" height="17"/>
	<textElement textAlignment="Center" verticalAlignment="Middle">
		<font fontName="標楷體" size="12"/>

In previous cases PAGE_NUMBER is printed right. You can use the old text field with $V{PAGE_NUMBER} or static text with {NUMPAGES}