Aggiorna QueryTable di Excel usando Java

This quick guide explains the process for working with a Excel query table using Java. It will provide the details to configure the IDE, a list of steps, and a code example to modify the QueryTable connection using Java. You will learn how to customize the QueryTable in an Excel file and also how to modify external connections using the exposed API calls.

Passaggi per aggiornare la QueryTable di Excel usando Java

  1. Set the IDE to use Aspose.Cells for Java to work with QueryTable
  2. Load the source Excel file, access the destination sheet, and verify the existence of query tables.
  3. Access the first query table and print the data from the query table.
  4. Check the external connection in the query table and view its characteristics.
  5. Modify the parameters of the query table and the external connection.
  6. Salva il file Excel aggiornato
  7. Reload the file and check the modified parameters in the query table and in the external connections.

These steps summarize the process to update external data connection using Java in an Excel file. Load the Excel file, access the target sheet, retrieve the collection of query tables, and display the data of the first query table. Customize the QueryTable and the external connection within it, and save the workbook.

Code to modify Excel’s external data connection using Java.

This code has demonstrated how to work with the Excel QueryTable. If you want to observe how the data is displayed after the update, you can use the getAutoReformat() and getFillAdjacentFormulas() methods. I metodi setPreserveFormatting() e setAdjustColumnWidth() dovrebbero essere usati in combinazione, poiché questi preservano la formattazione mentre l’auto‑regolazione delle colonne può produrre risultati conflittuali.

This article guided us on how to work with the QueryTable and its external connection. To create subtotals in an Excel file, refer to the article Creating subtotals in Excel using Java.

 Italiano