IsValidDataSource is not used in TDBChartCrossTabEditor

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
jls
Newbie
Newbie
Posts: 30
Joined: Mon Jul 23, 2007 12:00 am

IsValidDataSource is not used in TDBChartCrossTabEditor

Post by jls » Fri Mar 19, 2010 11:58 am

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

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: IsValidDataSource is not used in TDBChartCrossTabEditor

Post by Narcís » Fri Mar 19, 2010 3:45 pm

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.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

jls
Newbie
Newbie
Posts: 30
Joined: Mon Jul 23, 2007 12:00 am

Re: IsValidDataSource is not used in TDBChartCrossTabEditor

Post by jls » Mon Mar 22, 2010 9:08 am

Her is a sample
Attachments
crosstab.zip
(27.47 KiB) Downloaded 534 times

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: IsValidDataSource is not used in TDBChartCrossTabEditor

Post by Yeray » Wed Mar 24, 2010 10:09 am

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 13597 times
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

jls
Newbie
Newbie
Posts: 30
Joined: Mon Jul 23, 2007 12:00 am

Re: IsValidDataSource is not used in TDBChartCrossTabEditor

Post by jls » Wed Mar 24, 2010 10:29 am

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

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: IsValidDataSource is not used in TDBChartCrossTabEditor

Post by Yeray » Thu Mar 25, 2010 4:41 pm

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.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: IsValidDataSource is not used in TDBChartCrossTabEditor

Post by Narcís » Tue Mar 30, 2010 2:05 pm

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.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

jls
Newbie
Newbie
Posts: 30
Joined: Mon Jul 23, 2007 12:00 am

Re: IsValidDataSource is not used in TDBChartCrossTabEditor

Post by jls » Thu Apr 08, 2010 1:58 pm

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

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: IsValidDataSource is not used in TDBChartCrossTabEditor

Post by Narcís » Fri Apr 09, 2010 8:56 am

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.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

jls
Newbie
Newbie
Posts: 30
Joined: Mon Jul 23, 2007 12:00 am

Re: IsValidDataSource is not used in TDBChartCrossTabEditor

Post by jls » Fri Apr 09, 2010 8:59 am

Anyway, it is not a good solution to change the source code, it should be a setting or an event.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: IsValidDataSource is not used in TDBChartCrossTabEditor

Post by Narcís » Fri Apr 09, 2010 9:15 am

Hi Jørgen,

Ok, I have added your request to the wish-list to be considered for inclusion in future releases.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

jls
Newbie
Newbie
Posts: 30
Joined: Mon Jul 23, 2007 12:00 am

Re: IsValidDataSource is not used in TDBChartCrossTabEditor

Post by jls » Wed May 12, 2010 7:41 am

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
Attachments
crosstab.zip
(24.58 KiB) Downloaded 513 times

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: IsValidDataSource is not used in TDBChartCrossTabEditor

Post by Narcís » Wed May 12, 2010 9:46 am

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?
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply