TDBCrossTabSource causes form to hang with 2 or more charts

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Ewestenend
Newbie
Newbie
Posts: 9
Joined: Thu Sep 24, 2009 12:00 am

TDBCrossTabSource causes form to hang with 2 or more charts

Post by Ewestenend » Sat Sep 04, 2010 2:34 am

Hi,

I have a form with 2 dbcharts on it.
Chart1 has a horizontal bar series and chart 2 a vertical bar series.
I dropped for each chart 2 TDBCrossTabSource components on the form.

What I want to accomplish is to asign the properties of those TDBCrossTabSource components in runtime.
So in designtime I leave it empty.
The following code I used for that on FromCreate.

DBCrossTabSource1.Series:=Series1;// From chart1
DBCrossTabSource1.DataSet:=ClientDataSet1;
DBCrossTabSource1.GroupField:='MyGroupField1';
DBCrossTabSource1.LabelField:='MyLabelField1';
DBCrossTabSource1.ValueField:='MyValueField1';
DBCrossTabSource1.Formula:=gfSum;
DBCrossTabSource1.Open;
ClientDataSet1.Open;

DBCrossTabSource2.Series:=Series2;// From chart2
DBCrossTabSource2.DataSet:=ClientDataSet2;
DBCrossTabSource2.GroupField:='MyGroupField2';
DBCrossTabSource2.LabelField:='MyLabelField2';
DBCrossTabSource2.ValueField:='MyValueField2';
DBCrossTabSource2.Formula:=gfSum;
DBCrossTabSource2.Open;
ClientDataSet2.Open;

This works fine while the application is running.
But once you try to close the form the application hangs.

It seems that assigning the properties in runtime is causing this. If those properties are being set in designtime and in runtime opeing the dataset there are no problems at all.

How can I solve this and what's the cause? Or better, what is the best way to define all DBCrossTabSource properties in runtime?

Thanks.

Ewestenend
Newbie
Newbie
Posts: 9
Joined: Thu Sep 24, 2009 12:00 am

Re: TDBCrossTabSource causes form to hang with 2 or more charts

Post by Ewestenend » Sat Sep 04, 2010 2:40 am

In addition to my previous post.

If I just use 1 dbchart and 1 dbcrossdatasource on a form and then create 2 of these forms as childforms on my mainform, the result is the same.

I really need some help with this.

Thanks.

Ewestenend
Newbie
Newbie
Posts: 9
Joined: Thu Sep 24, 2009 12:00 am

Re: TDBCrossTabSource causes form to hang with 2 or more charts

Post by Ewestenend » Mon Sep 06, 2010 2:21 am

After some testing I found a workaround but it's not the desired result.

The problem is being caused if you have 2 crosstabsources with the same forms owner the application hangs while closing the mainform.
The fact is I load those 2 forms on a mainform and define the childforms owner as the mainform and the parent is a panel. This is causing problems.
Setting the chilfforms owner to nil and keeping the parent prevents this and gives what I want.
But since I have no owner anymore it takes me some additional code which I don't want actually.
Another workaround is creating series manually. But why do it manually if this is what the CrosstabSource is designed for.
I consider this is as a major bug and hope to get some solutions over here.

Thanks in advance.

Eric.

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

Re: TDBCrossTabSource causes form to hang with 2 or more charts

Post by Narcís » Wed Sep 08, 2010 1:26 pm

Hi Eric,

What about manually closing datasources in form's OnClose event?
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

Ewestenend
Newbie
Newbie
Posts: 9
Joined: Thu Sep 24, 2009 12:00 am

Re: TDBCrossTabSource causes form to hang with 2 or more charts

Post by Ewestenend » Thu Sep 09, 2010 12:45 am

Hi Narcis,

No this is working neither. I tried that already.
And debugging within Delphi doesn't forward me to the problem neither. Maybe a drawing issue?

But if you need a testproject which is showing the problem I can send you that. But how and where?

Thanks,
Eric.

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

Re: TDBCrossTabSource causes form to hang with 2 or more charts

Post by Yeray » Thu Sep 09, 2010 12:29 pm

Hi Eric,

You can either post your files directly here in the forums as an attachment to a message, at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
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

Ewestenend
Newbie
Newbie
Posts: 9
Joined: Thu Sep 24, 2009 12:00 am

Re: TDBCrossTabSource causes form to hang with 2 or more charts

Post by Ewestenend » Mon Sep 13, 2010 10:14 am

Hi,

This small testproject attached, is basically showing the problem already.

On running the application 2 forms will be loaded as a child on the mainform. Both have a chart and a dataset on it and the owner is the mainform.

Open the project in delphi. You need to change the paths for the included clientdataset files in unit 3 and 4.
Compile and run.

Try to close the mainform. In my case the application hangs and can't close anymore. The problem seems to be solved if the child forms do have not an onwer, meaning nil.
But that isn't a real solution I suppose.

Thanks,
Eric.
Attachments
Charts.zip
(8.53 KiB) Downloaded 310 times

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

Re: TDBCrossTabSource causes form to hang with 2 or more charts

Post by Narcís » Fri Sep 17, 2010 10:25 am

Hi Eric,

Sorry for the delayed reply. We are investigating the issue here and will get back to you as soon as we have some news.
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

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

Re: TDBCrossTabSource causes form to hang with 2 or more charts

Post by Yeray » Mon Sep 20, 2010 3:34 pm

Hi Eric,

Excuse us again for the delayed reply.
In the first tests I made with your application (under WinXP) I could reproduce the problem.
I modified the project to run from "C:\tmp\Charts" and I tried to reproduce the problem in another computer (Win 7) but couldn't.
I also tried to reproduce the problem in a third computer (WinXP again) but couldn't.
Now, I'm trying to reproduce the problem in the first computer where I initially could reproduce the problem but it seems I can't.

Here it is the application and the steps I followed:
Charts.zip
(5.7 KiB) Downloaded 323 times
- Verify the paths to the datasource.
- Open the project with RAD Studio 2010 and TeeChart Pro v2010.01.
- Compile and run the project.
- Open Unit3.pas (source view)
- Close the project.
At this point I saw the IDE hanging. In this view, I could see a line of code disappearing and reappearing.

We need a consistent way to reproduce the problem in order to investigate it. It will be helpful if you can provide it to us.
Thanks in advance.
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

Ewestenend
Newbie
Newbie
Posts: 9
Joined: Thu Sep 24, 2009 12:00 am

Re: TDBCrossTabSource causes form to hang with 2 or more charts

Post by Ewestenend » Wed Sep 22, 2010 6:27 am

Hi,

Funny is that you initially could reproduce the problem and later not anymore.
Well in fact, me neither now.
Since I installed the latest release( TChartPRO 2010, september 9 version ) the problem doesn't appear anymore if I give the childforms an onwer.
I needed to install the latest version due there was a repaint issue as well. By installing that version it seems both issues are gone and solved now.

Anyway.
Thanks you for your time, I appreciate that.

Eric.

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

Re: TDBCrossTabSource causes form to hang with 2 or more charts

Post by Yeray » Wed Sep 22, 2010 9:49 am

Hi Eric,

I thought I was using the 2010.01 too when I reproduced the problem, but I might be wrong.
Anyway, I'm glad to see it works fine for you now!
If the problem reappears, don't hesitate to let us know.
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

Post Reply