Skip to content

Commit

Permalink
Fixed incorrect CSV export for explore mode (fixes jjmontesl#72).
Browse files Browse the repository at this point in the history
  • Loading branch information
jjmontesl committed Jun 7, 2016
1 parent 36cb46d commit 8ac0a90
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions cubesviewer/views/cube/export.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
* @memberof cv.views.cube
*/
angular.module('cv.views.cube').service("exportService", ['$rootScope', '$timeout', 'cvOptions', 'cubesService', 'viewsService', 'seriesOperationsService',
function ($rootScope, $timeout, cvOptions, cubesService, viewsService, seriesOperationsService) {
function ($rootScope, $timeout, cvOptions, cubesService, viewsService, seriesOperationsService) {

/**
* Download facts in CSV format from Cubes Server
Expand Down Expand Up @@ -86,7 +86,13 @@ angular.module('cv.views.cube').service("exportService", ['$rootScope', '$timeou
$(dataRows).each(function(idxr, r) {
values = [];
$(view.grid.columnDefs).each(function(idx, e) {
values.push ('"' + r[e.field] + '"');
if (r[e.field].title) {
// Explore view uses objects as values, where "title" is the label
values.push('"' + r[e.field].title + '"');
} else {
//
values.push('"' + r[e.field] + '"');
}
});
content = content + (values.join(",")) + "\n";
});
Expand Down

0 comments on commit 8ac0a90

Please sign in to comment.