Hi,
I just got an nullpointen exception, when exporting a report to XLS...
here is the stacktrace:
java.lang.NullPointerException
*** Methoden-Stack ***
net.sf.jasperreports.engine.util.JRDataUtils.getLocaleCode (Zeile 44)
net.sf.jasperreports.engine.JRAbstractExporter.getNumberFormat (Zeile 1013)
net.sf.jasperreports.engine.JRAbstractExporter.getNumberCellValue (Zeile 935)
net.sf.jasperreports.engine.JRAbstractExporter.getTextValue (Zeile 843)
net.sf.jasperreports.engine.export.JRXlsExporter.createTextCell (Zeile 341)
net.sf.jasperreports.engine.export.JRXlsExporter.exportText (Zeile 332)
net.sf.jasperreports.engine.export.JRXlsAbstractExporter.exportPage (Zeile 545)
net.sf.jasperreports.engine.export.JRXlsAbstractExporter.exportReportToStream (Zeile 421)
net.sf.jasperreports.engine.export.JRXlsAbstractExporter.exportReport (Zeile 221)
I already searched the forum and the tracker and the sources... I think in JRDataUtils method "protected Locale getTextLocale(JRPrintText text)" the method shouldn't return NULL as this returnvalue is evalueted on other methods like getNumberFormat and getLocaleCode.
perhaps the method should better return the standard locale if it can't found one...
like this:
protected Locale getTextLocale(JRPrintText text)
{
String localeCode = text.getLocaleCode();
if (localeCode == null)
{
localeCode = jasperPrint.getLocaleCode();
}
return localeCode == null ? JRDataUtils.getLocale(Locale.getDefault()): JRDataUtils.getLocale(localeCode);
}
What do you think
regards from cloudy Germany
C-Box
Recommended Comments