Hello i need help in following feature
Hi,
Hi. Thanks for your response, but provided code is not valid. In case, when formula will reference to another cell on current sheet (“in”) calculation this formula on sheet “out” will invalid.
Hi,
Hi,
Thanks for using Aspose.Cells.
We have evaluated this issue further and we are afraid, we would not support Cell.calculate(String formula) method as it is not a
good idea.
There is a solution to implement your need, please check the
following code.
Java
public static void main(String[] args) {
// TODO
Auto-generated method stub
try
{
String myDir =
“D:/Filetemp/”;
Workbook source = new
Workbook(“d:\Filetemp\test.xlsx”);
Workbook dest = new
Workbook(“d:\Filetemp\test.xlsx”);
CustomFunction
customFunction = new
CustomFunction(dest.getWorksheets().get(“out”).getCells());
source.calculateFormula(true,customFunction);
dest.save(“d:\Filetemp\dest.xlsx”);
}catch(Exception
e)
{
System.out.println(e.getMessage());
}
}
public class
CustomFunction implements ICustomFunction
{
Cells
outCells;
public CustomFunction(Cells outCells)
{
this.outCells = outCells;
}
public Object
calculateCustomFunction(String functionName, ArrayList paramsList, ArrayList
contextObjects)
{
if
(“USINPUT”.equals(functionName))
{
Cell cell =
(Cell)contextObjects.get(2);
outCells.get(cell.getRow(),
cell.getColumn()).putValue(paramsList.get(0));
}
return null;
}
}
Thanks for response. Yep, i already use customfunction for this.
Hi,
The issues you have found earlier (filed as ) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by MuzammilKhan