Page 1 of 1

Data incorrect in export to XLSX

Posted: Mon Mar 07, 2022 8:07 pm
by 16588310
When I export chart data to XLSX some data is lost and some data is offset. In the image attached you can see the values in the data table and what shows up after export. Any ideas how to correct the export.

Thanks
Mike Simmons

Re: Data incorrect in export to XLSX

Posted: Tue Mar 08, 2022 10:30 am
by Marc
Hello Mike,

Would it be possible for you to save your chart as a .tee file when run (from editor, export binary include data) and send it to us, to info@steema.com would be fine, and the xlsx exported file too? We'll load the chart and look for possible problems.

If you don't have an editor on the form the quickest way would be to add a TeeCommander bar temporarily for the test run.

With thanks,
Regards,
Marc Meumann

Re: Data incorrect in export to XLSX

Posted: Tue Mar 08, 2022 2:36 pm
by 16588310
Hi Marc,

I've sent the exported chart via email. Thanks for the fast response.

Mike

Re: Data incorrect in export to XLSX

Posted: Wed Mar 09, 2022 3:33 pm
by Marc
Hello Mike,

Thanks for the file. We can reproduce the output you've obtained, We see that the older format, xls, saves apparently correctly. We'll work our way through it.

I've logged it asa bug here: http://bugs.steema.com/show_bug.cgi?id=2513

Regards,
Marc

Re: Data incorrect in export to XLSX

Posted: Wed Mar 09, 2022 4:24 pm
by 16588310
Hi Marc,

I am allowing users to export data via a button click (see code below). I am apparently not triggering use of the older excel format. Can you direct me to a sample or the correct method?

Thanks,
Mike Simmons

procedure TGraphForm.DownloadDataAsXLX(Sender: TObject);
Var
NameOnly, DownloadFileName: String;
//XlsExp: TSeriesDataXLSObject;
XlsExp: TSeriesDataXLS;
begin
NameOnly := 'GRAPHDATA' + DM1.VUIUtil.MakeTimeStamp + '.XLS';
DownloadFileName := Noslash(G_Temp) + '\' + NameOnly;
try
xlsexp := TSeriesDataXLS.Create(Chart1);
//xlsexp := TSeriesDataXLSObject.Create(Chart1);
xlsexp.IncludeHeader := True;
xlsexp.IncludeIndex := True;
xlsexp.SaveToFile(DownloadFileName);
DM1.VUIUtil.DownloadFile(DownloadFileName, NameOnly);
finally
xlsexp.Free;
end;
end;

Re: Data incorrect in export to XLSX

Posted: Fri Mar 11, 2022 7:18 pm
by Marc
Hello Mike,

I'll check the syntax you have sent over in your last post, to run the older Excel version and reply to this thread. In the meantime just to let you know that issue you reported, logged as #2513, has been fixed.

I see you are a sourcecode customer so I am sending the modified unit to you directly. You should replace it in your source and run TeeRecompile to update the binary version and the vcl unit folder.

Regards,
Marc

Re: Data incorrect in export to XLSX

Posted: Fri Mar 11, 2022 7:30 pm
by Marc
Hello Mike,

This syntax works for earlier Excel format:

Code: Select all

type TSeriesAccess=class(TChartSeries);

procedure TForm1.Button2Click(Sender: TObject);
begin
  with TSeriesDataXLS.Create(Chart1, nil) do
    try
      UseSeriesFormat := True;
      IncludeHeader := True;

      SaveToFile('d:\data\output\example.xls');
    finally
      Free;
    end;
end;
Regards,
Marc