Jasper report page number can not convert into words

Hello
i have paid license and i am working on jasper report convert to words by apsose word.
i found my word file footer, no of page is correct but all the page no are fixed as
it is just a fixed text.
should i set the AWExporterParameter.RECOGNIZE_FIELDS, does it mean i need to print text “Page { PAGE } of { NUMPAGES }”? i can not since my jasper report still need to output pdf,
i just want aspose to convert my jasper report to words, no coding to control the no of page

please help, thanks

Hello

If you set AWExporterParameter.RECOGNIZE_FIELDS to true
then Aspose.Words can find { PAGE } or { NUMPAGES } field in report and replace it with actual field in model of document. It useful only then number of page in report and in word file are different.

You said that number of page is correct, it means that jasper report calculate right number of page and Aspose.Words use this like a fixed text.

If you need to change resulting word document, you can use Aspose.Words for Java.
It also can help to convert resulting word document to pdf.

I checked it is $V{page_number} in my report. So I need to add the property then aspire can export the correct no of page footer, right ? I will try it and increase if I add new page in the word too ? Thanks

Hi,

Jasper Report property like $V{page_number} work only inside Jasper Report and transformed to static text after convertation to docx.

if you write “Page { PAGE } of { NUMPAGES }” and use property AWExporterParameter.RECOGNIZE_FIELDS, it will replace text { PAGE } with MS.Word Page Field
This field will normally work if you add new page in the word too.

I totally not clear what u said.
U mean I need to hard code the word then aspose will do the no of page convention?

How about if I run the report I other places e.g. report server, it is just a fixed string ?

Our company uses Jasper report for application reporting, now want to use aspose word to export the report as word files. The report also need to export as pdf format.

We already found many Jasper report word conversion format issue

And is everyone no problem in the footer no of page?

Thanks

Or say my request as this: my application will generate Jasper report as pdf, now we want to use aspose word , we write an export jave function to export report as word. There is only one jasper report template .

I found the word file footer shows same no of page and that is the one in the first page.

What should I do to fix this issue , thanks

Hi

I find this issue in old discussion:

We have logged a feature request as WORDSJR-165 to convert $V{PAGE_NUMBER} to page field in output Word document.

Now this issue is postponed and looks impossible to implement.

I think that you can create jasper report template for exporting report as word.
In this template you can replace text field with $V{page_number} to static text with { PAGE }
https://docs.aspose.com/words/jasperreports/inserting-fields/

Hi, i tried to add a static field in my jasper report with value Page { PAGE } of { NUMPAGES }.
and applied the AWExporterParameter.RECOGNIZE_FIELDS.

but aspose can not convert correct, it is just a text Page { PAGE } of { NUMPAGES }.

please help me and list out again how to convert jasper report to word by aspose to show page no and no of page. it is a bit urgent.thanks.

Hi

How your field look in jrxml file?
On my side the working field looks like this:

<staticText>
	<reportElement x="0" y="0" width="43" height="82"/>
	<textElement textAlignment="Right">
		<font fontName="Times New Roman" size="12"/>
	</textElement>
	<text><![CDATA[{ PAGE } of { NUMPAGES }]]></text>
</staticText>

thanks and my side still not ok, i will check my side property setup works or not.

so i just need to add your field code in jasper report
and set Y for the RECOGNIZE_FIELDS to true , then page no and no of page should be fine, right?
thanks.

@jonesTsang Yes, you should use field codes and and set RECOGNIZE_FIELDS option.