Crea un intervallo di unione

Crea un intervallo di unione

Aspose.Cells fornisce la possibilità di creare un intervallo di unione utilizzando il metodo WorksheetCollection.CreateUnionRange. Il metodo WorksheetCollection.CreateUnionRange accetta due parametri, l’indirizzo per creare l’intervallo di unione e l’indice del foglio di lavoro. Il metodo WorksheetCollection.CreateUnionRange restituisce un oggetto UnionRange.

Il seguente frammento di codice mostra come creare un Intervallo di Unione utilizzando il metodo WorksheetCollection.CreateUnionRange. Il file di output generato dal codice è allegato per riferimento.

// 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");