Excel files: block scrolling

Forum dedicato ai programmatori di X# in lingua italiana – Italian language forum

Moderator: wriedmann

Post Reply
User avatar
Gfb22
Posts: 105
Joined: Sat Oct 08, 2022 7:43 pm
Location: Italy

Excel files: block scrolling

Post by Gfb22 »

Buongiorno a tutti.
Utilizzando la libreria XSharp.Tools.XlsxFile.dll messa a disposizione da #Wolfgang Riedmann e EPPlus.dll ho creato le mie procedure per importare ed esportare file DBF / XLSX.
Volevo chiedere se è possibile bloccare lo scorrimento delle prime righe del foglio XLSX una volta creato.
Cercando nel web ho trovato

Code: Select all

worksheet.View.FreezePanes(2, 1);
che non so come tradurre perché possa essere utilizzato con VO e con X#.
Non è essenziale ma sarebbe comunque utile.
Grazie!
gfb
ic2
Posts: 1798
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

Re: Excel files: block scrolling

Post by ic2 »

Hello Gian,

In my VO application I use a class IC2Excel (assigned to oiEx below) starting with code like this:

Code: Select all

SELF:oWorkbooks	:= SELF:oApplication:Workbooks
SELF:oWorkbook:=SELF:oWorkbooks:Add(1)
SELF:oSheets := SELF:oWorkbook:WorkSheets
SELF:oWorksheet := oSheets:[Item,1]
SELF:oWorksheet := SELF:oApplication:ActiveSheet 
// etc
Once assigned to oIEx the code below freezes one row. It's not the full code but I hope it is enough to help you use FreezePanes:

Code: Select all

oIEx:osheets:Add(,oIEx:oApplication:ActiveSheet)	// add tab
oIEx:oWorkSheet := oIEx:oApplication:ActiveSheet                               													
// ...

oIEx:oExcelWindow:SplitColumn := 0
oIEx:oExcelWindow:SplitRow:=1 // Or any value you like
oIEx:oExcelWindow:FreezePanes := TRUE
Dick
User avatar
wriedmann
Posts: 3644
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Re: Excel files: block scrolling

Post by wriedmann »

Ciao,
per poterlo usare in VO devo aggiungerlo nella libreria.
Sfortunatamente sono in Germania al X# Summit e posso guardarmelo solo dopo il mio ritorno.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
Gfb22
Posts: 105
Joined: Sat Oct 08, 2022 7:43 pm
Location: Italy

Re: Excel files: block scrolling

Post by Gfb22 »

Grazie Dick, grazie Wolfgang!
Wolfgang,
non ho fretta. Ho immaginato che saresti andato a Memmingen: un'ottima occasione per mantenere vivo questo importante progetto con questa comunità così diversa ma ...unita e creativa! :-)
gfb
gfb
User avatar
wriedmann
Posts: 3644
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Re: Excel files: block scrolling

Post by wriedmann »

Ciao Gian Ferruccio,
ho appena aggiunto due metodi FreezePanes( nRow, nCol ) e UnFreezePanes() alla classe IXlsxSheet, usabile sia da VO che da X#.
Il codice aggiornato si trova qui:
https://www.riedmann.it/download/XSharp ... sxFile.zip
trovabile dalla pagina
https://www.riedmann.it/verschiedenes_xsharp.php
Saluti
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
Gfb22
Posts: 105
Joined: Sat Oct 08, 2022 7:43 pm
Location: Italy

Re: Excel files: block scrolling

Post by Gfb22 »

Buongiorno Wolfgang.
Scaricato, copiato, compilato: in X# funziona tutto bene, in VO compila senza errori ma poi sembra non trovare il riferimento corretto.
XLSX-ErrVO.jpg
Cosa posso aver dimenticato?
Grazie
gfb
User avatar
wriedmann
Posts: 3644
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Re: Excel files: block scrolling

Post by wriedmann »

Ciao Gian Ferruccio,
hai copiato la DLL nella cartella del programma VO?
Sembra che ci sia la versione vecchia.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
Gfb22
Posts: 105
Joined: Sat Oct 08, 2022 7:43 pm
Location: Italy

Re: Excel files: block scrolling - Solved

Post by Gfb22 »

...GRAZIE:
era errato il riferimento nelle proprietà di VO (...path for EXE and DLL files).
Ora funziona tutto anche in VO.
:-)
gfb
gfb
Post Reply