Excel VBA Range.FormulaLocal in Java

We are pleased to announce the release of Aspose.Cells for Java 17.12. This release includes many new features and enhancements along with some critical bug fixes that further improve the overall stability of the APIs. We also recommend our clients to use the powerful Aspose for Java APIs directly in their Maven Projects with simple configurations. Please check the release notes in order to get an idea about what is new and what has been fixed with this revision of Aspose.Cells for Java. Here is a look at the major features in this release.

Implement Cell.FormulaLocal similar to Excel VBA Range.FormulaLocal

Microsoft Excel formulas may have different names in different locales/regions or languages. For example, SUM function is called SUMME in German. Aspose.Cells cannot work with non-English function names. In Microsoft Excel VBA, there is Range.FormulaLocal property that returns the name of the function as per its language or region. Aspose.Cells also provides Cell.FormulaLocal property for this purpose. However, this property will only work when you will implement GlobalizationSettings.getLocalFunctionName(String standardName) method. For more detail, please see this article.

The following sample code explains how to implement GlobalizationSettings.getLocalFunctionName(String standardName) method.

//Implement GlobalizationSettings class
class GS extends GlobalizationSettings {

	public String getLocalFunctionName(String standardName)
	{
		//Change the SUM function name as per your needs.
		if(standardName.equals("SUM"))
		{
			return "UserFormulaLocal_SUM";				
		}
				
		//Change the AVERAGE function name as per your needs.
		if (standardName.equals("AVERAGE"))
		{
			return "UserFormulaLocal_AVERAGE";
		}

		return "";
	}//getLocalFunctionName
}//GS extends GlobalizationSettings

//-----------------------------------------
//-----------------------------------------

public void Run() throws Exception {

	//Create workbook
	Workbook wb = new Workbook();

	//Assign GlobalizationSettings implementation class
	wb.getSettings().setGlobalizationSettings(new GS());

	//Access first worksheet
	Worksheet ws = wb.getWorksheets().get(0);

	//Access some cell
	Cell cell = ws.getCells().get("C4");

	//Assign SUM formula and print its FormulaLocal
	cell.setFormula("SUM(A1:A2)");
	System.out.println("Formula Local: " + cell.getFormulaLocal());

	//Assign AVERAGE formula and print its FormulaLocal
	cell.setFormula("=AVERAGE(B1:B2, B5)");
	System.out.println("Formula Local: " + cell.getFormulaLocal());
} 

Render Office Add-Ins while converting Excel to Pdf

Aspose.Cells now supports to render MS Office Add-ins (in Excel files) in the output PDF. You do not need to use any special method or property to render Office Add-Ins in the output PDF. For more detail, please see this article.

Auto populate Smart Markers data to other worksheets if data is too large to handle in a single worksheet

Sometime, you want to auto populate smart marker data to other worksheets if it is too large. Suppose, your data source has 1500000 records. These are too many records for a single worksheet, then you can move the rest of the records to next worksheet. For more detail and sample code, please see this article.

Set the Shape type of Data labels of chart

You can change the shape type of data labels of the chart using the DataLabels.ShapeType property. It takes the value of DataLabelShapeType enumeration and changes the shape type of data labels accordingly. For more detail, please see this article.

Export worksheet CSS separately in output HTML

Aspose.Cells provides the feature to export worksheet CSS separately when you convert your Excel file to HTML file format. Please use HtmlSaveOptions.ExportWorksheetCSSSeparately property for this purpose and set it to true while saving Excel file to HTML format. For more detail on the feature, please see this article/document for your reference.

  • Export Worksheet CSS Separately in Output HTML

Prefix Table elements Styles with HtmlSaveOptions.TableCssId property

Aspose.Cells allows you to prefix table elements styles with HtmlSaveOptions.TableCssId property. For more detail, please see this article.

Aspose.Cells for Java Resources

The resources, you may need to accomplish your tasks: