[SOLVED] Error compiling component lrspreadsheetexport.lpk lazarus / 31-LCL ---------------------------------------------------------------------- Ever · 2017-06-27 00:23 Goodnight     I go to the forum so that they can give me support with compiling the lrspreadsheetexport.lpk component contained in LazReport. I can not compile because it always throws the error shown in the image.     I appreciate the support they can give me to get this component to work, since I need to export to Excel some of the reports that I have in the application that I am doing.     Thanks in advance,   Ever Delgado ---------------------------------------------------------------------- wp · 2017-06-27 07:16 Which version of Lazarus and which version of fpspreadsheet do you use? Which OS? ---------------------------------------------------------------------- Ever · 2017-07-01 02:40 Sorry for the lack of information. I use lazarus 1.6.4, the version of fpspreadsheet is version V0.9 and Windows is the 10 of 64 bits although I have 32-bit Lazarus installed. Thanks for watching for lack of information. Ever Delgado ---------------------------------------------------------------------- wp · 2017-07-03 15:14 Sorry, I missed your response... Hmm, quite standard configuration. My problem is that I cannot reproduce any error when I compile the IDE (containing the packages laz_fpspreasheet,  lazreport, lrspreadsheetexport). Did you try a clean build (i.e. go to "Tools" > "Configure Build Lazarus" and check "Clean all" and "Switch after building to automatically", then click "Build")? If this does not help go to your Lazarus installation folder, and delete the folders (lazarus)\components\lazreport\source\lib, (lazarus)\components\lazreport\addonds\lrspreadsheetexport\lib, and repeat with source\lib in the fpspreadsheet installation folder. Then rebuild the IDE again. ---------------------------------------------------------------------- Ever · 2017-07-04 13:59 Thank you for your attention       I did everything proposed by you, but unfortunately I still have the inconvenience. I only compile the component if I comment the following lines: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   if not GetFormatFromFileName(FFileName, sfFileType) then    sfFileType:=sfOpenDocument;   But obviously doing that does not work the component and does not carry out exporting the report ---------------------------------------------------------------------- wp · 2017-07-04 14:36 You did not specify the version of fpspreadsheet. Since there was a reorganisation of units some time ago the issue could happen if your version is too old. About a year ago the following procedure was added to lr_e_spreadsheet (before TlrSpreadSheetExportFilter.OnEndDoc): Code: Text  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i function GetFormatFromFileName(const AFileName: TFileName;  out SheetType: TsSpreadsheetFormat): Boolean;var  suffix: String;begin  Result := true;  suffix := Lowercase(ExtractFileExt(AFileName));  case suffix of    STR_EXCEL_EXTENSION               : SheetType := sfExcel8;    STR_OOXML_EXCEL_EXTENSION         : SheetType := sfOOXML;    STR_OPENDOCUMENT_CALC_EXTENSION   : SheetType := sfOpenDocument;    STR_COMMA_SEPARATED_EXTENSION     : SheetType := sfCSV;    STR_HTML_EXTENSION, '.htm'        : SheetType := sfHTML;    STR_WIKITABLE_PIPES_EXTENSION     : SheetType := sfWikiTable_Pipes;  STR_WIKITABLE_WIKIMEDIA_EXTENSION : SheetType := sfWikiTable_WikiMedia;    else                                Result := False;  end;end; This makes the unit more independent of the fpspreadsheet versions. Please add this procedure and check again. ---------------------------------------------------------------------- Ever · 2017-07-05 02:56 Thank you      I managed to correct the error including the code given by wp. Very thankful. Now the problem is that it did not make it work correctly, the file it generates is corrupt or 0 bytes long.      Equally grateful for your support.