Page 1 of 1

IsValidDataSource is not used in TDBChartCrossTabEditor

Posted: Fri Mar 19, 2010 11:58 am
by 10546183
The datasets is not filtered in the TDBChartCrossTabEditor

Probably something wrong in

procedure TBaseDBChartEditor.FillSources;

Any solution?

Must I change the source code?

Jørgen

Re: IsValidDataSource is not used in TDBChartCrossTabEditor

Posted: Fri Mar 19, 2010 3:45 pm
by narcis
Hi Jørgen,

I'm sorry but I'm not sure which is the exact problem here. Could you please give us more detailed information and, if possible, attach a simple example project we can run "as-is" to reproduce the problem here?

Thanks in advance.

Re: IsValidDataSource is not used in TDBChartCrossTabEditor

Posted: Mon Mar 22, 2010 9:08 am
by 10546183
Her is a sample

Re: IsValidDataSource is not used in TDBChartCrossTabEditor

Posted: Wed Mar 24, 2010 10:09 am
by yeray
Hi Jørgen,

Could you please tell us the exact steps we should follow with your testing application to reproduce the problem here?
Here is what I'm getting:
test.png
test.png (41.98 KiB) Viewed 13405 times

Re: IsValidDataSource is not used in TDBChartCrossTabEditor

Posted: Wed Mar 24, 2010 10:29 am
by 10546183
You have done it correct

The problem is that all datasets are available for crosstab source.

ClientDataset2 should not be on the list.

If you try to use a dataset as source you can see that only ClientDataset1 is available.


Jørgen

Re: IsValidDataSource is not used in TDBChartCrossTabEditor

Posted: Thu Mar 25, 2010 4:41 pm
by yeray
Hi Jørgen,

We've seen that TDBChartCrossTabEditor doesn't access to IsValidDataSource because it inherits from a different class than TBaseSourceEditor.
We've also seen that setting SkipValidation as False in TDBChartCrossTabEditor.FormShow into TeeDBCrossTab.pas the problem seem to be solved.
We'll continue investigating the issue and we'll be back to you asap.

Re: IsValidDataSource is not used in TDBChartCrossTabEditor

Posted: Tue Mar 30, 2010 2:05 pm
by narcis
Hi Jørgen,

Actually this behaviour is as designed. What causes validation being skipped is SkipValidation property. As Yeray told you, setting it to false at TDBChartCrossTabEditor.FormShow method in TeeDBCrossTab.pas does what you request.

Re: IsValidDataSource is not used in TDBChartCrossTabEditor

Posted: Thu Apr 08, 2010 1:58 pm
by 10546183
Any reason why this is designed liked this?

I can change the source code, but i prefer not. Is the only solution to do this?

Jørgen

Re: IsValidDataSource is not used in TDBChartCrossTabEditor

Posted: Fri Apr 09, 2010 8:56 am
by narcis
Hi Jørgen,

I'm not 100% sure why SkipValidation was added in CrossTabSource but most likely it is to allow using Series1.DataSource = DBCrossTab, in a standard TChart, not in a TDBChart. Removing it would make necessary the use of TDBChart for DBCrossTab as DataSource.

Re: IsValidDataSource is not used in TDBChartCrossTabEditor

Posted: Fri Apr 09, 2010 8:59 am
by 10546183
Anyway, it is not a good solution to change the source code, it should be a setting or an event.

Re: IsValidDataSource is not used in TDBChartCrossTabEditor

Posted: Fri Apr 09, 2010 9:15 am
by narcis
Hi Jørgen,

Ok, I have added your request to the wish-list to be considered for inclusion in future releases.

Re: IsValidDataSource is not used in TDBChartCrossTabEditor

Posted: Wed May 12, 2010 7:41 am
by 10546183
I have changed the sample.

Now it removes null values from the crosstabseries.


I changed

Procedure TDBCrossTabSource.LoadDataSet;


Does this solution make sense?

Jørgen

Re: IsValidDataSource is not used in TDBChartCrossTabEditor

Posted: Wed May 12, 2010 9:46 am
by narcis
Hi Jørgen,

TeeChart historically doesn't automatically handle null values as everybody marks and processes them in a different way so this task is left to the programmer. However, I think it would be more efficient setting points to null when adding them to the series instead of having to use series' Identifier and loop through all series twice. Something like this:

Code: Select all

        if IsNull then PointColor:=clNone
        else PointColor:=clTeeColor;

        if tmpPoint=-1 then
        begin
          tmpSeries.Add(tmpValue,tmpLabel,clTeeColor);

          with Series.ParentChart do
          for t:=0 to SeriesCount-1 do
          if tmpSeries<>Series[t] then
             if tmpSeries.Count>Series[t].Count then
                for tt:=1 to (tmpSeries.Count-Series[t].Count) do
                    Series[t].Add(0,tmpLabel,PointColor);
Does this solve the problem for you?