Context context = Contexts.getConversationContext();
Project project = (Project) context.get("project");
try {
ActivityViewListService activityViewListService = (ActivityViewListService) Component
.getInstance("activityViewListService");
response.setContentType("application/gantt");
response.setCharacterEncoding("UTF-8");
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
String fileName = format.format(Calendar.getInstance().getTime())
+ "_PEST_Project_" + project.getId() + ".gan";
response.setHeader("Content-Disposition", "attachment; filename=\""
+ fileName + "\"");
PrintWriter printWriter = response.getWriter();
activityViewListService.writeGantt(printWriter);
printWriter.close();
} catch (Exception e) {
System.out.println("exception....");
e.printStackTrace();