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
fphttpclient. set path op...
by
Warfley
[
Today
at 11:55:46 am]
FileOpenDialog crashes/fr...
by
Martin_fr
[
Today
at 11:55:36 am]
Changes in "Search Result...
by
Martin_fr
[
Today
at 11:44:20 am]
help exporting 2 data col...
by
wp
[
Today
at 11:30:29 am]
CRT unit kills Ctrl-C
by
MarkMLl
[
Today
at 11:23:54 am]
Actions and Reslts
by
wp
[
Today
at 11:13:35 am]
Does FPC uses any interme...
by
MarkMLl
[
Today
at 10:29:28 am]
How can I capture all key...
by
jcmontherock
[
Today
at 10:21:51 am]
How to make a T[Flow]Pane...
by
pleumann
[
Today
at 10:19:34 am]
(Solved) Hex2Dec, strange...
by
arneolav
[
Today
at 10:02:02 am]
Making a little chart app
by
phoenix27
[
Today
at 09:50:32 am]
any one knows how to set ...
by
TRon
[
Today
at 08:54:37 am]
Any way to intercept stdo...
by
TRon
[
Today
at 08:35:10 am]
help choosing laptop
by
Weiss
[
Today
at 08:15:57 am]
IInterface issues, compil...
by
WooBean
[
Today
at 07:59:51 am]
.cvd ClamAV database comp...
by
Onur2x
[
Today
at 03:47:26 am]
How to download a file fr...
by
maurobio
[
Today
at 02:04:49 am]
Best way to include lots ...
by
KodeZwerg
[June 04, 2023, 10:54:51 pm]
Are We Dead Yet?
by
SymbolicFrank
[June 04, 2023, 09:57:00 pm]
Working with the canvas o...
by
Jonax
[June 04, 2023, 05:31:27 pm]
ControlAtPos Behavior
by
Zoran
[June 04, 2023, 04:24:32 pm]
TDBGrid extended like Acc...
by
dsiders
[June 04, 2023, 03:49:48 pm]
Improvement of procedure ...
by
Martin_fr
[June 04, 2023, 03:20:51 pm]
How do I set these packag...
by
lazpas
[June 04, 2023, 01:30:01 pm]
general reference manual ...
by
simone
[June 04, 2023, 12:38:19 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: [SOLVED] FrozenRow/Col in TsWorksheet (Read 369 times)
totya
Hero Member
Posts: 719
[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: 10866
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: 719
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