Crear rango de unión
Contents
[
Hide
]
Crear rango de unión
Aspose.Cells ofrece la posibilidad de crear Union Range utilizando elWorksheetCollection.CreateUnionRange método. ÉlWorksheetCollection.CreateUnionRange El método acepta dos parámetros, la dirección para crear el rango de unión y el índice de la hoja de trabajo. ÉlWorksheetCollection.CreateUnionRange método devuelve unUnionRangeobjeto.
El siguiente fragmento de código demuestra la creación de un rango de unión utilizando elWorksheetCollection.CreateUnionRange método. El archivo de salida generado por el código se adjunta como referencia.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java | |
//Source directory | |
String sourceDir = Utils.Get_SourceDirectory(); | |
//Output directory | |
String outputDir = Utils.Get_OutputDirectory(); | |
// Instantiating a Workbook object | |
Workbook workbook = new Workbook(sourceDir + "SampleChangeTickLabelDirection.xlsx"); | |
Worksheet worksheet = workbook.getWorksheets().get(0); | |
// Load the chart from source worksheet | |
Chart chart = worksheet.getCharts().get(0); | |
chart.getCategoryAxis().getTickLabels().setDirectionType(ChartTextDirectionType.HORIZONTAL); | |
// Output the file | |
workbook.save(outputDir + "outputChangeTickLabelDirection.xlsx"); |