Recent

Author Topic: [SOLVED] Error compiling component lrspreadsheetexport.lpk  (Read 3553 times)

Ever

  • Jr. Member
  • **
  • Posts: 61
[SOLVED] Error compiling component lrspreadsheetexport.lpk
« on: June 27, 2017, 02:23:52 am »
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
« Last Edit: July 19, 2017, 04:53:50 pm by everjdelgadoch »

wp

  • Hero Member
  • *****
  • Posts: 11923
Re: Error compiling component lrspreadsheetexport.lpk
« Reply #1 on: June 27, 2017, 09:16:18 am »
Which version of Lazarus and which version of fpspreadsheet do you use? Which OS?

Ever

  • Jr. Member
  • **
  • Posts: 61
Re: Error compiling component lrspreadsheetexport.lpk
« Reply #2 on: July 01, 2017, 04:40:14 am »
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

  • Hero Member
  • *****
  • Posts: 11923
Re: Error compiling component lrspreadsheetexport.lpk
« Reply #3 on: July 03, 2017, 05:14:58 pm »
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

  • Jr. Member
  • **
  • Posts: 61
Re: Error compiling component lrspreadsheetexport.lpk
« Reply #4 on: July 04, 2017, 03:59:08 pm »
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][+][-]
  1.   if not GetFormatFromFileName(FFileName, sfFileType) then
  2.     sfFileType:=sfOpenDocument;

  But obviously doing that does not work the component and does not carry out exporting the report


wp

  • Hero Member
  • *****
  • Posts: 11923
Re: Error compiling component lrspreadsheetexport.lpk
« Reply #5 on: July 04, 2017, 04:36:04 pm »
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][+][-]
  1. function GetFormatFromFileName(const AFileName: TFileName;
  2.   out SheetType: TsSpreadsheetFormat): Boolean;
  3. var
  4.   suffix: String;
  5. begin
  6.   Result := true;
  7.   suffix := Lowercase(ExtractFileExt(AFileName));
  8.   case suffix of
  9.     STR_EXCEL_EXTENSION               : SheetType := sfExcel8;
  10.     STR_OOXML_EXCEL_EXTENSION         : SheetType := sfOOXML;
  11.     STR_OPENDOCUMENT_CALC_EXTENSION   : SheetType := sfOpenDocument;
  12.     STR_COMMA_SEPARATED_EXTENSION     : SheetType := sfCSV;
  13.     STR_HTML_EXTENSION, '.htm'        : SheetType := sfHTML;
  14.     STR_WIKITABLE_PIPES_EXTENSION     : SheetType := sfWikiTable_Pipes;
  15.     STR_WIKITABLE_WIKIMEDIA_EXTENSION : SheetType := sfWikiTable_WikiMedia;
  16.     else                                Result := False;
  17.   end;
  18. end;

This makes the unit more independent of the fpspreadsheet versions.

Please add this procedure and check again.

Ever

  • Jr. Member
  • **
  • Posts: 61
Re: Error compiling component lrspreadsheetexport.lpk
« Reply #6 on: July 05, 2017, 04:56:44 am »
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.

 

TinyPortal © 2005-2018