-
New Feature
-
Resolution: Done
-
Normal
-
8.5.2
-
None
-
Security Level: Jimmy
-
None
-
ZK 8.6.0 S2, ZK 8.6.1 S1
-
None
In the current implementation, ZK JasperReport exports are generated as FileInputStream and sent to the client using ZK org.zkoss.zk.au.http.AuDynaMediar. The AMedia is always generated with the file name "report."+format.
https://github.com/zkoss/zkcml/blob/master/zkex/src/org/zkoss/zkex/zul/Jasperreport.java#L565
https://github.com/zkoss/zk/blob/master/zk/src/org/zkoss/zk/au/http/AuDynaMediar.java
However, AuDynaMediar doesn't use the file name when a response is written to the client.
https://github.com/zkoss/zk/blob/master/zcommon/src/org/zkoss/util/media/AMedia.java
By adding the following, it would be possible to generate export files with a chosen file name.
1- In JasperReport, add a field for exportName (or similar).
2- In JasperReport, use the exportName + "." + format instead of "report."+format
3- In AuDynaMedia, use the media name as source name for the download if any.
for example:
if(media.getName() != null && ! media.getName().equals(""))
- relates to
-
ZK-3941 upgrade jasperreport for the latest japerreport version 6.5
- Closed