Damage of pivot table formats

Questions and answers on how to use XLSReadWriteII 5.
Post Reply
jsfkcz
Posts: 29
Joined: Thu Sep 11, 2014 8:29 am

Damage of pivot table formats

Post by jsfkcz »

Hello,
I have a simple template with 2 pivot tables.
The 1st one shows percentual values with default format with 2 decimal places.
The second one has only one decimal place changed by options in pivot table properties.
(Both tables update automatically with opening worksheet.)

Template:
Image
After write some value to the template, calculate and save the result has bad format at the second pivot table.
The first pivot table with defalut format of values is still ok.
Image

Code: Select all

    procedure TForm1.Button1Click(Sender: TObject);
    const
      cOrigFile = 'template.xlsx';
      cTestFile = 'result.xlsx';
    var
      ASheet: TXLSWorksheet;
    begin
      CopyFile(cOrigFile,cTestFile,False);
      xlsRW.Filename:= cTestFile;
      xlsRW.Read;
      ASheet:= xlsRW.SheetByName('Pivot');
      asheet.asinteger[2,0]:=1; // cell C1
      xlsRW.calculate;
      xlsRW.Write;
    end;
    end.
The template.xlsx and result.xlsx are at http://www.genet.cz/kohout/xlsrw/exampl ... format.zip for download.

Josef Kohout
larsa
Site Admin
Posts: 926
Joined: Mon Jun 27, 2005 9:30 pm

Re: Damage of pivot table formats

Post by larsa »

Hello

This is fixed in update 5.20.40
Lars Arvidsson, Axolot Data
Post Reply