I'm trying to lock a column/cell in an excel sheet that is created from Jasper iReport, because our client doesn't want the user to be able to update the formula. I haven't been able to find much on this.
I added the locked property that I found in the config reference (http://jasperreports.sourceforge.net/config.reference.html#net.sf.jasperreports.export.xls.cell.locked), although it does not prevent the cells in the column from being edited on the exported sheet.
<jr:column width="100">
<jr:detailCell style="table" height="20" rowSpan="1">
<textField>
<reportElement style="table" x="0" y="0" width="100" height="20">
<property name="net.sf.jasperreports.export.xls.formula" value="INDIRECT(ADDRESS(ROW(),4))"/>
<property name="net.sf.jasperreports.export.xls.cell.locked" value="true"/>
</reportElement>
</textField>
</jr:detailCell>
</jr:column>
The config reference also says the setting "only has effect if the enclosing sheet is protected". I added a password to the sheet with the password property, but this causes the entire sheet to be protected.
<property name="net.sf.jasperreports.export.xls.password" value="password" />
With the whole sheet protected, I tried adding the locked property set to false for the fields that need to be updatable. But I still couldn't update them since the entire sheet was protected.
Any ideas on how to protect some cells or columns and not others?