Crear rango de unión
Crear rango de unión
Aspose.Cells permite crear un rango de unión usando el método WorksheetCollection.CreateUnionRange. El método WorksheetCollection.CreateUnionRange acepta dos parámetros, la dirección para crear el rango de unión y el índice de la hoja de trabajo. El método devuelve un objeto UnionRange.
El siguiente fragmento de código demuestra cómo crear un rango de unión usando el método WorksheetCollection.CreateUnionRange. El archivo de salida generado por el código está adjunto como referencia.
// 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"); |