by
ru
en
by

Avemey

logo
FilesMainLinksPhotosAnime

If you want to use functions export/import packed ods/xlsx in Delphi with ZEXMLSS


(starts with 0.0.6)
  • By defaults in Delphi functions SaveXmlssToODFS, ReadODFS, SaveXmlssToXLSX and ReadXLSX not available. Steps to enable the functions:
    1. carefully read the file /delphizip/readme.txt (and /readme.en)
    2. (before install) copy from /delphizip/need_zip_packer to /src/ all files (replace). For now available zip packers:
    3. Functions are will available after correct steps
  • (only for export) For export to ODS and xlsx you can use zeZippy: ExportXmlssToODFS and ExportXmlssToXLSX functions. Add zeZyppy to "uses" and wrapper for some zip packer (do do not forget to install zip packer before):
    • zeZippyZipMaster.pas: TZipMaster by www.delphizip.org
    • zeZippyXE2.pas: Delphi XE2 zip (System.Zip TZipFile)
    • zeZippyJCL7z.pas: www.7-zip.org DLL via wrapper by jcl.sf.net
    • zeZippyAB.pas: TurboPower Abbrevia
    • By analogy you can write a wrapper for other packers

    Sample to export ods and xlsx:
    //uses zexmlss, zeodfs, zexmlssutils, zsspxml, zexlsx, zeZippy,
    // zeZippyAB {or zeZippyZipMaster/zeZippyXE2/zeZippyJCL7z - it is your choice};
    procedure TForm1.btnExportClick(Sender: TObject);
    var
      tz: TZEXMLSS;
      i, j: integer;
      TextConverter: TAnsiToCPConverter;
    
    begin
      TextConverter := nil;
      {$IFNDEF FPC}
        {$IF CompilerVersion < 20} // < RAD Studio 2009
      TextConverter := @AnsiToUtf8;
        {$IFEND}
      {$ENDIF}
    
      tz := TZEXMLSS.Create(nil);
      try
        tz.Sheets.Count := 1;
        tz.Sheets[0].Title := 'zeZippy example';
        with tz.Sheets[0] do
        begin
          RowCount := 20;
          ColCount := 20;
          for i := 0 to RowCount - 1 do
          for j := 0 to ColCount - 1 do
          begin
            Cell[j, i].CellType := ZENumber;
            Cell[j, i].Data := IntToStr(i * j);
          end;
        end;
    
        //Export to xlsx
        ExportXmlssToXLSX(tz, {какой-то путь}'zezippytst.xlsx', [], [], nil, 'UTF-8');
        //Export to ods
        ExportXmlssToODFS(tz, {какой-то путь}'zezippytst.ods', [], [], nil, 'UTF-8');
      finally
        tz.free();
      end;  
    end;   
    
FilesMainLinksPhotosAnime

Copyright © 2006-2012 Ruslan V. Neborak