FPReport FAQ: what changed
Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.
| Old | New | Line | |
|---|---|---|---|
| 1 | + | ## Contents | |
| 2 | + | ||
| 3 | + | * 1 General | |
| 4 | + | * 1.1 Read the README.txt file | |
| 5 | + | * 1.2 FPReport <> LazReport | |
| 6 | + | * 1.3 Papermanager must registered | |
| 7 | + | * 1.4 Fontmanager | |
| 8 | + | * 2 FPC FPReport | |
| 9 | + | * 2.1 I did not find FPReport in my FPC dir | |
| 10 | + | * 2.2 What is the minimum requirement | |
| 11 | + | * 2.3 Expression and Variables | |
| 12 | + | * 3 Lazarus FPReport | |
| 13 | + | * 3.1 I did not find FPReport in my Lazarus directory | |
| 14 | + | * 3.2 I cannot compile the FPReport packages | |
| 15 | + | * 3.3 Lazarus does not start anymore in Windows | |
| 16 | + | * 3.4 My Report does not run/start in Windows | |
| 17 | + | * 3.5 My Font is not found in windows | |
| 18 | + | ||
| 1 | 19 | ## General | |
| 2 | 20 | ||
| 3 | 21 | ### Read the README.txt file | |
| 4 | 22 | ||
| 5 | - | ||
| 23 | + | Before you compile the FPReport, have a look at the README.txt | |
| 6 | 24 | ||
| 7 | - | ||
| 25 | + | ### FPReport <> LazReport | |
| 8 | 26 | ||
| 9 | - | ||
| 27 | + | FPReport is not LazReport! These are two different reporting systems. | |
| 10 | 28 | ||
| 11 | - | ||
| 12 | - | ||
| 29 | + | * LazReport is based on FreeReport 2.32, see [[LazReport Documentation]]. | |
| 30 | + | * FPReport is written from scratch, see [[FPReport]] documentation. | |
| 13 | 31 | ||
| 14 | 32 | ### Papermanager must registered | |
| 15 | 33 | ||
| 16 | - | ||
| 17 | - | ||
| 18 | - | ||
| 19 | - | ||
| 20 | - | ||
| 34 | + | You never registered the standard page sizes with: | |
| 21 | 35 | ``` | |
| 36 | + | if PaperManager.PaperCount=0 then | |
| 37 | + | PaperManager.RegisterStandardSi | |
| 38 | + | ``` | |
| 22 | 39 | ||
| 23 | 40 | ### Fontmanager | |
| 24 | 41 | ||
| 25 | - | ||
| 26 | - | ||
| 27 | - | ||
| 28 | - | ||
| 29 | - | ||
| 30 | - | ||
| 31 | - | ||
| 32 | - | ||
| 42 | + | Your report used LiberationSans font. Make sure you added the search paths to the font cache. eg: | |
| 33 | 43 | ``` | |
| 34 | - | ||
| 35 | - | ||
| 44 | + | {$IFDEF UNIX} | |
| 45 | + | gTTFontCache.SearchPath.Add(GetUserDir + '.fonts/'); | |
| 46 | + | gTTFontCache.SearchPath.Add('/data/devel/Wisa/fonts/Liberation/'); | |
| 47 | + | gTTFontCache.BuildFontCache; | |
| 48 | + | {$ENDIF} | |
| 49 | + | ``` | |
| 36 | 50 | ||
| 37 | - | ||
| 38 | - | ||
| 39 | - | ||
| 51 | + | In windows this is usable: | |
| 40 | 52 | ``` | |
| 53 | + | gTTFontCache.ReadStandardFonts; | |
| 54 | + | gTTFontCache.BuildFontCache; | |
| 55 | + | ``` | |
| 41 | 56 | ||
| 42 | - | ||
| 57 | + | Default Fonts (cDefaultFont and ReportDefaultFont) on | |
| 43 | 58 | ||
| 44 | - | ||
| 45 | - | ||
| 46 | - | ||
| 59 | + | * **Unix** LiberationSans | |
| 60 | + | * **Windows** Arial | |
| 61 | + | * **Not Unix and not windows** Helvetica | |
| 47 | 62 | ||
| 48 | - | ||
| 63 | + | In some environments like Raspbian you may have trouble with the defaults! You may see a message that the font is not found and the report is not generated. | |
| 49 | 64 | ||
| 50 | 65 | ## FPC FPReport | |
| 51 | 66 | ||
| 52 | 67 | ### I did not find FPReport in my FPC dir | |
| 53 | 68 | ||
| 54 | - | ||
| 69 | + | It is located in the FPC\packages\fcl-report dir, but only in FPC trunk (=3.1.1) since rev. 36962 (20 Aug 2017). | |
| 55 | 70 | ||
| 56 | 71 | ### What is the minimum requirement | |
| 57 | 72 | ||
| 58 | - | ||
| 73 | + | Info from the mailing list - 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 repo too. | |
| 59 | 74 | ||
| 60 | 75 | ### Expression and Variables | |
| 61 | 76 | ||
| 62 | - | ||
| 77 | + | If you use float variables and string values on a non-English configured system you will have problems with the comma as a decimal separator (eg German configured computer). All results will have a dot instead of the the configured value in format setting. This is by design (see Bug report 0036545 and 0036525)! | |
| 63 | 78 | ||
| 64 | - | ||
| 79 | + | _Explanation:_ The Value property of a variable is written to the JSON or XML when saving/loading the report: see ReadElement/WriteElement. So it must be in a transportable, locale-neutral format. | |
| 65 | 80 | ||
| 66 | - | ||
| 81 | + | Imagine saving the report to stream and in a File or DB Blob field, then loading it on another PC with different locale settings. If the stream is written with decimal separator, and read with decimal separator there will be an error on load. | |
| 67 | 82 | ||
| 68 | - | ||
| 83 | + | See also SetValue() where Val() is used to create the value from a string. | |
| 69 | 84 | ||
| 70 | 85 | ## Lazarus FPReport | |
| 71 | 86 | ||
| 72 | 87 | ### I did not find FPReport in my Lazarus directory | |
| 73 | 88 | ||
| 74 | - | ||
| 89 | + | Only in Lazarus trunk since rev. 55719 (20 Aug 2017). Look in LAZARUSDIR\components\fpreport there is a runtimepackage lclfpreport.lpk. | |
| 75 | 90 | ||
| 76 | 91 | ### I cannot compile the FPReport packages | |
| 77 | 92 | ||
| 78 | - | ||
| 93 | + | 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 directory" above). | |
| 79 | 94 | ||
| 80 | 95 | ### Lazarus does not start anymore in Windows | |
| 81 | 96 | ||
| 82 | - | ||
| 97 | + | You need to copy freetype-6.dll and zlib1.dll to your LAZARUSDIR (the folder where lazarus.exe resides). Make sure you use 32 bit DLLs with 32 bit Lazarus and 64 bit DLLs with 64 bit Lazarus. These DLLs are not included. Please see the FreeType [[1]](<https://www.freetype.org/>) and Zlib [[2]](<https://www.zlib.net/>) 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) or a "freetype.dll", so you have to rename the file to "freetype-6.dll" before starting Lazarus._ | |
| 83 | 98 | ||
| 84 | - | ||
| 99 | + | There is a breaking change, the library must be "freetype.dll" in newer versions of fpc (actual fixes32 and trunk) | |
| 85 | 100 | ||
| 86 | 101 | ### My Report does not run/start in Windows | |
| 87 | 102 | ||
| 88 | - | ||
| 103 | + | 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 read the README.txt. On FPC 3.3.1 it is freetype.dll instead of freetype-6.dll. Use the correct version for your bitness (32 or 64 Bit) | |
| 89 | 104 | ||
| 90 | 105 | ### My Font is not found in windows | |
| 91 | 106 | ||
| 92 | - | ||
| 93 | - | ||
| 94 | - | ||
| 95 | - | ||
| 96 | - | ||
| 97 | - | ||
| 98 | - | ||
| 99 | - | ||
| 100 | - | ||
| 101 | - | ||
| 107 | + | You have to use the Postscript name of the font. For example, under Windows you have the font 'Arial' - this is one of the standard fonts - but you have to write Memo.Font.Name := 'ArialMT' because ArialMT is the correct Postscript name. | |
| 102 | 108 | ``` | |
| 109 | + | for i:= 0 to gTTFontCache.Count-1 do begin | |
| 110 | + | try | |
| 111 | + | Memo1.Append(TFPFontCacheItem(gTTFontCache.Items[i]).HumanFriendlyName +'...'+ TFPFontCacheItem(gTTFontCache.Items[i]).PostScriptName); | |
| 112 | + | except | |
| 113 | + | Memo1.Append('ERROR in...'+ TFPFontCacheItem(gTTFontCache.Items[i]).FileName) | |
| 114 | + | end; | |
| 115 | + | end; | |
| 116 | + | ``` | |
| 103 | 117 | ||
| 104 | 118 | --- | |
| 105 | - | ||
| 119 | + | *From the Free Pascal wiki, page "FPReport FAQ", as the Internet Archive kept it on 2023-05-28. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).* |
