Bug 200751 NPE in Excel emitter
writer.text( ( (Data) d ).txt.toString( ) ); SEVERE: An error happened while running the report. Cause: java.lang.NullPointerException at org.eclipse.birt.report.engine.emitter.excel.ExcelWriter.writeText(Ex celWriter.java:102) at org.eclipse.birt.report.engine.emitter.excel.ExcelWriter.writeTxtData (ExcelWriter.java:152) at org.eclipse.birt.report.engine.emitter.excel.ExcelEmitter.outputData( ExcelEmitter.java:311) at org.eclipse.birt.report.engine.emitter.excel.ExcelEmitter.end(ExcelEm itter.java:286) at org.eclipse.birt.report.engine.api.impl.RenderTask$PageRangeRender.re nder(RenderTask.java:593) at org.eclipse.birt.report.engine.api.impl.RenderTask.render(RenderTask. java:260)
engine/org.eclipse.birt.report.engine.emitter.prototype.excel/src/org/eclipse/birt/report/engine/emitter/excel/ExcelUtil.java
{
       
		SimpleDateFormat dateFormat = new SimpleDateFormat(
				"yyyy-MM-dd'T'HH:mm:ss" );
		return  dateFormat.format( (Date) date );
        
	}
	public static String getPattern(Object data, String val)
    {
    	if(val != null && data instanceof Date) {
    	   if (val.indexOf( "kk:mm" ) >= 0){
    		   return "Short Time";	   
    	   }
    	   else if(val.startsWith( "ahh" ))
    	   {
    		   return "Long Time";   
    	   }
    	   else if(!val.startsWith( "ahh" ) && val.indexOf( "ahh" ) >= 0)
    	   {
    	      return "General Date";	   
    	   }
    	   return new DateFormatter(val).getPattern( );
    	}
    	else if(val == null && data instanceof Time) {
    		return "Long Time";
    	}
    	else if(val == null && data instanceof java.sql.Date) 
    	{
    		return "yyyy-M-d";
    	}