We have a document that needs the page footer only on the first page (the banner of the institution) and the page header at the second page (here the page number).
For the page header I set in the band properties the “Print when Expression”-Property with the following expression: $V{PAGE_NUMBER} > 1 and it works fine.
For the page footer I set the expression: $V{PAGE_NUMBER} == 1 but the footer is on each page. I also tried $V{PAGE_NUMBER} < 2 with the same reason. What’s going wrong???
- Please supply us with the Jrxml files along with xml/csv data source
- Please supply us with the .jrprint file of your jrxml
- Please supply us with the code from your application.
- Please attach the output document that shows the undesired behavior.
- Please share to which file format you are exporting your Jrxml file
As soon as you get these pieces of information to us we'll start our investigation into your issue.
Now I saw, that the page header is also on the first page. I took a look at the wrong place.
So the page header and the footer work in a wrong way.
We need:
Page header at the second page and ff.
Page footer only at the first page.
We create the worddokument from an internet application. This application is realised with intrexx
In Intrexx is a groovy-script that calls a function from the groovy-script in the zip-file.
We use iReport 5.0.1
[quote user=“tahir.manzoor”]
But the header also doesn’t work correct!!! On the first page is on top in the left corner the page number. That’s wrong. The page number should begin at page two.
here is a screenshot of my document
Good morning,
i changed the aspose.word.jasperreports-jar. We work with iReport 5.1.0 so i took the 5.5.0-jar
but the problem is the same. Page number always at page 1 and page footer at every page
- I have created the jrprint file using iReport 5.1.0 and exported it to Docx with no issue. Please check the attached jrprint file
- I have exported the shared jrxml to Docx and have not found the page number issue. Please check the attached Out.docx.
Please make sure that you are using latest version of Aspose.Words for JasperReports 2.0.0.
JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, new HashMap(), new JREmptyDataSource());
AWDocxExporter exporter = new AWDocxExporter();
exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
exporter.setParameter(AWExporterParameter.RECOGNIZE_FIELDS, true);
exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, "C:\\out.docx");
exporter.exportReport();
Hi,
here are the parameters we use in our file:
case “docx”:
reportDatei += “docx”
//JRDocxExporter exporter = new JRDocxExporter()
//exporter.setParameter(JRDocxExporter.JASPER_PRINT, jasperPrint)
//exporter.setParameter(JRDocxExporter.OUTPUT_FILE_NAME, reportDatei)
AWDocxExporter exporter = new AWDocxExporter()
exporter.setParameter(AWExporterParameter.LICENSE, “Aspose.Words.JasperReports.lic”);
//so war muss es sein
exporter.setParameter(AWExporterParameter.PAGE_BREAKS, AWExporterParameter.PAGE_BREAKS_NONE);
//ohne Angabe ist dann default - Section Page
//hiermit normal
//exporter.setParameter(AWExporterParameter.PAGE_BREAKS, AWExporterParameter.PAGE_BREAKS_NORMAL);
exporter.setParameter(AWExporterParameter.RECOGNIZE_FIELDS, true);
exporter.setParameter(AWExporterParameter.USE_EXACT_ROW_HEIGHTS, false);
exporter.setParameter(AWExporterParameter.OUTPUT_FILE_NAME, reportDatei)
exporter.setParameter(AWExporterParameter.JASPER_PRINT, jasperPrint)
exporter.exportReport()
break
I put the file in the attachment. The Aspose.Words.jasperreports-5.5.0.jar is from 22.12.2013 I think that is the actual one.
Hi there,
Thanks for sharing the detail. Please use the page break parameter as PAGE_BREAKS_SECTIONS to get the required output. This will fix the issue which you are facing. Please let us know if you have any more queries.
exporter.setParameter(AWExporterParameter.PAGE_BREAKS, AWExporterParameter.PAGE_BREAKS_SECTIONS);
With this parameter, there are undefind page breaks in the document. So we changed it to PAGE_BREAK_NONE and the page breaks work fine but the footer and the header work in the wrong way (footer only fist page, header at page 2 on every page))
Hi Procurement,
Thanks for sharing the detail. I have logged this problem in our issue tracking system as follow:
WORDSJSP-143 : AWExporterParameter.PAGE_BREAKS_NONE does not work with expression [$V{PAGE_NUMBER} > 1]
I have linked this forum thread to the same issue and you will be notified via this forum thread once this issue is resolved. We apologize for your inconvenience.