Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
Packages and Libraries
»
FPSpreadsheet
»
[SOLVED] FrozenRow/Col in TsWorksheet
Free Pascal
Website
Downloads
Wiki
Documentation
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Documentation (RTL/FCL/LCL)
Bugtracker
CCR Bugs
IRC channel
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
Столбец из CSV в CheckLis...
by
Red_prig
[
Today
at 08:40:50 am]
GetExceptionMask - Thread...
by
upsidasi
[
Today
at 08:33:55 am]
Mediators and Indexed Pro...
by
Weitentaaal
[
Today
at 07:57:22 am]
Noting responds when send...
by
Thaddy
[
Today
at 07:46:23 am]
Un-register an LCL Compon...
by
dbannon
[
Today
at 05:19:05 am]
TFPHTTPClient.Get(URL) / ...
by
dseligo
[
Today
at 05:03:08 am]
FPC Compiler Relocation B...
by
Coldzer0
[
Today
at 04:53:42 am]
AI cheetah
by
lainz
[
Today
at 03:17:28 am]
[SOLVED] Problems with ac...
by
Gercino
[
Today
at 01:04:30 am]
[SOLVED] TLabel OptimalFi...
by
Josh
[November 30, 2023, 11:43:45 pm]
Not able to add any compo...
by
andrew Bubble
[November 30, 2023, 11:41:01 pm]
Pascal script: Unable to ...
by
aducom
[November 30, 2023, 10:13:42 pm]
TProcess and lots of data...
by
marcov
[November 30, 2023, 10:12:58 pm]
Lazarus Release Candidate...
by
AlexTP
[November 30, 2023, 10:01:08 pm]
Anyone interested in test...
by
cpicanco
[November 30, 2023, 09:35:48 pm]
Titlebar custom color
by
domasz
[November 30, 2023, 09:31:14 pm]
Dynamical creation of obj...
by
peterbos
[November 30, 2023, 09:10:55 pm]
BGRABitmap - showcase -
by
circular
[November 30, 2023, 08:52:03 pm]
Better Vectorcall Support
by
Nitorami
[November 30, 2023, 08:38:46 pm]
Windows API and wide/unic...
by
Nadar
[November 30, 2023, 08:08:58 pm]
Out of memory on a ATtiny...
by
ccrause
[November 30, 2023, 07:16:29 pm]
What is the meaning of TF...
by
MarkMLl
[November 30, 2023, 06:32:25 pm]
[SOLVED]Bash commands and...
by
TRon
[November 30, 2023, 06:23:52 pm]
how to change color of a ...
by
Joanna
[November 30, 2023, 04:28:17 pm]
Help with barcode scannin...
by
Handoko
[November 30, 2023, 04:16:10 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: [SOLVED] FrozenRow/Col in TsWorksheet (Read 515 times)
totya
Hero Member
Posts: 720
[SOLVED] FrozenRow/Col in TsWorksheet
«
on:
February 13, 2023, 12:25:45 pm »
Hi!
As I see sWorksheetGrid support the FrozenRow/Col. Mean these lines/cols do not move when user scrolls.
I'd like if the TsWorksheet support it too (mainly Excel).
Thank you!
«
Last Edit: February 13, 2023, 01:50:48 pm by totya
»
Logged
wp
Hero Member
Posts: 11445
Re: FrozenRow/Col in TsWorksheet
«
Reply #1 on:
February 13, 2023, 01:25:29 pm »
Code: Pascal
[Select]
[+]
[-]
program
demo_frozen_rows_cols
;
uses
SysUtils
,
FPSpreadsheet
,
fpsTypes
,
xlsxOOXML
;
var
wb
:
TsWorkbook
;
ws
:
TsWorksheet
;
r
,
c
:
Integer
;
begin
wb
:
=
TsWorkbook
.
Create
;
try
ws
:
=
wb
.
AddWorksheet
(
'Sheet1'
)
;
// Fill worksheet with some data
for
r
:
=
0
to
100
do
for
c
:
=
0
to
10
do
ws
.
WriteText
(
r
,
c
,
Format
(
'R%d C%d'
,
[
r
,
c
]
)
)
;
// Prepare frozen columns and frozen rows
ws
.
LeftPaneWidth
:
=
1
;
// There should be 1 frozen column
ws
.
TopPaneHeight
:
=
2
;
// There should be 2 frozen rows
ws
.
Options
:
=
ws
.
Options
+
[
soHasFrozenPanes
]
;
// Activate this feature.
// Save to file
wb
.
WriteToFile
(
'test.xlsx'
,
true
)
;
finally
wb
.
Free
;
end
;
end
.
Logged
totya
Hero Member
Posts: 720
Re: FrozenRow/Col in TsWorksheet
«
Reply #2 on:
February 13, 2023, 01:50:20 pm »
@wp Thank you for the answer, and for this sample demo! I tried it, it's working.
Logged
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
Packages and Libraries
»
FPSpreadsheet
»
[SOLVED] FrozenRow/Col in TsWorksheet
TinyPortal
© 2005-2018