JAVA setting the cell to an integer value

I’m using Aspose.Cells for Java evaluation with Coldfusion and keep getting the following error:


The selected method setValue was not found


Either there are no methods with the specified method name and argument
types, or the method setValue is overloaded with arguments types that
ColdFusion can’t decipher reliably. If this is a Java object and you
verified that the method exists, you may need to use the javacast
function to reduce ambiguity.

The code I am running inside of my tag is as follows and is failing at the line in bold:


descRow = 3;
descCol = “A”;

valueRow = 3;
valueCol = “B”;

for (i=1; i LTE ethnicity.recordcount; i=i+1){
ethn = JavaCast(“int”,ethnicity.NumIdea [I]);
cells.getCell(valueCol&valueRow).setValue(ethn);
cells.getCell(descCol&descRow).setValue(ethnicity.Short_DescIdea [I]);
descRow = descRow + 1;
valueRow = valueRow + 1;
}

If I change the data type of the JavaCast to “String” everything runs fine and the excel file gets created, it only fails when trying to set the data type to int.

Also, even when only do something similar to

//Adding a sample value to “A1” cell
cells.getCell(“A3”).setValue(50);

The value in the excel file is always entered as a string rather than a numerical value for computations. I am attempting to create charts but anytime I successfully create the document the chart does not get populated until I select all cells which make up the chart series and convert them to a number.

I’ve just installed the latest hot fix 1.7.5.0 for Java. Please advise.

Thanks,
Scott


Hi Scott,

Could you run the simple example of

?

If you want to auto converter a string value to a numberic value, please call the method Cell.setValue(String stringValue,true).