Chart series type 'Fastline' raises 'invalid datetime value' exception
Anu de Deus
Hampshire, UK
I'm creating a chart by code, from my form.
Everytime I create a series of Fastline (Line 2D I believe) type, it raises an ' xxx is not a valid date and time' exception, no matter what kind of field I'm using for the series. The same series with the same data in the same report works fine if set to be of other type, like Line, Bar, Point, etc.
The chart is created at the ReportSummary page, so it's always the last page to be displayed. The exception is only raised when I actually move the preview screen to the last page, so it has to do with the display of the values, not the chart generation itself, I believe.
Is there a property that I need to set for the series, if it's of type FastLine?
FYI, the fields I want to display are either integer or float type, but never a datetime. So where/why is it assuming it has to convert to a datetime?
Here is the base code for its creation:
fChartView := TfrxChartView.Create(fReportSummaryBand);
fChartView.Name := 'Chart1';
fChartView.Frame.typ := [ftLeft, ftRight, ftTop, ftBottom];
fChartView.Left := 0;
fChartView.Top := 200;
fChartView.Width := fReportSummaryBand.width;
fChartView.Height := 350;
fChartView.DataSet := frxDBDataset1;
fChartView.AddSeries(csFastLine);
fChartView.SeriesData[0].DataSet := frxDBDataset1;
fChartView.SeriesData[0].XSource := fDataSetName + '."' + lXFieldname + '"';
fChartView.SeriesData[0].YSource := fDataSetName + '."' + lFieldName + '"';
fChartView.SeriesData[0].DataType := dtdbData;
fChartView.SeriesData[0].XType := xtText;
fChartView.Chart.Series[0].Title := 'my title';
The TfrxChartView component is in my opinion the most complex one of the FR components, but its documentation barely touches its surface.
I appreciate any help,
Cheers, Alex
Everytime I create a series of Fastline (Line 2D I believe) type, it raises an ' xxx is not a valid date and time' exception, no matter what kind of field I'm using for the series. The same series with the same data in the same report works fine if set to be of other type, like Line, Bar, Point, etc.
The chart is created at the ReportSummary page, so it's always the last page to be displayed. The exception is only raised when I actually move the preview screen to the last page, so it has to do with the display of the values, not the chart generation itself, I believe.
Is there a property that I need to set for the series, if it's of type FastLine?
FYI, the fields I want to display are either integer or float type, but never a datetime. So where/why is it assuming it has to convert to a datetime?
Here is the base code for its creation:
fChartView := TfrxChartView.Create(fReportSummaryBand);
fChartView.Name := 'Chart1';
fChartView.Frame.typ := [ftLeft, ftRight, ftTop, ftBottom];
fChartView.Left := 0;
fChartView.Top := 200;
fChartView.Width := fReportSummaryBand.width;
fChartView.Height := 350;
fChartView.DataSet := frxDBDataset1;
fChartView.AddSeries(csFastLine);
fChartView.SeriesData[0].DataSet := frxDBDataset1;
fChartView.SeriesData[0].XSource := fDataSetName + '."' + lXFieldname + '"';
fChartView.SeriesData[0].YSource := fDataSetName + '."' + lFieldName + '"';
fChartView.SeriesData[0].DataType := dtdbData;
fChartView.SeriesData[0].XType := xtText;
fChartView.Chart.Series[0].Title := 'my title';
The TfrxChartView component is in my opinion the most complex one of the FR components, but its documentation barely touches its surface.
I appreciate any help,
Cheers, Alex
Comments
ie fr4.7.136 basic, standard, pro, enterprise.
Also ide environment version and tchart version being used would be helpful
Delphi 7, without Service Pack
Vista SP2
Sorry, I couldn't find the version of the tchart component, but it's the one from the demo mentioned above (downloaded a few weeks ago).
In case you are wondering why I'm using the demo version, I'm just about to finish evaluating it this week and will (likely) recommend my manager to purchase the VCL components by the end of this week.
So, any ideas why the exception is raised?
Is there a property value I need to set?
Thanks in advance,
Alex