Come controllare la visualizzazione del workbook
Possibili Scenari di Utilizzo
Quando hai bisogno di regolare la visualizzazione delle pagine di Excel, devi sapere come controllare ogni modulo, come le barre di scorrimento orizzontali e verticali, se nascondere i file Excel aperti e così via. Aspose.Cells offre questa funzionalità. Aspose.Cells fornisce le seguenti proprietà e metodi per aiutarti a raggiungere i tuoi obiettivi.
- WorkbookSettings.is_h_scroll_bar_visible
- WorkbookSettings.is_v_scroll_bar_visible
- WorkbookSettings.is_hidden
- WorkbookSettings.is_minimized
- WorkbookSettings.window_height
- WorkbookSettings.window_width
- WorkbookSettings.window_left
- WorkbookSettings.window_top
Come controllare la visualizzazione del workbook usando Aspose.Cells for .NET
Questo esempio mostra come:
- Crea un libro di lavoro.
- Aggiungi dati alle celle nel primo foglio di lavoro.
- Nascondere le barre di scorrimento orizzontali e verticali della visualizzazione del workbook.
from aspose.cells import Workbook | |
from aspose.pydrawing import Color | |
# Instantiating an Workbook object | |
workbook = Workbook() | |
# Obtaining the reference of the newly added worksheet | |
ws = workbook.worksheets[0] | |
cells = ws.cells | |
# Setting the value to the cells | |
cell = cells.get("A1") | |
cell.put_value("Fruit") | |
cell = cells.get("B1") | |
cell.put_value("Count") | |
cell = cells.get("C1") | |
cell.put_value("Price") | |
cell = cells.get("A2") | |
cell.put_value("Apple") | |
cell = cells.get("A3") | |
cell.put_value("Mango") | |
cell = cells.get("A4") | |
cell.put_value("Blackberry") | |
cell = cells.get("A5") | |
cell.put_value("Cherry") | |
cell = cells.get("B2") | |
cell.put_value(5) | |
cell = cells.get("B3") | |
cell.put_value(3) | |
cell = cells.get("B4") | |
cell.put_value(6) | |
cell = cells.get("B5") | |
cell.put_value(4) | |
cell = cells.get("C2") | |
cell.put_value(5) | |
cell = cells.get("C3") | |
cell.put_value(20) | |
cell = cells.get("C4") | |
cell.put_value(30) | |
cell = cells.get("C5") | |
cell.put_value(60) | |
cell = cells.get("E10") | |
temp = workbook.create_style() | |
temp.font.color = Color.red | |
cell.set_style(temp) | |
# Hide horizontal and vertical scrollbars | |
workbook.settings.is_h_scroll_bar_visible = False | |
workbook.settings.is_v_scroll_bar_visible = False | |
workbook.save("out.xlsx") |
Anteprima del file di risultato: