Prevent Column Header to repeat itself every "page" when export to Xlsx

0

When I design the report in JasperSoft Studio, in the preview, the column header is repeated for every page, which is ok. If I change the format to XLSx, the same occurs, which is not ok.

When I deploy the report to JasperReports Server, the vizualization has repeated column header, which is ok, but when I export to XLSX, the file correctly has no repeated column headers.

If I user URL access to generate the report in JasperReportsServer, like this:

...flow.html?_flowId=viewReportFlow&reportUnit=/someReport&j_username=anonymousUser&j_password=&output=xlsx
The report has repeated columns headers, which is not ok.

So, what should I do to export to XLSX whithout repeating column headers? What JasperReports Server gui do to prevent this?

gustavofarias's picture
Joined: May 22 2012 - 7:10am
Last seen: 2 days 11 hours ago

3 Answers:

0

Have you already tried to set the XLS Export property at (main) jrxml-report ?

<property name="net.sf.jasperreports.export.xls.exclude.origin.band.1" value="columnHeader"/>

(just change it to xlsx for the newer Excel exporter)

Also the jasper-wiki has some nice articles concerning preparing "clean" Excel sheets... e.g. https://community.jaspersoft.com/wiki/xls-export-parameters-jasperreports-server#XLS_Export_Parameters

hth + regards

C-Box

C-Box's picture
1245
Joined: Jul 19 2006 - 5:58pm
Last seen: 13 hours 13 min ago
0

By setting "net.sf.jasperreports.export.xls.exclude.origin.band.1", the column header vanished even from first page in xls format.

Another solution is to put "print when" = PAGE == 1. But this prevents the header to show in other types of exports where it would be useful on every page. In fact it's easyer to put the headers in the Title band.

Anyway, thank you sir, I didn't know about the dozens of Advanced -> Misc -> Edit Properties. There are a lot of interesting properties very useful to excel exporting.

gustavofarias's picture
Joined: May 22 2012 - 7:10am
Last seen: 2 days 11 hours ago
0

Well I think you coud try to set this property also, to keep just the FIRST columnHeader but remove all FOLLOWING ones:

<property name="net.sf.jasperreports.export.xls.exclude.origin.keep.first.band.1" value="columnHeader"/>

hth + regards again

C-Box

C-Box's picture
1245
Joined: Jul 19 2006 - 5:58pm
Last seen: 13 hours 13 min ago
Feedback