[#4341] - Display headers only on printing in Excel Fomat and locking the spreadsheet

Category:
Feature request
Priority:
Urgent
Status:
Assigned
Project: Severity:
Major
Resolution:
Reopened
Component: Reproducibility:
N/A
Assigned to:

REQUIREMENT 1:

While exporting the report to Excel format, we require the
Report headers needs to be displayed only on print preview and it should come only on printing the report.

In normal view it should not print the headers.

There is an option in POI to do this like,

HSSFHeader header = sheet.getHeader();
header.setCenter("XXX"); header.setLeft("YYY"); header.setRight("ZZZ");

expecting the similar property in jasper report tool iReport.

REQUIREMENT 2:

POI provides a way to protect the spreadsheet,
like HSSFSheet.protectSheet

similarly expecting a way to lock the spreadsheet to protect the data from being edited by user.

Note:

We need atleast a workaround for this.

thil2009's picture
Joined: Sep 16 2009 - 8:10am
Last seen: 13 years 6 months ago

4 Comments:

#1

The requirement no. 2 is already available for the Apache POI exporter.
In order to protect sheets you have either to set the JExcelApiExporterParameter.PASSWORD export parameter, or to set the net.sf.jasperreports.export.xls.password exporter hint within the jrxml file ( see here: http://jasperforge.org/uploads/publish/jasperreportswebsite/trunk/config... ).

For the requirement no. 1 we'll try to find a solution.

HTH,
sanda zaharia

#2

Concerning the req. no. 1:

the following custom properties at global/report level were added:

net.sf.jasperreports.export.xls.sheet.header.left
net.sf.jasperreports.export.xls.sheet.header.center
net.sf.jasperreports.export.xls.sheet.header.right

net.sf.jasperreports.export.xls.sheet.footer.left
net.sf.jasperreports.export.xls.sheet.footer.center
net.sf.jasperreports.export.xls.sheet.footer.right

One can use these properties to set the text content of left, center and right sides in the sheet header and/or footer.

Sources were committed on svn revision 3951.

#3

This fix is not working for Excel-2007 i.e. JRXlsxExporter

#4
  • Status:Feedback Requested» Assigned
Feedback