Data incorrect in export to XLSX

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
MS715
Newbie
Newbie
Posts: 5
Joined: Fri Mar 13, 2020 12:00 am

Data incorrect in export to XLSX

Post by MS715 » Mon Mar 07, 2022 8:07 pm

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
Attachments
DataExportIssue.jpg
DataExportIssue.jpg (281.02 KiB) Viewed 8063 times

Marc
Site Admin
Site Admin
Posts: 1272
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Re: Data incorrect in export to XLSX

Post by Marc » Tue Mar 08, 2022 10:30 am

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 [email protected] 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
Steema Support

MS715
Newbie
Newbie
Posts: 5
Joined: Fri Mar 13, 2020 12:00 am

Re: Data incorrect in export to XLSX

Post by MS715 » Tue Mar 08, 2022 2:36 pm

Hi Marc,

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

Mike

Marc
Site Admin
Site Admin
Posts: 1272
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Re: Data incorrect in export to XLSX

Post by Marc » Wed Mar 09, 2022 3:33 pm

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

MS715
Newbie
Newbie
Posts: 5
Joined: Fri Mar 13, 2020 12:00 am

Re: Data incorrect in export to XLSX

Post by MS715 » Wed Mar 09, 2022 4:24 pm

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;

Marc
Site Admin
Site Admin
Posts: 1272
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Re: Data incorrect in export to XLSX

Post by Marc » Fri Mar 11, 2022 7:18 pm

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
Steema Support

Marc
Site Admin
Site Admin
Posts: 1272
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Re: Data incorrect in export to XLSX

Post by Marc » Fri Mar 11, 2022 7:30 pm

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
Steema Support

Post Reply