Exporting Series Data in Excel format from IE

TeeChart for ActiveX, COM and ASP
Post Reply
timstap
Newbie
Newbie
Posts: 4
Joined: Wed Jul 26, 2006 12:00 am
Location: London

Exporting Series Data in Excel format from IE

Post by timstap » Thu Jul 10, 2008 7:57 pm

Question: Is it possible to have the Export Dialog open from a client browser (IE7) via the OCX? We are using AX Pro 7.0.0.8 If so, please let me have syntax for the JavaScript method.

If the Dialog is not available at the browser, then please let me have the JavaScript coding to be able to set up and export series data in Excel format to the clipboard, or as a last resort, to file.

Very frustrating, there is very little documentation on JavaScript/VBScript provided - one wastes hours in vain searching for the class methods.

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

Post by Narcís » Fri Jul 11, 2008 9:19 am

Hi timstap,

For openning the chart editor in an ASP page you need to do as in the examples at the ASP Server Examples demo available at TeeChart's program group.

For an example displaying the exporting dialog please have a look at the All Features\Welcome!\Exporting\Chart Data\Excel example in the features demo, available at TeeChart's program group.

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

timstap
Newbie
Newbie
Posts: 4
Joined: Wed Jul 26, 2006 12:00 am
Location: London

Exporting Series Data in Excel format from IE

Post by timstap » Fri Jul 11, 2008 10:22 am

Thanks for your reply Narcís.

Please can you tell me where to find the following - I have just spent over an hour searching your site:

All Features\Welcome!\Exporting\Chart Data\Excel example in the features demo, available at TeeChart's program group.

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

Post by Narcís » Fri Jul 11, 2008 10:26 am

Hi timstap,

The features demo is installed together with TeeChart at Start Menu->All Programs->TeeChart Pro v7 ActiveX Control->TeeChart Pro AX v7 feature demo.

BTW: Also notice latest v7 release available at the client download area is v7.0.1.4.
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

timstap
Newbie
Newbie
Posts: 4
Joined: Wed Jul 26, 2006 12:00 am
Location: London

Post by timstap » Fri Jul 11, 2008 11:13 am

Thanks again Narcís, I found the example you mentioned and converted the code to JavaScript as below, but I get an IE error message that TChart1.Export.asXls.CommonDialog1 is null or not an object:

function data_export() {
TChart1.Export.asXls.IncludeHeader=true;
TChart1.Export.asXls.IncludeIndex=true;
TChart1.Export.asXls.IncludeLabels=true;
TChart1.Export.asXls.Series=0;
TChart1.Export.asXls.CommonDialog1.Filter="Excel files(*.xls)|*.xls";
TChart1.Export.asXls.CommonDialog1.ShowSave;
if(TChart1.Export.asXls.CommonDialog1.FileName != "")
TChart1.Export.asXls.SaveToFile(CommonDialog1.FileName);
}

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

Post by Narcís » Fri Jul 11, 2008 11:19 am

Hi timstap,

This is because CommonDialog1 object doesn't belong to TChart1.Export.asXls. It's another control in the Visual Basic example. In that case you should do something like this:

Code: Select all

function data_export() {
TChart1.Export.asXls.IncludeHeader=true;
TChart1.Export.asXls.IncludeIndex=true;
TChart1.Export.asXls.IncludeLabels=true;
TChart1.Export.asXls.Series=0;
TChart1.Export.asXls.SaveToFile(YourFileNameHere);
}
or this:

Code: Select all

function data_export() {
TChart1.Export.ShowExport
}
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

timstap
Newbie
Newbie
Posts: 4
Joined: Wed Jul 26, 2006 12:00 am
Location: London

Post by timstap » Wed Jul 23, 2008 9:51 am

Thanks again Narcís

Just for the benefit of other readers, for Javascript we must use brackets for the function:

TChart1.Export.ShowExport();

Not

TChart1.Export.ShowExport

Are there options for this function, for example so that we only get the Data tab, and not the Picture and Native tabs on the Export Dialog?

Thanks in anticipation
Tim

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 Jul 23, 2008 10:10 am

Hi Tim,

You can do that for the Native export tab:

Code: Select all

    TeeCommander1.Chart = TChart1
    
    TeeEditor1.Chart = TChart1
    TeeEditor1.ShowPages.ExportNative = False
    
    TeeCommander1.Editor = TeeEditor1
However, the image export tab can not be hidden. I'll add this as a feature request 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

Post Reply