error using ms access report and setting FunctionType.Period

TeeChart for ActiveX, COM and ASP
Post Reply
jamjam
Newbie
Newbie
Posts: 2
Joined: Tue Nov 14, 2006 12:00 am

error using ms access report and setting FunctionType.Period

Post by jamjam » Mon Nov 20, 2006 10:52 pm

I'm trying to add a function line to calculate an average on series0 in an ms access 2002 report using teechart v7.0.1.2 , with this code...

Code: Select all

  
  .AddSeries scLine
  'Define the Function Type for the new Series
  .Series(5).SetFunction tfAverage
  'Define the Datasource for the new Function Series
  'Use the existing Function (Series0) as input
  .Series(5).DataSource = "Series0"
  .Series(5).FunctionType.Period = 0

  .Series(5).CheckDataSource
however, I get an error upon running...
you have entered an expression that has an invalid reference to |

when I debug and try again I get a different error..
method 'period' of object iteefunction failed.

Anybody ever come across this before?

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

Post by Narcís » Tue Nov 21, 2006 9:57 am

Hi jamjam,

It works fine for me here in VB6 and using this code:

Code: Select all

    With TChart1
        'Create the source series
        .AddSeries scLine
        'Create the function series
        .AddSeries scLine
        TChart1.Series(0).FillSampleValues 10
        
      'Define the Function Type for the new Series
      .Series(1).SetFunction tfAverage
      'Define the Datasource for the new Function Series
      'Use the existing Function (Series0) as input
      .Series(1).DataSource = "Series0"
      .Series(1).FunctionType.Period = 0
    
      .Series(1).CheckDataSource
    End With
Does Series0 exist in your application? If the problem persists please send us a simple example project we can run "as-is" to reproduce the problem here.

You can post your files at news://www.steema.net/steema.public.attachments newsgroup.

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

jamjam
Newbie
Newbie
Posts: 2
Joined: Tue Nov 14, 2006 12:00 am

fixed , bug?

Post by jamjam » Tue Nov 21, 2006 10:08 pm

Thanks,
I fixed the problem with

Code: Select all

 .Series(5).SetFunction 5 'tfAverage
The tfAverage was showing up 'empty' during a debug. In vb6 it shows as 5. It seems to be an issue with MS Access. Do you have explicit definitions for all the functions that I could include in a global module?


I have another issue using access reports. The chart object flickers constantly when in design view. It also takes focus each flicker so that when I go to save the report the prompt to do so appears behind the report design window. Any ideas or should I post another request?

Regards
Sean

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

Post by Narcís » Wed Nov 22, 2006 9:03 am

Hi Sean,
The tfAverage was showing up 'empty' during a debug. In vb6 it shows as 5. It seems to be an issue with MS Access. Do you have explicit definitions for all the functions that I could include in a global module?


Yes, you'll find a list of all TeeChart constants in TeeChartDefines.h at C:\Program Files\Steema Software\TeeChart Pro v7 ActiveX Control\Examples\Visual C++.
I have another issue using access reports. The chart object flickers constantly when in design view. It also takes focus each flicker so that when I go to save the report the prompt to do so appears behind the report design window. Any ideas or should I post another request?
Are you 100% sure that you are using v7.0.1.2? This was a bug in previous versions which was fixed and I can't reproduce it here with v7.0.1.2.

You could search your machine's registry for TeeChart7.ocx and check that there's only one TeeChart7.ocx version registered.

If the problem persists please send us a simple example we can run "as-is" to reproduce the problem here. You can post your files at news://www.steema.net/steema.public.attachments newsgroup.
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