FPReport FAQ

From Free Pascal wiki
Jump to navigationJump to search

English (en)

General

Read the README.txt file

Before you compile the FPReport, have a look at the README.txt

FPReport <> LazReport

FPReport is not LazReport!! These are two different reporting systems.

Papermanager must registered

You never registered the standard page sizes with:

  if PaperManager.PaperCount=0 then
    PaperManager.RegisterStandardSi

Fontmanager

Your report used LiberationSans font. Make sure you added the search paths to the font cache. eg:

  {$IFDEF UNIX}
    gTTFontCache.SearchPath.Add(GetUserDir + '.fonts/');
    gTTFontCache.SearchPath.Add('/data/devel/Wisa/fonts/Liberation/');
    gTTFontCache.BuildFontCache;
  {$ENDIF}

In windows this useable

  gTTFontCache.ReadStandardFonts;
  gTTFontCache.BuildFontCache;

FPC FPReport

I did not find FPReport in my FPC dir

It is located in the FPC\packages\fcl-report dir, but only in FPC trunk (=3.1.1) since rev. 36962 (20.Aug. 2017)

What is the minimum requirement

Info from Mailinglist - FPC 2.6.4 (and Lazarus 1.6.2), but you will need to copy some additional units from the trunk version of the FPC source repo (in particular, fpexprpars, and fcl-pdf) and the Lazarus trunk repro too

Lazarus FPReport

I did not find FPReport in my Lazarus dir

Only in Lazarus trunk since rev. 55719 (20.Aug. 2017). Look in LAZARUSDIR\components\fpreport there is a runtimepackage lclfpreport.lpk.

I cannot compile the FPReport packages

As of 20th January 2019 FPReport does not compile out of the box in 64 bit Lazarus (Windows version at least). It should compile flawlessly in 32 bit Lazarus, though (see also "I did not find FPReport in my Lazarus dir").

Lazarus does not start anymore

You need to copy freetype-6.dll and zlib1.dll to your LAZARUSDIR (the folder where lazarus.exe resides). These DLLs are not included. Please see the FreeType [1] and Zlib [2] project pages for details on how to get them. Please note that FPReport expects a freetype-6.dll whereas the install package from freetype.org includes a freetype6.dll (without the dash), so you have to rename the file to freetype-6.dll before starting Lazarus.

My Report does not run/start in Windows

Start the application from the console, so you can see if some dll's are missing. Normally freetype-6.dll and zlib1.dll are missing. For more information look into the README.txt.

My Font is not found in windows

You have to use the PostScriptName of the font. Eg. under windows you have the font 'Arial' - this is one of the standard font - but you have to write Memo.Font.Name := 'ArialMT' because ArialMT is the correct PostScriptname.

  for i:= 0 to gTTFontCache.Count-1 do begin
    try
      Memo1.Append(TFPFontCacheItem(gTTFontCache.Items[i]).HumanFriendlyName +'...'+ TFPFontCacheItem(gTTFontCache.Items[i]).PostScriptName);
    except
      Memo1.Append('ERROR in...'+ TFPFontCacheItem(gTTFontCache.Items[i]).FileName)
    end;
  end;