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
Why MaxDouble does not eq...
by
marcov
[
Today
at 05:06:48 pm]
Ability to use the Win ke...
by
Martin_fr
[
Today
at 05:02:10 pm]
Ubuntu Mate / Laz 2.2.6 /...
by
ArtLogi
[
Today
at 04:56:36 pm]
Breakpoint in a procedure...
by
Joanna
[
Today
at 04:53:09 pm]
scrolling Tmemos simultan...
by
wizzwizz4
[
Today
at 04:49:06 pm]
About $ and Cents - Dbf L...
by
wp
[
Today
at 04:03:14 pm]
String in binary file
by
Dzandaa
[
Today
at 03:54:51 pm]
RDP viewer in Pascal
by
ArminLinder
[
Today
at 03:28:09 pm]
Chinese Fonts in fpPDF
by
paweld
[
Today
at 03:19:01 pm]
Making a plea :)
by
BrunoK
[
Today
at 03:12:03 pm]
Besides TForm is there a ...
by
vfclists
[
Today
at 03:11:15 pm]
Optional parameter in fun...
by
carl_caulkett
[
Today
at 02:23:52 pm]
FpcUpDeluxe seems to have...
by
cdbc
[
Today
at 02:12:15 pm]
Q Win SHBrowseForFolder A...
by
d7_2_laz
[
Today
at 01:32:07 pm]
Error printing to zebra p...
by
magleft
[
Today
at 01:07:15 pm]
Use mORMot2 to export PDF...
by
dbannon
[
Today
at 12:33:49 pm]
[Solved] Shell controls s...
by
d2010
[
Today
at 12:13:47 pm]
TPairSplitter control lea...
by
wp
[
Today
at 11:31:27 am]
Xtensa-freertos wiki
by
ccrause
[
Today
at 09:48:49 am]
Building FPC 3.2.2 on Deb...
by
MarkMLl
[
Today
at 09:27:48 am]
Win SHBrowseForFolder API...
by
d2010
[
Today
at 09:02:38 am]
Class helpers cannot have...
by
Thaddy
[
Today
at 08:51:02 am]
Not able to install "fpc-...
by
dbannon
[
Today
at 07:19:07 am]
[Solved] Package Laz_Syna...
by
Fibonacci
[
Today
at 03:40:50 am]
Reintroduce events and pr...
by
Joanna
[
Today
at 01:58:28 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: [Solved] - Problem saving a grid as Excel Format (Read 1058 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: 12354
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: 12354
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: 12354
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