I want to show date in text field in jasper report. I've kept expression class of that text field as "java.util.Date" because while exporting that date in excel I want to retain "format cells-category as Date or Custom type" instead of General. So that user can change date format if he wants. I don't want to use "java.text.DateFormat" because of the same above given reason. But I want to pass my date format as parameter to report and use that in report.
like pattern = "$P{myDateFormat}"
myDateFormat can be anything dd-MMM-yyy, dd/MM/yy or just anything given in java
But problem is, pattern property of textField does not take expression. I saw one bug closed for jasper which had same requirement see link. But don't know why it's not working.
http://community.jaspersoft.com/ireport-designer/issues/932
http://community.jaspersoft.com/jasperreports-library/issues/4905
Also read of patternExpression but it's not present in ireport.
Kindly tell me how to pass dynamic value to pattern.
2 Answers:
I think that the commnity wiki that I quote below would be helpful regarding your question:
http://community.jaspersoft.com/wiki/how-use-built-msg-function-apply-cu...
one more article,
http://community.jaspersoft.com/wiki/how-resource-bundlealternate-way-ge...
I found the answer from jaspersoft support:-
we can use patternExpression but it's not available in lower versions of iReport IDE so you need to compile and deploy jasper externally.
I think that the commnity wiki that I quote below would be helpful regarding your question:
http://community.jaspersoft.com/wiki/how-use-built-msg-function-apply-cu...
one more article,
http://community.jaspersoft.com/wiki/how-resource-bundlealternate-way-ge...