* * *

Author Topic: [ANN] fpspreadsheet v1.8  (Read 2087 times)

wp

  • Hero Member
  • *****
  • Posts: 3896
[ANN] fpspreadsheet v1.8
« on: March 02, 2017, 04:05:55 pm »
A new release version of fpspreadsheet, version 1.8, is available from sourceforge.net: https://sourceforge.net/projects/lazarus-ccr/files/FPSpreadsheet/fpspreadsheet-1.8.0.zip/download. The new version will also be offered by the Online Package Manager.

A lot a new features has accumulated during the previous release:
  • "Rich-text" formatting of label cells, i.e. assignment of different fonts to groups of characters within the cell text. For this purpose, HTML codes (such as <B>...</B>) can be embedded in the cell text to identify the parts with different font (--> TsWorksheet.WriteTextAsHTML).
  • Searching for cells with specified content in worksheet or workbook.
  • Support for reading and writing of HTML format
  • Support for writing of the ExcelXML format (Excel XP and 2003)
  • Ability to use user-provided file reader/writer classes to extend FPSpreadsheet to new file formats.
  • Readers and writers now support all the line styles of Excel8 and OOXML.
  • xls, xlsx and ods readers/writers now support the active worksheet and selected cell.
  • Ability to write to/read from the system's clipboard for copy & paste using the visual controls.
  • Support for print ranges and repeated header rows and columns in the Office applications.
  • Support for embedded images (currently only writing to xlsx and ods, no reading).
  • Improved compatibility of TsWorksheetGrid with TStringGrid (Cells[Col,Row] property). Standalone usage as an advanced StringGrid replacement.
  • Support for Right-to-left mode in TsWorksheetGrid. In addition to the system-wide RTL mode, there are also parameters BiDiMode in the Worksheet and cells allowing to controls text direction at worksheet and cell level individually, like in Excel or LibreOffice Calc.
  • Support of several measurement units for specification of column widths and row heights.
  • The library now supports localization using po files. Translations are welcome.
  • A Zoom factor can be read and written by the worksheet and is applied by the TsWorksheetGrid.
  • Support of column and row formats
  • Support of hidden worksheets (not applied by the TsWorksheetGrid)
Several incompatible changes were unavoidable - sorry for the inconvenience:
  • VirtualMode was changed in order to be able to treat worksheets of the same workbook differently. VirtualRowCount and VirtualColCount are now properties of the worksheet, and similarly, the event handler OnWriteCellData. In older versions, these properties had belonged to the workbook.
  • The worksheet methods ReadAsUTF8Text and WriteUTF8Text have been renamed to ReadAsText and WriteText, respectively. The old ones are still available and marked as deprecated; they will be removed in later versions.
  • The public properties of TsWorksheetGrid using a TRect as parameter were modified to use the Left, Top, Right, Bottom values separately.
  • The PageLayout is a class now, no longer a record. As a consequence, some array properties cannot be set directly any more, use the corresponding methods instead.
  • Most of the predefined color constants were marked as deprecated; only the basic EGA colors will remain.
  • Unit fpsNumFormatParser is integrated in fpsNumFormat. Old code which "uses" fpsNumFormatParser must "use" fpsNumFormat now.
  • The source files of the laz_fpspreadsheet, laz_fpspreadsheet_visual and laz_fpspreadsheetexport_visual packages have been moved to separate folders in order to resolve some occasional compilation issues. Projects which do not use the packages but the path to the sources must adapt the paths.
Lazarus trunk / fpc 3.0.4 / all 32-bit on Win-10

GaborBoros

  • New member
  • *
  • Posts: 21
Re: [ANN] fpspreadsheet v1.8
« Reply #1 on: March 14, 2017, 03:15:26 pm »
Hi All,

After switched to it from an earlier SVN revision got runtime error with OpenDocument format. See the below example code. Any idea?

Gabor

Code: Pascal  [Select]
  1. procedure TEST;
  2. var
  3.   WB:TsWorkbook;
  4.   WS:TsWorksheet;
  5.  
  6. begin
  7.   try
  8.     WB:=TsWorkbook.Create;
  9.     WS:=WB.AddWorksheet('WS1');
  10.     WS.WriteText(0,0,'A');
  11.  
  12.     WB.WriteToFile('TEST.XLS',sfExcel8,True);
  13.     WB.WriteToFile('TEST.XLSX',sfOOXML,True);
  14.     WB.WriteToFile('TEST.ODS',sfOpenDocument,True); //RunError(201) in fpsopendocument.pas at line 5186
  15.   finally
  16.     WB.Free;
  17.   end;
  18. end;

