Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
Packages and Libraries
»
FPSpreadsheet
»
[Solved] - Problem saving a grid as Excel Format
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
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
There is no port of TNetH...
by
myisjwj
[
Today
at 03:34:40 am]
[Solved]Is it possible fo...
by
myisjwj
[
Today
at 03:26:27 am]
GMP: multiple precision a...
by
Ed78z
[
Today
at 03:26:10 am]
Unexpected Project1 Form ...
by
dbannon
[
Today
at 02:21:50 am]
Broken Icon Display on ma...
by
circular
[
Today
at 02:15:01 am]
Searching for a safe alte...
by
dbannon
[
Today
at 02:07:03 am]
Class designer/editor
by
Aruna
[
Today
at 02:03:11 am]
Assigning result of a fun...
by
jamie
[
Today
at 12:41:20 am]
Any good tutorials for dg...
by
Mathias
[September 13, 2024, 11:00:55 pm]
Memory leak using TJPEGIm...
by
petevick
[September 13, 2024, 10:27:35 pm]
[SOLVED] How to "Jump To"...
by
RedOctober
[September 13, 2024, 09:52:28 pm]
How to use newer macOS SD...
by
Hansaplast
[September 13, 2024, 09:34:22 pm]
TryStrToFloat
by
BubikolRamios
[September 13, 2024, 08:56:18 pm]
programming with Lazarus
by
srvaldez
[September 13, 2024, 08:33:55 pm]
LED Multicolor Keyboard C...
by
MarkMLl
[September 13, 2024, 08:15:18 pm]
Effect of streaming in a ...
by
Thaddy
[September 13, 2024, 08:07:16 pm]
Browser User Agent & Frie...
by
Aruna
[September 13, 2024, 08:01:00 pm]
LazCAD – First Release!
by
maurog
[September 13, 2024, 07:13:54 pm]
Getting error: Undefined ...
by
DiegoF
[September 13, 2024, 05:22:21 pm]
Listview how to custom or...
by
VisualLab
[September 13, 2024, 05:06:37 pm]
Using synapse to send ema...
by
hamacker
[September 13, 2024, 03:50:53 pm]
Unable to Query the ODBC ...
by
Thaddy
[September 13, 2024, 03:43:31 pm]
MariaDB sold to Investor
by
dbannon
[September 13, 2024, 02:55:32 pm]
Lazarus always uses a 32 ...
by
Martin_fr
[September 13, 2024, 02:37:27 pm]
[Solved] Unable install l...
by
JohnnieK
[September 13, 2024, 09:12:35 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: [Solved] - Problem saving a grid as Excel Format (Read 914 times)
zxandris
Full Member
Posts: 101
[Solved] - Problem saving a grid as Excel Format
«
on:
August 03, 2024, 06:47:33 pm »
I am pretty sure I'm missing something obvious but I've got a grid which is built from a simple csv (Which I had to load myself) and I want to save it in Excel Format, or another in time.
Code: Pascal
[Select]
[+]
[-]
wsSheet
.
SaveToSpreadsheetFile
(
dlgExport
.
filename
,
sfExcel8
,
true
)
;
That's the code I'm using and I have
Code: Pascal
[Select]
[+]
[-]
fpspreadsheetgrid
,
fpspreadsheetctrls
,
fpsTypes
,
in the uses clause for the unit/form. Can anyone tell me what I'm doing wrong here please?
CJ
«
Last Edit: August 04, 2024, 08:22:05 am by zxandris
»
Logged
wp
Hero Member
Posts: 12288
Re: Problem saving a grid as Excel Format
«
Reply #1 on:
August 03, 2024, 10:22:06 pm »
What is the error? What type is wsSheet?
Logged
zxandris
Full Member
Posts: 101
Re: Problem saving a grid as Excel Format
«
Reply #2 on:
August 03, 2024, 10:23:59 pm »
Tried to write a spreadsheet using an unsupported format and wsSheet is a simple tsWorksheetGrid.
Logged
wp
Hero Member
Posts: 12288
Re: Problem saving a grid as Excel Format
«
Reply #3 on:
August 04, 2024, 08:11:21 am »
Did you add unit xlsBiff8 to "uses"? FPSpreadsheet has a modular structure, and for every file format the reader/writer unit must be listed, or you add "fpsAllFormats" to register all file formats.
Logged
zxandris
Full Member
Posts: 101
Re: Problem saving a grid as Excel Format
«
Reply #4 on:
August 04, 2024, 08:13:46 am »
Thank you very much that appears to have worked. It does actually say as a hint it's not used in the unit, but it makes it work anyway!
Logged
wp
Hero Member
Posts: 12288
Re: Problem saving a grid as Excel Format
«
Reply #5 on:
August 04, 2024, 08:18:03 am »
Yes, that's because your code does not explicitly call any reader/writer function (this is done internally). If you'd once decide to remove "unused units" be careful to keep your reader/writer unit.
Logged
zxandris
Full Member
Posts: 101
Re: Problem saving a grid as Excel Format
«
Reply #6 on:
August 04, 2024, 08:21:50 am »
Thanks for the tip!
Logged
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
Packages and Libraries
»
FPSpreadsheet
»
[Solved] - Problem saving a grid as Excel Format
TinyPortal
© 2005-2018