Buggy code:
titleRowHdrArt . createCell ( ( ( short ) ( count ++ ) ) ) . setCellValue ( new HSSFRichTextString ( "Serial<seq2seq4repair_space>No" ) ) ; xlsSheetArt . setColumnWidth ( ( ( short ) ( count ) ) , ( ( short ) ( 7000 ) ) ) ; titleRowHdrArt . createCell ( ( ( short ) ( count ++ ) ) ) . setCellValue ( new HSSFRichTextString ( "JIRA<seq2seq4repair_space>ID" ) ) ; xlsSheetArt . setColumnWidth ( ( ( short ) ( count ) ) , ( ( short ) ( 15000 ) ) ) ; titleRowHdrArt . createCell ( ( ( short ) ( count ++ ) ) ) . setCellValue ( new HSSFRichTextString ( "JIRA<seq2seq4repair_space>Description" ) ) ; xlsSheetArt . setColumnWidth ( ( ( short ) ( count ) ) , ( ( short ) ( 8000 ) ) ) ; titleRowHdrArt . createCell ( ( ( short ) ( count ++ ) ) ) . setCellValue ( new HSSFRichTextString ( "Priority" ) ) ; xlsSheetArt . setColumnWidth ( ( ( short ) ( count ) ) , ( ( short ) ( 15000 ) ) ) ; titleRowHdrArt . createCell ( ( ( short ) ( count ++ ) ) ) . setCellValue ( new HSSFRichTextString ( "Status" ) ) ; System . out . println ( "\n\n##Generating<seq2seq4repair_space>Task<seq2seq4repair_space>Details##\n\n" ) ; preparedStatement = connection . prepareStatement ( ( ( "select<seq2seq4repair_space>task_id,<seq2seq4repair_space>data<seq2seq4repair_space>from<seq2seq4repair_space>resource_progress_proj<seq2seq4repair_space>where<seq2seq4repair_space>start_dt<seq2seq4repair_space>IN<seq2seq4repair_space>('" + ( req . getParameter ( "daterangeIn" ) . replaceAll ( "#" , "'" ) ) ) + ")<seq2seq4repair_space>group<seq2seq4repair_space>by<seq2seq4repair_space>task_id" ) ) ; resultSet = preparedStatement . executeQuery ( ) ; users = new ArrayList < String > ( ) ; Map mp = new HashMap ( ) ; while ( resultSet . next ( ) ) { HSSFRow dataRow1 = xlsSheetArt . createRow ( ( serialNumber ++ ) ) ; count = 0 ; dataRow1 . createCell ( ( ( short ) ( count ++ ) ) ) . setCellValue ( ( serialNumber - 1 ) ) ; dataRow1 . createCell ( ( ( short ) ( count ++ ) ) ) . setCellValue ( resultSet . getString ( "task_id" ) ) ; dataRow1 . createCell ( ( ( short ) ( count ++ ) ) ) . setCellValue ( resultSet . getString ( "data" ) ) ; List jiraData = User . getJIRADATA ( req , res , resultSet . getString ( "task_id" ) ) ; dataRow1 . createCell ( ( ( short ) ( count ++ ) ) ) . setCellValue ( ( ( String ) ( jiraData . get ( 0 ) ) ) ) ; dataRow1 . createCell ( ( ( short ) ( count ++ ) ) ) . setCellValue ( ( ( String ) ( jiraData . get ( 1 ) ) ) ) ; System . out . println ( ( "\nReport<seq2seq4repair_space>Generated<seq2seq4repair_space>for<seq2seq4repair_space>" + ( resultSet . getString ( "task_id" ) ) ) ) ; mp . put ( ( ( String ) ( jiraData . get ( 0 ) ) ) , ( ( ( mp . get ( ( ( String ) ( jiraData . get ( 0 ) ) ) ) ) == null ? 0 : Integer . parseInt ( mp . get ( ( ( String ) ( jiraData . get ( 0 ) ) ) ) . toString ( ) ) ) + 1 ) ) ; mp . put ( ( ( String ) ( jiraData . get ( 1 ) ) ) , ( ( ( mp . get ( ( ( String ) ( jiraData . get ( 1 ) ) ) ) ) == null ? 0 : Integer . parseInt ( mp . get ( ( ( String ) ( jiraData . get ( 1 ) ) ) ) . toString ( ) ) ) + 1 ) ) ; } if ( resultSet != null ) resultSet . close ( ) ; if ( preparedStatement != null ) preparedStatement . close ( ) ; serialNumber = 1 ; xlsSheetArt = xlsWorkbook . createSheet ( "Task<seq2seq4repair_space>Summary" ) ; titleRowHdrArt = xlsSheetArt . createRow ( 0 ) ; titleRowHdrArt . setHeight ( ( ( short ) ( 350 ) ) ) ; count = 0 ; xlsSheetArt . setColumnWidth ( ( ( short ) ( count ) ) , ( ( short ) ( 8000 ) ) ) ; titleRowHdrArt . createCell ( ( ( short ) ( count ++ ) ) ) . setCellValue ( new HSSFRichTextString ( "Type" ) ) ; xlsSheetArt . setColumnWidth ( ( ( short ) ( count ) ) , ( ( short ) ( 5000 ) ) ) ; titleRowHdrArt . createCell ( ( ( short ) ( count ++ ) ) ) . setCellValue ( new HSSFRichTextString ( "Count" ) ) ; Iterator it = mp . entrySet ( ) . iterator ( ) ; while ( it . hasNext ( ) ) { Map . Entry pairs = ( ( Map . Entry ) ( it . next ( ) ) ) ; HSSFRow dataRow1 = xlsSheetArt . createRow ( ( serialNumber ++ ) ) ; count = 0 ; <START_BUG> dataRow1 . createCell ( ( ( short ) ( count ++ ) ) ) . setCellValue ( Integer . parseInt ( pairs . getKey ( ) . toString ( ) ) ) ; <END_BUG> dataRow1 . createCell ( ( ( short ) ( count ++ ) ) ) . setCellValue ( Integer . parseInt ( pairs . getValue ( ) . toString ( ) ) ) ; System . out . println ( ( ( ( pairs . getKey ( ) ) + "<seq2seq4repair_space>=<seq2seq4repair_space>" ) + ( pairs . getValue ( ) ) ) ) ; it . remove ( ) ; } xlsWorkbook . write ( new FileOutputStream ( filePath ) ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } return filePath ; } No newline ; at end ; of file ; }

Fix:
dataRow1 . createCell ( ( ( short ) ( count ++ ) ) ) . setCellValue ( ( ( String ) ( pairs . getKey ( ) ) ) ) ;