Recent

Author Topic: Cannot get formulas to work  (Read 7436 times)

99Percent

  • Full Member
  • ***
  • Posts: 160
Cannot get formulas to work
« on: September 23, 2011, 06:34:06 am »
I am using Lazarus under Linux 64 and trying to create an ods spreadsheet with formulas. I have tried:

Code: [Select]
Worksheet.WriteUTF8Text(2,0,'=A1*A2');
and
Code: [Select]
Formula.FormulaStr:='=A1*A2':
WriteFormula(2,0,Formula);
and
Code: [Select]
SetLength(RPNFormula,3);
RPNFormula[0].Row:=0;
RPNFormula[0].Col:=0;
RPNFormula[1].ElementKind:=fekCell;
RPNFormula[1].Row:=1;
RPNFormula[1].Col:=0;
RPNFormula[2].ElementKind:=fekMul;
WriteRPNFormula(2,0,RPNFormula);
And none of them work. Is it not supported or am I missing something?

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: Cannot get formulas to work
« Reply #1 on: September 25, 2011, 01:40:22 pm »

mica

  • Full Member
  • ***
  • Posts: 196
Re: Cannot get formulas to work
« Reply #2 on: September 25, 2011, 07:17:14 pm »
you can try
http://avemey.com/zexmlss/index.php

works good with Lazarus

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: Cannot get formulas to work
« Reply #3 on: September 26, 2011, 10:55:32 am »
you can try
http://avemey.com/zexmlss/index.php

works good with Lazarus

This does not seam to support ODS at all

avemey

  • Newbie
  • Posts: 1
Re: Cannot get formulas to work
« Reply #4 on: April 11, 2012, 12:12:24 pm »
This does not seam to support ODS at all

zexmlss v 0.0.3 (beta) can create ODS:
Code: [Select]
//uses zeodfs, zexmlss;
procedure SomeProc();
var
  zz: TZEXMLSS;
  i: integer;
 
begin
  zz := nil;
  try
    zz := TZEXMLSS.Create(nil);
    zz.Sheets.Count := 1;
    with zz.Sheets[0] do
    begin
      RowCount := 20;
      ColCount := 20;
      for i := 0 to 2 do
      begin
        Cell[i, 0].CellType := ZENumber;
        Cell[i, 0].Data := IntToStr(random(100) - 40);
      end;
      Cell[0, 1].Data := 'Calculate:';
      Cell[1, 1].CellType := ZENumber;
      Cell[1, 1].Formula := '=A1 + B1 - C1';
    end;
    //Not packed ODS to some path
    SaveXmlssToODFSPath(zz, '/home/user_name/some_dir/', [], [], nil, 'UTF-8');
    {$IFDEF FPC}
    SaveXmlssToODFS(zz, {path}'formulatest.ods', [], [], nil, 'UTF-8');
    {$ENDIF}
  finally
    if (Assigned(zz)) then
      FreeAndNil(zz);
  end;
end;

some examples can find http://avemey.com/zexmlss/examples.php?lang=en

 

TinyPortal © 2005-2018