Type | Description | |||
Destination as Variant |
A String expression that specifies the file/format to be created. The
Destination parameter indicates the format to be created as follows:
No error occurs, if the Export method can not create the file. | |||
Options as Variant | A String expression that specifies the options to be used when exporting the control's data, as explained bellow. |
Return | Description | |||
Variant | The
result of the Export method is a:
|
The following file samples, shows the format the Export method can export the control's DATA:
The following screen shot shows the control's DATA in CSV format:
The following screen shot shows the control's DATA in HTML format:
The Options parameter consists a list of fields separated by | character, in the following order:
The Destination parameter indicates the file to be created where exported date should be saved. For instance, Export( "c:\temp\export.html") exports the control's DATA to export.html file in HTML format, or Export( "","sel|0,1|;") returns the cells from columns 0, 1 from the selected items, to a CSV format using the ; character as a field separator.
The "CSV" refers to any file that:
The "HTML" refers to any file that:
You can use the Copy/CopyTo to export the control's view to clipboard/EMF/BMP/JPG/PNG/GIF or PDF format.
Currently, the /COM version allows you to use the Export method in window-less mode (no user interface). In order to use the control in window-less mode, after creation of the /COM object it is required to call any of the following methods:
Any of the following templates creates dynamically the /COM component, and uses the Export method to display the result of imported data:
CreateObject("Exontrol.Pivot") { Import("C:\Program Files\Exontrol\ExPivot\Sample\data.txt") PivotRows = "0" PivotColumns = "avg(5)" print(Export()) }
or:
CreateObject("Exontrol.Pivot") { Dim rs rs = CreateObject("ADOR.Recordset") { ' Change the Path to the SAMPLE.MDB if nothing is displayed Open("Data","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExPivot\Sample\Access2007\sample.accdb", 3, 3 ) } DataSource = rs PivotRows = "0" PivotColumns = "max(5)" print(Export()) }
or:
CreateObject("Exontrol.Pivot") { LoadXML("https://www.exontrol.net/testing.xml") PivotRows = "1" PivotColumns = "max(6)" print(Export()) }
You can use the eXHelper tool to convert any of these templates to your programming languages. For instance, in VB6 the code shows as:
With CreateObject("Exontrol.Pivot") .Import "C:\Program Files\Exontrol\ExPivot\Sample\data.txt" .PivotRows = "0" .PivotColumns = "avg(5)" Debug.Print( .Export() ) End With
or in PowerBuilder shows as:
OleObject var_Pivot var_Pivot = CREATE OLEObject var_Pivot.ConnectToNewObject("Exontrol.Pivot") var_Pivot.Import("C:\Program Files\Exontrol\ExPivot\Sample\data.txt") var_Pivot.PivotRows = "0" var_Pivot.PivotColumns = "avg(5)" MessageBox("Information",string( String(var_Pivot.Export()) ))