wp

  • Hero Member
  • *****
  • Posts: 3896
Re: [ANN] fpspreadsheet v1.8
« Reply #2 on: March 14, 2017, 03:43:38 pm »
Did you add fpsopendocument to the uses clause? This is required to activate the reader/writer of this format. Alternatively you an also add fpsallformats.
Lazarus trunk / fpc 3.0.4 / all 32-bit on Win-10

GaborBoros

  • New member
  • *
  • Posts: 21
Re: [ANN] fpspreadsheet v1.8
« Reply #3 on: March 14, 2017, 05:22:59 pm »
The uses contains fpsopendocument already. If remove it got "Tried to write a spreadsheet using an unsupported format".

I use Linux 64bit, FPC 3.0.2, Lazarus trunk.

wp

  • Hero Member
  • *****
  • Posts: 3896
Re: [ANN] fpspreadsheet v1.8
« Reply #4 on: March 14, 2017, 05:56:04 pm »
OK - I should have seen it already in the comment in your posted code: good old rangecheck error... I uploaded a new version 1.8.1 to sourceforge.
Lazarus trunk / fpc 3.0.4 / all 32-bit on Win-10

GaborBoros

  • New member
  • *
  • Posts: 21
Re: [ANN] fpspreadsheet v1.8
« Reply #5 on: March 14, 2017, 06:28:45 pm »
Works like a charm with 1.8.1. Thank you for the quick fix!

vfclists

  • Hero Member
  • *****
  • Posts: 823
    • HowTos Considered Harmful?
Re: [ANN] fpspreadsheet v1.8
« Reply #6 on: March 17, 2017, 03:19:39 pm »
I downloaded the spready demo from sourceforge and when I try to compile it these functions don't seem to be defined.

Code: Pascal  [Select]
  1. sctrls.pas(192,17) Error: Identifier not found "DayNamesToString"
  2. sctrls.pas(193,17) Error: Identifier not found "MonthNamesToString"

I am using a recent SVN with the latest stable 1.6.4 and FPC 3.0.2, 32 bits
Windows - Lazarus 1.0.8/FPC 2.6.0
Linux - Lazarus 1.4.4 /FPC 2.6.4

wp

  • Hero Member
  • *****
  • Posts: 3896
Re: [ANN] fpspreadsheet v1.8
« Reply #7 on: March 17, 2017, 03:56:17 pm »
Spready in fpspreadsheet v1.8? This should not be. Spready has been removed from the fpspreadsheet installation some time ago, it can be found in the applications folder of the ccr repository. And I just tested Lazarus trunk and 1.6.4 with it - it compiles and runs fine. Maybe you still have an older version somewhere in your fpspreadsheet folder. This probaby will not compile with current fpspreadsheet.

Unfortunately there is not ready-to-use zip file for spready. You either use svn and load the spready repository from svn, or you download the snapshot of the entire ccr repository and delete everything except spready (https://sourceforge.net/code-snapshots/svn/l/la/lazarus-ccr/svn/lazarus-ccr-svn-5806.zip).
Lazarus trunk / fpc 3.0.4 / all 32-bit on Win-10

vfclists

  • Hero Member
  • *****
  • Posts: 823
    • HowTos Considered Harmful?
Re: [ANN] fpspreadsheet v1.8
« Reply #8 on: March 17, 2017, 04:28:14 pm »
Spready in fpspreadsheet v1.8? This should not be. Spready has been removed from the fpspreadsheet installation some time ago, it can be found in the applications folder of the ccr repository. And I just tested Lazarus trunk and 1.6.4 with it - it compiles and runs fine. Maybe you still have an older version somewhere in your fpspreadsheet folder. This probaby will not compile with current fpspreadsheet.

Unfortunately there is not ready-to-use zip file for spready. You either use svn and load the spready repository from svn, or you download the snapshot of the entire ccr repository and delete everything except spready (https://sourceforge.net/code-snapshots/svn/l/la/lazarus-ccr/svn/lazarus-ccr-svn-5806.zip).

It seems my search lead me to an old snapshot of the repo. What I got was lazarus-ccr-svn-4018. I will download your URL and try it.
Windows - Lazarus 1.0.8/FPC 2.6.0
Linux - Lazarus 1.4.4 /FPC 2.6.4

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus