CAROS,
Estive alterando um codigo java porém ele nao esta compilando novamente.Eu mudei uma linha do codigo ,porem ele executa como se fosse a outra q tava antes
Ex: no codigo abaixo.
e no .jsp ele funcionou normalmente. porem no .java e simplismente nao funciona… é como se o codigo nao fosse alterado.
e dou restart and debug normalmente.
Acredito que seja erro do eclipse… sei lah… quem souber me ajudar agradeço.
[code]public class DownloadReportAtivacao extends TTSAPServletBase
{
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException {
try {
response.setContentType(“application/vnd.ms-excel”);
response.setHeader(“Content-disposition”, “attachment; filename=Trouble Tickets - TTSAP.xls”);
String dateBegin = request.getParameter("dateBegin");
String dateEnd = request.getParameter("dateEnd");
String status = request.getParameter("status") ;
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet sheet = wb.createSheet("TT");
Vector tts = null;
if(!dateBegin.equals("") && !dateEnd.equals("")){
tts = TTSobressalente.ejbfindByDate(dateBegin, dateEnd, status);
}
SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
if (tts != null) {
HSSFCellStyle cs = wb.createCellStyle();
HSSFRow row = sheet.createRow((short)0);
// Create a cell and put a value in it.
HSSFCell cell = row.createCell((short)0);
// Or do it on one line.
row.createCell((short)0).setCellValue("TT.");
/*
codigo
*/
row.createCell((short)16).setCellValue("Data finalização do TT pela Cidade");
String statusAux = "";
for (int i = 0; i < tts.size(); i++) {
TTSobressalente ttsap = (TTSobressalente) tts.get(i);
if(ttsap.getTTStatus().equals("0"))
statusAux = "PENDENTE";
else if(ttsap.getTTStatus().equals("1"))
statusAux = "APROVADO";
else
statusAux = "REPROVADO";
// Create a row and put some cells in it. Rows are 0 based.
row = sheet.createRow((short)i+1);
// Create a cell and put a value in it.
cell = row.createCell((short)0);
// Or do it on one line.
row.createCell((short)0).setCellValue(ttsap.getTTOSInstalacao()); // ALTEREI ESTA LINHA
//row.createCell((short)0).setCellValue(ttsap.getTTSolicitacao()); // MAS AINDA FICA ESSA
row.createCell((short)1).setCellValue(ttsap.getTTCidade());
row.createCell((short)2).setCellValue(ttsap.getTTDataSolicitacao()!=null?dateFormat.format(ttsap.getTTDataSolicitacao()):"");
row.createCell((short)3).setCellValue(ttsap.getTTDataAlteracao()!=null?dateFormat.format(ttsap.getTTDataAlteracao()):"");
row.createCell((short)4).setCellValue(ttsap.getTTPecCode()!=null?ttsap.getTTPecCode():"");
row.createCell((short)5).setCellValue(ttsap.getTTDocSapPn()!=null?ttsap.getTTDocSapPn():"");
row.createCell((short)6).setCellValue(ttsap.getTTDataDocSapPn()!=null?dateFormat.format(ttsap.getTTDataDocSapPn()):"");
row.createCell((short)7).setCellValue(ttsap.getTTDocSapPa()!=null?ttsap.getTTDocSapPa():"");
row.createCell((short)8).setCellValue(ttsap.getTTDataDocSapPa()!=null?dateFormat.format(ttsap.getTTDataDocSapPa()):"");
row.createCell((short)9).setCellValue(ttsap.getTTNumSerieNova()!=null?ttsap.getTTNumSerieNova():"");
row.createCell((short)10).setCellValue(ttsap.getTTNumSerie()!=null?ttsap.getTTNumSerie():"");
row.createCell((short)11).setCellValue(ttsap.getTTDefeito()!=null?ttsap.getTTDefeito():"");
row.createCell((short)12).setCellValue(ttsap.getTTNumNF()!=null?ttsap.getTTNumNF():"");
row.createCell((short)13).setCellValue(statusAux!=null?statusAux:"");
row.createCell((short)14).setCellValue(ttsap.getTTMotivoReprocacao()!=null?ttsap.getTTMotivoReprocacao():"");
if(ttsap.getTTDocSapStatus().equals("0")){
row.createCell((short)15).setCellValue(ttsap.getTTDocSapLogin()!=null?ttsap.getTTDocSapLogin():"");
row.createCell((short)16).setCellValue(ttsap.getTTDataFinalizaDocSap()!=null?dateFormat.format(ttsap.getTTDataFinalizaDocSap()):"");
}else{
row.createCell((short)15).setCellValue(ttsap.getTTDocSapLogin()!=null?ttsap.getTTDocSapLogin():"");
row.createCell((short)16).setCellValue(ttsap.getTTDataFinalizaDocSap()!=null?dateFormat.format(ttsap.getTTDataFinalizaDocSap()):"");
}
}
OutputStream out = response.getOutputStream();
wb.write(out);
out.close();
}
} catch (Exception e) {
e.printStackTrace();
forward("/erro.jsp", request, response);
}
}
}[/code]