3 Replies Latest reply: Apr 9, 2013 1:27 AM by 1001654 RSS

    JExcelAPI Warning: Validation list exceeds maximum number of characters

    1001654
      Hi,
      I am working on a legacy application where Java 1.4 and JExcel API 2.6.9 (Java 1.4) are being used.
      I have to create an xls file which will have a dropdown list. This list will contain data from database.
      I am able to create the list but this list is not containing all the values from database.
      It is taking some values and truncating the rest.
      One warning message is coming: - *"Warning: Validation list exceeds maximum number of characters - truncating"*

      Is there any way to avoid this?
      Kindly let me know.

      My sample code is below: -
      *<%*
      *try {*
      *//response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8");*
      response.setContentType("application/vnd.ms-excel;charset=UTF-8");
      response.setHeader("Expires:","0");
      response.setHeader("Content-Disposition","attachment; filename=UserTemplate.xls");

      OutputStream os = response.getOutputStream();
      WritableWorkbook workbook = Workbook.createWorkbook(os);
      WritableSheet wSheet = workbook.createSheet("users", 0);


      WritableCellFeatures cellFeatures = new WritableCellFeatures();
      ArrayList al = new ArrayList();
      *for(int i=0;i<39;i++){*
      al.add("value"+i);
      *}*
      cellFeatures.setDataValidationList(al);
      Label checkLabel = new Label(0,0,(String)al.get(0));
      checkLabel.setCellFeatures(cellFeatures);
      wSheet.addCell(checkLabel);

      workbook.write();
      workbook.close();

      *} catch (Exception e) {*
      e.printStackTrace();
      *}*
      *%>*

      Thanks in advance