Page 1 of 1

Exporting Series Data in Excel format from IE

Posted: Thu Jul 10, 2008 7:57 pm
by 9531994
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.

Posted: Fri Jul 11, 2008 9:19 am
by narcis
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.

Exporting Series Data in Excel format from IE

Posted: Fri Jul 11, 2008 10:22 am
by 9531994
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.

Posted: Fri Jul 11, 2008 10:26 am
by narcis
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.

Posted: Fri Jul 11, 2008 11:13 am
by 9531994
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);
}

Posted: Fri Jul 11, 2008 11:19 am
by narcis
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
}

Posted: Wed Jul 23, 2008 9:51 am
by 9531994
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

Posted: Wed Jul 23, 2008 10:10 am
by narcis
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.