Chart series type 'Fastline' raises 'invalid datetime value' exception

Anu de DeusAnu de Deus Hampshire, UK
edited May 2009 in FastReport 4.0
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

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 7:11PM
    what version and build number of fr?
    ie fr4.7.136 basic, standard, pro, enterprise.
    Also ide environment version and tchart version being used would be helpful
  • Anu de DeusAnu de Deus Hampshire, UK
    edited 7:11PM
    FR VCL demo 4.7.117 (Enterprise, I assume)
    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.

  • Anu de DeusAnu de Deus Hampshire, UK
    edited 7:11PM
    I have now bought and installed FR 4 VCL Standard, and I can see the issue also happens in that version (4.7.37).
    So, any ideas why the exception is raised?
    Is there a property value I need to set?
    Thanks in advance,
    Alex

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.