Aspose.Cells 8.7.2 での公開 API 変更
APIの追加
デフォルト計算エンジンの拡張
Aspose.Cells API には強力な計算エンジンがあり、ほとんどすべての Microsoft Excel 関数を計算できます。さらに、Aspose.Cells API では、デフォルトの計算エンジンを拡張して、任意のアプリケーションのカスタム計算要件に適合させることができます。
Aspose.Cells for Java 8.7.2のリリースに伴い、次のAPIが追加されました。
- AbstractCalculationEngine クラス
- CalculationData クラス
- CalculationOptions.CustomEngine プロパティ
以下はシンプルな使用シナリオです。
Java
public class CustomEngine extends AbstractCalculationEngine
{
public void calculate(CalculationData data)
{
if(data.getFunctionName().toUpperCase().equals("SUM")==true)
{
double val = (double)data.getCalculatedValue();
val = val + 30;
data.setCalculatedValue(val);
}
}
}
TextBoxCollection用のオーバーロードされたインデクサを追加しました
Aspose.Cells for Java 8.7.2では、TextBoxCollectionクラスのオーバーロードされたインデクサが公開され、Stringとしてその名前を使用してTextBoxのインスタンスにアクセスするためのものです。
シンプルな使用シナリオは次のようになります。
Java
//Create an instance of Workbook
Workbook workbook = new Workbook();
//Access the first Worksheet from the collection
Worksheet sheet = workbook.getWorksheets().get(0);
//Add a TextBox to the collection
int idx = sheet.getTextBoxes().add(10, 10, 10, 10);
//Access the TextBox using its index
TextBox box = sheet.getTextBoxes().get(idx);
//Set the name for the TextBox
box.setName("MyTextBox");
//Access the same TextBox via its name
box = sheet.getTextBoxes().get("MyTextBox");