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
Just Curious: When has an...
by
Mr.Madguy
[
Today
at 08:55:57 am]
Option "RemoveExpressionR...
by
bytebites
[
Today
at 08:44:51 am]
Here is almost full list ...
by
Thaddy
[
Today
at 08:31:03 am]
Why VirtualDBTreeEx not c...
by
Zvoni
[
Today
at 08:28:04 am]
TImageList.draw is not dr...
by
daniel_sap
[
Today
at 07:51:31 am]
Lazarus is not working
by
Amir61
[
Today
at 06:57:42 am]
(solved)how to define cor...
by
joguenco
[March 27, 2025, 10:57:58 pm]
Rudimentary Lunar Lander
by
TBMan
[March 27, 2025, 09:23:18 pm]
Rotating text in BGRA
by
DomingoGP
[March 27, 2025, 09:12:01 pm]
"database not open" - IBX...
by
rvk
[March 27, 2025, 08:22:58 pm]
Lazarus Release Candidate...
by
zeljko
[March 27, 2025, 07:45:17 pm]
Fpcupdeluxe
by
Hartmut
[March 27, 2025, 07:32:02 pm]
divide a Unit to several ...
by
TRon
[March 27, 2025, 05:28:34 pm]
How to delete from app il...
by
d2010
[March 27, 2025, 04:14:05 pm]
PasGame a easy to use gam...
by
hanisoftwares
[March 27, 2025, 04:01:37 pm]
Laz mupdf (SumatraPDF loa...
by
domasz
[March 27, 2025, 03:38:54 pm]
[Solved]I'm puzzled and b...
by
tetrastes
[March 27, 2025, 03:37:01 pm]
ParambyName - how to stri...
by
tonyw
[March 27, 2025, 11:13:14 am]
Weird error: component no...
by
Thaddy
[March 27, 2025, 10:47:09 am]
Correct events to restore...
by
anse
[March 27, 2025, 09:51:51 am]
basic question for good s...
by
cdbc
[March 27, 2025, 09:50:53 am]
Programmatically trigger ...
by
Khrys
[March 27, 2025, 07:45:11 am]
/lib/x86_64-linux-gnu/lib...
by
TRon
[March 27, 2025, 07:42:00 am]
Converting a Project from...
by
egsuh
[March 27, 2025, 03:51:07 am]
TSynEdit XML tag completi...
by
dsiders
[March 26, 2025, 11:57:47 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: [Solved] - Problem saving a grid as Excel Format (Read 1401 times)
zxandris
Full Member
Posts: 152
[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: 12708
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: 152
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: 12708
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: 152
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: 12708
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: 152
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