Ciao Ragazzi,

sto sviluppando un applicativo che mi deve generare un documento excel tramite Java con librerie JXL. Premetto che non posso cambiare librerie.

Inserisco delle informazioni in questo documento excel, alcune formate da più caratteri che possono determinare necessario l'allargamento della cella(in altezza).

Ora è proprio questo che non riesco a fare, non sapendo a priori quali informazioni inserisco all'interno della cella come posso fare a determinare la l'altezza che deve avere?

Ho provato con la proprietà autoSize di Cellview ma non funziona, ho provato con la setRowHeight(anche se è deprecato) e con la setRowView, ma è tutto inutile.

Sapete qualche metodo per automatizzare l'altezza della cella in maniera automatica?(lasciando la lunghezza invariata sia bene inteso).

Grazie,
ciao.

Allego parte di codice cosi da farvi capire.

codice:
	
private void createContent(WritableSheet sheet) throws WriteException, RowsExceededException {
		String previousNation="";
		int riga=1;
		DBLink db=new DBLink();
		NationAndSite tmp, temp;
		for(int k=0; k<nations.size(); k++){
			WriteChooseData wn=(WriteChooseData)nations.get(k);
			LinkedList<NationAndSite>list= db.getNameAndCounter(wn.getCode(), wn.getCounter());
			for(int i=0; i<list.size(); i++){
				tmp=(NationAndSite)list.get(i);
				if(riga!=1){
					if(!previousNation.equalsIgnoreCase(tmp.getCode())){
						addLine(sheet, riga, "");
						riga++;
					}
				}
				
				addLabel(sheet, 0, riga, tmp.getCode(), true);
				addLabel(sheet, 1, riga, tmp.getDescription(), true);
				addNumber(sheet, 2, riga, tmp.getCounter(), true);
				addLabel(sheet, 3, riga, "", true);
				addLabel(sheet, 4, riga, "", true);
				addLabel(sheet, 5, riga, tmp.getLast_s().toString(), true);
				addLabel(sheet, 6, riga, wn.getMotive(), true);
				addLabel(sheet, 7, riga, wn.getActionDT_s().toString(), true);
				addLabel(sheet, 8, riga, wn.getAction(), true);
				riga++;
				LinkedList<NationAndSite> coll = db.getSiteDescription(wn.getCode(), wn.getCounter());
				for(int j=0; j<coll.size(); j++){
					temp=(NationAndSite)coll.get(j);
					addNumber(sheet, 2, riga, temp.getCounter(), false);
					addLabel(sheet, 3, riga, temp.getCode(), false);
					addLabel(sheet, 4, riga, temp.getDescription(), false);
					addLabel(sheet, 0, riga, "", false);
					addLabel(sheet, 1, riga, "", false);
					addLabel(sheet, 5, riga, "", false);
					addLabel(sheet, 6, riga, "", false);
					addLabel(sheet, 7, riga, "", false);
					addLabel(sheet, 8, riga, "", false);
					
					riga++;
				}
				
				//riga++;
				previousNation=tmp.getCode();
			}
			
		}
					
		db.closeDB();
		//addLabel(sheet, 2,1,"prova");
		//addLine(sheet, 3,"");
		return;
	}

	private void addLabel(WritableSheet sheet, int column, int row, String s, boolean title)
			throws WriteException, RowsExceededException {
		
		Label label;
		label = new Label(column, row, s, arial);
		sheet.addCell(label);
		CellView cv = new CellView();
		if(!title)
			cv.setSize(15*heightCell);	
		else{ 
			/******************PROBLEMA ???????**************/  
		}
		sheet.setRowView(row, cv);