Installing FastReport in Lazarus for Linux and Windows

2022-08-18

FastReport in Lazarus

We are pleased to present you the long-awaited release of Lazarus version 2.2.0, in which we implemented the full-fledged function to work with packages without source code. On that occasion, we are releasing new edition of FastReport for Lazarus, namely Trial.

The content of the article:

1. comparison of FastReport editions for Lazarus;

2. installing FastReport in Lazarus;

 2.1 installation of Lazarus for Windows;

 2.2 installation of Lazarus for Linux;

 2.3 installаtion of FastReport packages in Lazarus for Linux/Windows;

Trial is used to test components before purchase (previously we only offered compiled demo projects).

Comparison of FastReport editions for Lazarus

Licenses

Trial

Professional

Report Designer

Language

English

33 languages

Printing and export

Trial 5 page limit with a note in the corner that the edition is Trial

Unlimited

Editing a report after building

Report objects

32 linear (1d) barcodes

2d barcodes: PDF417, DataMatrix, QRCode, Aztec, MaxiCode, GS1 Databar E., GS1 Databar E.S., Pharmacode Two-Track

Rich View

 

Exports

BMP, PNG, GIF, JPEG, TIFF, EMF, SVG

TXT

PDF, RTF, XLS, XLSX, DOC, DOCX, PPT, PPTX, ODT, ODF, XML, HTML, CSV

"FastReport for Lazarus" is not included in the Standard license.

The Enterprise and Ultimate licenses also come with client/server components.

Installing FastReport in Lazarus

Let's start with the installation of Lazarus.

At the very beginning, we need to install the software for our operating system.

Installing Lazarus for Windows

First, download the Lazarus installation package from the official website and select the bit depth of your system.

Installing Lazarus for Windows

For Windows, the Lazarus installer fits into just one .exe file and you shouldn't have any problems with it.

Next, we download the required version of the archive from the official website.

Installing Lazarus for Windows

Copy the contents from the downloaded archive to C:\Windows\System32 and C:\Lazarus, and then restart Windows. After the launch of Lazarus, it will immediately suggest us to configure it. Just click "ok", accepting with the default settings.

Installing Lazarus for Linux

As in Windows, first, we download the Lazarus installation package from  the official website

Installing Lazarus for Linux

Each item in this list consists of 4 files (3 installer packages and a text file).

- Lazarus(project) installation package;
- fpc-src installation package;
- fpc(laz) installation package;
- README.txt.

It is important to install them in the right order. First fpc(laz), then fpc-src and finally Lazarus(project).

Let's fix the problem with fonts in advance. All operating systems have default fonts. For example, the Arial font is the default font in both Windows and Ubuntu. But in fact, default Arial n Ubuntu is not the same as default Arial in Windows, so text reports created in Windows Lazarus will look terrible in Linux Lazarus (and vice versa).

To avoid this, we will immediately install fonts in Linux as in Windows.

For Ubuntu, you can use the following command:

sudo apt-get install msttcorefonts

But the command may be different for other Linux distributions.

Further, for proper functioning of SqLite, you need to install the following packages: sqlite3, libsqlite3-dev

Read more here.

For Ubuntu, you can use the following command:

sudo apt-get install sqlite3 libsqlite3-dev

We launch Lazarus, it will prompt you to configure it. Click "OK" to accept the default settings.

Installing FastReport packages in Lazarus for Linux/Windows

So, we have already installed Lazarus, now let's move on to installing the FastReport VCL report generator packages in Lazarus.

To do this, we must first download and unpack the licensed version of the product from the official website, Professional and higher versions come as an .exe installer, Trial and Academic — as zip archives. Unlike Embarcadero Delphi, RAD Studio, and C++ Builder, where it is enough to “simply install the compiled packages of components”, in Lazarus they must be compiled, with the exception of Trial and Academic, which are pre-compiled with closed (cut) source code. To install packages, click Package -> Open Package File *.lpk, select the package in the file manager and you will see the following window:

Installing FastReport packages in Lazarus for Linux/Windows

For Professional and above, click Compile, wait for the compilation to finish and click Use. For Academic and Trial, click Use right away. After installing each package, Lazarus will reboot.

Let's move on to the order of installing FastReport packages:

1. fast-script\Source\fs_lazarus.lpk – library for executing scripts;
2. fast-report\Source\frN_lazarus.lpk – package with all main components;
3. In any order:

- fast-report\Source\ExportPack\frxeN_lazarus.lpk – package with exports;
- fast-report\Source\lazchart\frxchartlazarus.lpk – package for charts (diagrams);
- fast-report\Source\lazdbf\frxlazdbf.lpk – a package for working with a BDF format database;
- fast-report\Source\sqlite\frxlazsqlite.lpk – a package for working with SqLite DBMS;
- fast-report\Source\PDFView\frxPDFlazarus.lpk – a package for displaying PDF documents (Windows only);
- fast-report\Source\lazrich\frxrichlazarus.lpk – a package for displaying Rich documents (recommended only for Windows due to basic package restrictions);

4. fast-report\Source\ClientServer\frCS_lazarus.lpk – a package with client-server components, you can reаd more аbout them here;

As mentioned in the edition comparison, the frxRich package is only available for Professional and above, and the client-server components are only available in Enterprise and Ultimate.

Prior to version 2.0.0, there was a very common compilation and/or installation error, at the time of writing this document, the latest version is 2.2.2 and this error has not yet been completely removed in Lazarus, but its probability has been significantly reduced in Windows.

If one of the packages does not compile/install, you will have to go down and recompile/reinstall the package dependencies.

Installing FastReport packages in Lazarus for Linux/Windows

To do this, double-click on it and recompile, and then reinstall.

After successful installation of all the packages, click Project -> Open Project and open the fast-report\LDemo\FRDemo.lpi project and try to run it, then click the Design button.

If you get this negative height error on Linux:

Installing FastReport packages in Lazarus for Linux/Windows

Don't worry. We support both GTK and QT interfaces (but keep in mind that development is mainly done on GTK). So, you can find this bug in some (rather rare) GTK interfaces. Just run the application without debugging, or check "Ignore this type of exceptions".

*Or change the graphical shell. For example, in our team, many people work under the KDE Plasma GTK shell, where this error does not exist.

The last nuance that you need to know when creating your projects is that our designer uses multithreading, which is disabled by default in Linux Lazarus. To enable it, open the file with the “.lpr” extension in the project inspector (Project -> Project inspector) and add the cthreads unit in the first paragraph in uses.

October 28, 2024

How to Set Up WSL 2 for Working with FastReport and FastCube

In this article, we will explore how to set up WSL 2 for working with FastReport and FastCube components in Lazarus for Linux.
August 08, 2024

How to install FastReport .NET and its components on Windows

Step-by-step instructions for online and manual installation via the FastReport registration code.NET and its components in Windows.
December 11, 2023

New S3 transport (Amazon) in FastReport VCL

In this article, we will look at the new transport in S3 (Amazon) for FastReport VCL, which is an object storage of files and buckets.
Fast Reports
  • 800-985-8986 (English, US)
  • +4930568373928 (German)
  • +55 19 98147-8148 (Portuguese)
  • info@fast-report.com
  • 66 Canal Center Plaza, Ste 505, Alexandria, VA 22314

© 1998-2024 Fast Reports Inc.