Toggle menu
862
3.8K
30.2K
279.1K
Catglobe Wiki
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Tabulation exportToExcel: Difference between revisions

From Catglobe Wiki
No edit summary
 
(One intermediate revision by the same user not shown)
Line 10: Line 10:
== Arguments ==
== Arguments ==


* string ''fileName''
- string ''fileName''


* bool ''isTemporaryFile''
- bool ''isTemporaryFile''


* constant ''worksheetDistribution'': this is optional parameter. If not set will use default with option 1 (each table show on separate sheet)
- constant ''worksheetDistribution'': this is optional parameter. If not set will use default with option 1 (each table show on separate sheet)


- 1: Tabulation_SheetDistribution_OneTabulationEach (each table show on separate sheet)
* 1: Tabulation_SheetDistribution_OneTabulationEach (each table show on separate sheet)


- 2: Tabulation_SheetDistribution_ByHorizontalAxis (tables with same number of columns show on a sheet)
* 2: Tabulation_SheetDistribution_ByHorizontalAxis (tables with same number of columns show on a sheet)
 
NOTE: Tables only show on same excel sheet when they have same columns:
 
* Example case for showing tables on same sheet: {}x{X}, {A}x{X}, {B}x{X}, {C,D}x{X} or {}x{X,Y}, {A}x{X,Y}, {B}x{X,Y}, {C,D}x{X,Y}
 
* Example case for showing tables on difference sheets: {A}x{X}, {A}x{Y}  or {A}x{X}, {B}x{X,Y}


== Return type ==
== Return type ==

Latest revision as of 04:21, 15 October 2018


Tabulation_exportToExcel

Export tabulation to Excel

Syntax

Tabulation_exportToExcel(string fileName, bool isTemporaryFile[, constant worksheetDistribution]);

Arguments

- string fileName

- bool isTemporaryFile

- constant worksheetDistribution: this is optional parameter. If not set will use default with option 1 (each table show on separate sheet)

  • 1: Tabulation_SheetDistribution_OneTabulationEach (each table show on separate sheet)
  • 2: Tabulation_SheetDistribution_ByHorizontalAxis (tables with same number of columns show on a sheet)

NOTE: Tables only show on same excel sheet when they have same columns:

* Example case for showing tables on same sheet: {}x{X}, {A}x{X}, {B}x{X}, {C,D}x{X} or {}x{X,Y}, {A}x{X,Y}, {B}x{X,Y}, {C,D}x{X,Y} 
* Example case for showing tables on difference sheets: {A}x{X}, {A}x{Y}  or {A}x{X}, {B}x{X,Y}

Return type

Empty

Example

//Example for each table show each sheet: not set third parameter
DCS_use(15645932);
createCrossDiagram({"Q1"},{"Gender"});
createCrossDiagram({"Q2"},{"Gender"});
string fileName = "test.xls";
Tabulation_exportToExcel(fileName, true);
print(getWebRoot()+ Catglobe.File.GetDownloadPath(fileName, true));
//Example for each table show each sheet: use third parameter with Tabulation_SheetDistribution_OneTabulationEach
DCS_use(15645932);
createCrossDiagram({"Q1"},{"Gender"});
createCrossDiagram({"Q2"},{"Gender"});
string fileName = "test.xls";
Tabulation_exportToExcel(fileName, true, Tabulation_SheetDistribution_OneTabulationEach);
print(getWebRoot()+ Catglobe.File.GetDownloadPath(fileName, true));


//Example for tables with same columns show on same sheet: use third parameter with Tabulation_SheetDistribution_ByHorizontalAxis
DCS_use(15645932);
createCrossDiagram({"Q1"},{"Gender"});
createCrossDiagram({"Q2"},{"Gender"});
string fileName = "test.xls";
Tabulation_exportToExcel(fileName, true, Tabulation_SheetDistribution_ByHorizontalAxis);
print(getWebRoot()+ Catglobe.File.GetDownloadPath(fileName, true));