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
Fractal using Primes (and...
by
Boleeman
[
Today
at 03:56:46 am]
Class designer/editor
by
Aruna
[
Today
at 02:38:36 am]
libqt6pas and ChatGPT
by
Bogen85
[
Today
at 02:21:26 am]
TSynEdit: linefeeds and L...
by
Aruna
[
Today
at 02:20:09 am]
[SOLVED] Getting started ...
by
dbannon
[
Today
at 02:16:27 am]
Broken Icon Display on ma...
by
lainz
[September 14, 2024, 10:54:02 pm]
C++ conversion : what is ...
by
jamie
[September 14, 2024, 09:42:17 pm]
New Swagger/OpenAPI Clien...
by
vfclists
[September 14, 2024, 09:16:18 pm]
Listview how to custom or...
by
zeljko
[September 14, 2024, 08:45:48 pm]
Extended Module Player
by
Gigatron
[September 14, 2024, 07:57:58 pm]
How many levels of proced...
by
Bart
[September 14, 2024, 07:48:50 pm]
Assigning result of a fun...
by
Warfley
[September 14, 2024, 06:58:43 pm]
Dark Mode on macOS 14.6.1
by
carl_caulkett
[September 14, 2024, 06:07:47 pm]
Prevent collapsing item l...
by
jamie
[September 14, 2024, 05:39:58 pm]
JSON with SQLite. SELECT ...
by
strubri
[September 14, 2024, 05:25:13 pm]
Creating `.app`s on the M...
by
carl_caulkett
[September 14, 2024, 04:57:52 pm]
Searching for a safe alte...
by
dbannon
[September 14, 2024, 03:21:53 pm]
CAD program written in La...
by
zamtmn
[September 14, 2024, 02:02:21 pm]
[SOLVED] Cannot change la...
by
Guser979
[September 14, 2024, 01:40:45 pm]
programming with Lazarus
by
VisualLab
[September 14, 2024, 01:17:44 pm]
[SOLVED] Memory leak usin...
by
wp
[September 14, 2024, 12:56:43 pm]
[Solved]Is it possible fo...
by
Kays
[September 14, 2024, 11:38:41 am]
Lazarus always uses a 32 ...
by
Martin_fr
[September 14, 2024, 11:24:09 am]
LazCAD – First Release!
by
maurog
[September 14, 2024, 09:11:42 am]
Effect of streaming in a ...
by
Thaddy
[September 14, 2024, 07:37:26 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: [Solved] - Problem saving a grid as Excel Format (Read 938 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: 12293
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: 12293
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: 12293
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